Wasp Mote Runner
From Glacsweb Wiki
Instructions compiled from the technical documentation and other sources when needed.
Contents
Basic Install
- install deps
sudo apt-get install mono-mcs mono-xsp2 mono-xsp2-base
- install jdk
- Download mote runner sdk from the IBM site
- Extract to /opt
- Add the following to /etc/bash.bashrc (that way it works for all users)
export PATH=$PATH:/opt/moterunner/linux64/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/moterunner/linux64/bin
Install AVR programmer
- Add the following to /etc/udev/rules.d/60-avrisp.rules (from http://stackoverflow.com/questions/5412727/avrisp-mkii-doesnt-work-with-avrdude-in-linux and http://ubuntuforums.org/showthread.php?t=1985915)
SUBSYSTEM!="usb", ACTION!="add", GOTO="avrisp_end"
# Atmel Corp. JTAG ICE mkII ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2103", MODE="660", GROUP="dialout" # Atmel Corp. AVRISP mkII ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2104", MODE="660", GROUP="dialout" # Atmel Corp. Dragon ATTR{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="660", GROUP="dialout" LABEL="avrisp_end"
- Restart udev
sudo service udev restart
Flash mote
Remove the radio first! This is only needed once for new nodes.
cd /opt/moterunner/firmware/ avrdude -cavrispmkII -pm1281 -P usb -b 115200 -e -u -U efuse:w:0xFF:m -U hfuse:w:0xD0:m -Ulfuse:w:0xFF:m avrdude -cavrispmkII -pm1281 -P usb -b 115200 -U flash:w:waspmote.hex
Replace the radio and sticker
Compile MRv6
cd /opt/moterunner/examples/mrv6/src make clean make make doc
Adding code to the nodes
Run mrsh
source examples/mrv6/lib/js/mrv6.js mote-create -p /dev/ttyUSB0
v6-config --RADIO_SELECT=2 --CHANNEL 0
(this last line is essential for the 868MHz radios)
Gateway
source examples/mrv6/lib/js/mrv6.js v6-setup --MAX_MOTES=4 --RADIO_SELECT=2 --CHANNEL 0 moma-load mrv6-edge moma-ipv4 --ip x.x.x.x --subnwMask m.m.m.m --gateway y.y.y.y --udp 9999
Other nodes
moma-load mrv6-lib
Load an example code
cd /opt/moterunner/examples/mrv6/apps/reply mrsh mote-create -p /dev/ttyUSB0 moma-load reply
Starting gateway
cd /opt/moterunner/examples/mrv6/tunnel
./tunnel --waspmote <ip>:<port> use for additional debug -l LOG_DEBUG
chmod +x router_setup_linux_ipv6.sh
The above file is where you choose the subnet for your nodes
Then run
./router_setup_linux_ipv6.sh
The tunnel output should then give you a v6 address in the node list which you should be able to ping6
cd /opt/moterunner/ mrsh source examples/mrv6/lib/js/mrv6.js mote-create -i <ip>:<port>
This will create a link to the real node
Instead use network list to find out the short name. This will give an output along the lines of
Mote-Abbrev Name State Connection Uniqueid Addresses ------------------------------------------------------------------------------------------------------------- u0,w0 152.78.64.21 on UDP:152.78.64.214:9999 02-00-00-00-47-AC-67-2F udp://152.78.64.214:9999
Then use the mote-abbrev given for the following command
u0 v6-setup --MAX_DEPTH=12 --NUM_CHILDREN=5 --MAX_CHILDREN=5 --MAX_MOTES=6 --RECV_SAFETY_MILLIS=3 --R24_SLOT_RCV_MILLIS=12 --R24_SLOT_GAP_MILLIS=15 --R24_BEACON_GAP_MILLIS=20 --INFO_INTERVAL_CNT=0
General Notes
Thanks to Alexandru @ IBM MoteRunner for these
- If no node address is specified the command runs on all available nodes.
- You can always address a mote with the short name, the mote's full EUI, or the mote's unique least significant bytes (as hex) from the EUI
Sticker code
- Orange - had firmware flashed
- Green - gateway