TinyOS, LEGO NXT, and OSX

I created a project that consists in the main repository of TinyOS and the project NXTMOTE. The project NXTMOTE doesn't work right out of the box; you can't do the "make" command, under the applications, and expect them to work. Therefore, in order for you to use the NXT with TinyOS, you need to add the new target "nxtmote" to TinyOS. I've done just that, and even though I couldn't integrate the upload tool "fwflash" as I wanted (that is, just doing "make nxtmote install" under the application folder), I can still do it manually.

 

Keep in mind, though, that this is not further development on the NXTMOTE, whose development seems to have ended many years back. This is just a successful attempt on running NXTMOTE on OSX. Every application that didn't compile before with this target, won't compile now. 

For this to work, you have to already have NESC compiler installed on your system, and after downloading this package, you have to export the $(installationFolder)/tinyOSsourceNXT/misc/src/libnxt/ to your path:

 

export PATH="$(installationFolder)/tinyOSsourceNXT/misc/src/libnxt/:$PATH"

 

Apart from this, I had to specify some paths manually in some Makefiles, like the file "Makerules" under /support/make/Makerules. If you get some erros related to not being able to find the specified target, then it means it is not reaching every Makefile*. For instance, in this "Makerules" file, you can find  on the line 83 the following:

 

TOSMAKE_PATH += /Users/Xavier/Documents/tinyOS/tinyOSsourceNXT_test/support/make/platforms/at91/

 

This is the path for the platform at91, of the NXT. Needless to say, it will be different in your case, so in your case remove the prefix "/Users/Xavier/Documents/tinyOS/tinyOSsourceNXT_test", and add your instalation folder. If you don't know which one is it, just perform the command pwd in the console, and you'll find it.

 

After this, you should be done with the prerequisites. If you're not, PLEASE INSTALL THE TINYOS PROJECT ALONE, and see what you're missing.

To verify the installation, you can compile the Blink application, as I did:

 

cd $(installationFolder)/tinyOSsourceNXT/apps/Blink

make nxtmote

 

(if, in here, you get the error "build/nxtmote/app.c: failed to truncate target: No such file or directory"), then it means it cant create a folder for the build. In this case, before the make, do:

 

mkdir build/nxtmote

make nxtmote

 

 

If successful, you should see this:

 

To upload, the command is as follows:

 

fwflash build/nxtmote/main.ihex

 

 

THAT'S IT. What did you get? This:

 

 

 

Project: tinyOSsourceNXT.tar.bz2

Published by fxsf às 18:57