Tracking
Hardware
Software
Mega Plan
Etc.
|
How to use the Motes
Loading the Motes
- Ensure the USB connector on the mote is connected with the free USB port on the Raspberry Pi
- Navigate to the mote_tool helper program directory
Absolute Path: /home/pi/flockbot/wsn/Mote_Tool
Relative Path: ~/flockbot/wsn/Mote_Tool
- Launch the mote_tool program
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ pwd
/home/pi/flockbot/wsn/Mote_Tool
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ ./mote_tool
Enter your option:
0 - Quit the Program
1 - Burn Node ID
2 - Load the RSSI Program
3 - Load the Beacons Program
4 - Load the Diagnostic Program
>
- Select option 1 to set the ID for the mote. Valid IDs range from 1-127. This is your beacon number.
Note: This may take a minute or two to execute.
> 1
Enter the mote ID:
> 3
using saved target 'sky'
rm -f *~ *core core *.srec \
...
...
Reset device ...
Done
make[2]: Leaving directory `/home/pi/flockbot/wsn/BurnNodeID'
make[1]: Leaving directory `/home/pi/flockbot/wsn/BurnNodeID'
rm burn-nodeid.ihex
Enter your option:
- At this time, follow the instructions in the next section to verify the mote load and verify the program run.
Note: When doing a future check, the key line is on line 3:
... Node id is set to 3.
The verification following this load should look like the following. If the Restored ID is not your Burned ID, then the mote is bad.
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ sh connect.sh
connecting to /dev/ttyUSB0 (115200) [OK]
?!??#??3????*?1Rime started with address 0.18.116.0.16.203.133.3
MAC 00:12:74:00:10:cb:85:03 Contiki 2.6 started. Node id is set to 3.
CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26
Tentative link-local IPv6 address fe80:0000:0000:0000:0212:7400:10cb:8503
Starting 'Burn node id'
Burning node id 3
Restored node id 3
- Now use mote_tool to load the program of choice on to the mote. The following is an example of loading the Beacon code.
This will take a long time the first time this is compiled on each flockbot.
Note: Occasionally this will also end in a segfault. This is due to the flashing program and is normal if it occurs after Reset Device...
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ ./mote_tool
Enter your option:
0 - Quit the Program
1 - Burn Node ID
2 - Load the RSSI Program
3 - Load the Beacons Program
4 - Load the Diagnostic Program
> 3
Select your mode:
1 - Robot
2 - Beacon
> 2
Specify Beacon Send Timer (seconds): 10
Specify Beacon Decay Timer (seconds): 2
Specify Beacon Decay Percentage (per timer tick): 5
using saved target 'sky'
...
...
Reset device ...
Done
make[2]: Leaving directory `/home/pi/flockbot/wsn/Beacons'
make[1]: Leaving directory `/home/pi/flockbot/wsn/Beacons'
rm beacon.co beacon.ihex obj_sky/contiki-sky-main.o
Segmentation fault
- Run the verification connect tool and verify normal operations, as applicable. At this point your mote is programmed and ready for operation.
The following is a sample of verifying a Beacon mote. The Robot program will not give any output.
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ sh connect.sh
connecting to /dev/ttyUSB0 (115200) [OK]
?+?W?????#??[ 3],TX, 3, 97, 97, 97, 97, 97, 97
[ 3],TX, 3, 95, 95, 95, 95, 95, 95
[ 3],TX, 3, 91, 91, 91, 91, 91, 91
[ 3],TX, 3, 89, 89, 89, 89, 89, 89
[ 3],TX, 3, 86, 86, 86, 86, 86, 86
Verify the Mote Load
- Ensure the USB connector on the mote is connected with the free USB port on the Raspberry Pi
- Navigate to the mote_tool helper program directory
Absolute Path: /home/pi/flockbot/wsn/Mote_Tool
Relative Path: ~/flockbot/wsn/Mote_Tool
- Launch the connect program. You will see junk on the line. Once connected, either wait until the junk clears or press the RESET button on the mote.
Note that this is a direct serial interface. The only way to quit this program is to issue a CTRL-C
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ sh connect.sh
connecting to /dev/ttyUSB0 (115200) [OK]
?+?W?????#??[ 3],TX, 3, 97, 97, 97, 97, 97, 97
[ 3],TX, 3, 95, 95, 95, 95, 95, 95
[ 3],TX, 3, 91, 91, 91, 91, 91, 91
[ 3],TX, 3, 89, 89, 89, 89, 89, 89
[ 3],TX, 3, 86, 86, 86, 86, 86, 86
Troubleshooting
- If the connect.sh tool gives you this error:
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ sh connect.sh
connect.sh: 2: connect.sh: ../contiki/tools/sky/serialdump-linux: not found
Then, follow these steps
pi@raspberrypi ~/flockbot/wsn/Mote_Tool $ cd ../contiki/tools/sky/
pi@raspberrypi ~/flockbot/wsn/contiki/tools/sky $ make
cc -o serialdump-linux serialdump.c
serialdump.c: In function ‘main’:
serialdump.c:280:4: warning: incompatible implicit declaration of built-in function ‘strftime’ [enabled by default]
serialdump.c:280:4: warning: passing argument 4 of ‘strftime’ makes pointer from integer without a cast [enabled by default]
serialdump.c:280:4: note: expected ‘const void *’ but argument is of type ‘int’
The warnings are normal. After this completes, the connect tool will run normally.
Programming the Motes (On-Board API)
In your behavior file:
Programming the Motes (Socket)
As no-one appears to be doing this, the instructions will be deferred until the next version of the Flockbot goes online.
|