Tmote Macintosh install

From TinyWiki

Jump to: navigation, search

Contents

Getting Tmotes and TinyOS to work on Mac OS X

Useful links

Instructions

  1. install the Apple Developer Tools that are on your install DVD
    • if you don't have your DVD they can be found here
  2. Install wget
    • fink install wget
  3. Install textutils (for sha1sum)
    • fink install textutils
  4. Download TinyOS must be version tos-1-1-15Dec2005cvs-release
  5. First log in anonymously:
    • cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login
  6. The checkout the cvs release
    • cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co -r tos-1-1-15Dec2005cvs-release tinyos-1.x/
  7. Install FTDI drivers for MacOS from here
  8. Plug in a TMote Sky mote and verify that it is detected as /dev/tty.usbserial-M4A444LX (or something similar).
  9. Apply the following patch to tools/src/mspgcc/build-mspgcc
  10. Install the msp-gcc
    • cd tools/src/mspgcc
    • ./build-mspgcc install
  11. Download nesc-1.2.4.tar.gz from the NesC sourceforge page.
  12. Unpack nesc-1.2.4.tar.gz
  13. Edit nesc-1.2.4/src/libcompat/pages.c and comment out line 184
    • /* #define USE_MMAP */
  14. Build and install NesC with:
    • DEFAULT_TARGET=telos ./configure
    • make
    • sudo make install
  15. Install ncc
    • cd tools/src/ncc
    • DEFAULT_TARGET=telos ./Bootstrap
    • ./configure
    • make
    • sudo make install
  16. Add the following to the ~/.bash_profile file
    • export MSPGCCROOT=/opt/msp430
    • export TOSROOT=$HOME/Documents/tinyos-1.x
    • export TOSDIR=$TOSROOT/tos
    • export MAKERULES=$TOSROOT/tools/make/Makerules
    • export PATH="$MSPGCCROOT/bin:$PATH
  17. Make a slight change to tools/src/sf/sfsource.c:saferead(). After the return from read(), change the next line to
    • if (n == -1 && (errno == EINTR || errno == EAGAIN))
    • This allows the C-based SerialForwarder to work. Build it by typing make.
    • This change has been commited to CVS
  18. Replace tools/java/net/tinyos/packet/SerialByteSource.java with the version found here
    • This version is a stub that will not actually attempt to access the serial port, but also does not depend on javax.comm (which does not appear to be available for MacOS/Intel). You must use the C-based serial forwarder. Alternately you can try to install tinyos-1.x/beta/TOSComm but I have not tried this option.
  19. Install msp430-bsl
    • sudo ln -sf $TOSDIR/../tools/src/mspgcc-pybsl/bsl.py /usr/local/bin/msp430-bsl
  20. Apply the following patch to tools/make/msp/bsl.extra
    • bsl.extra.patch
    • This allows for calling make telosb/tmote install without having to specify the /dev/tty.usbserial-<serial> everytime
  21. Download the Mac OS X version of motelist
    • Put it in /usr/local/bin
    • sudo chmod +x /usr/local/bin/motelist-macos
    • ln -sf /usr/local/bin/motelist-macos /usr/local/bin/motelist

Testing

You should now be able to install TinyOS binaries on motes

  1. Try building the Blink application
    • cd apps/Blink
    • make telosb install
  2. You should also be able to talk to motes over the serial port by starting up the C-based serialforwarder:
    • cd tools/src/sf
    • ./sf 9001 /dev/tty.usbserial-<serial> 57600 telos &
    • ./sflisten localhost 9001
Personal tools