Changes between Version 1 and Version 2 of Old/TinyOS/Serial
- Timestamp:
- Dec 23, 2008, 10:47:04 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Old/TinyOS/Serial
v1 v2 12 12 tells Listen tool to use the serial port /dev/ttyUSB0 at the correct speed for a telosb mote. 13 13 14 Listen creates a packet source and just prints out every packet it sees. Output should look something like this: 15 {{{ 16 17 node1-2:/opt/tinyos-2.1.0/apps/BaseStation# java net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0:telosb 18 serial@/dev/ttyUSB0:115200: resynchronising 19 00 FF FF 00 01 04 00 06 00 01 00 4E 20 00 FF FF 00 01 04 00 06 00 01 00 4F 21 00 FF FF 00 01 04 00 06 00 01 00 50 22 00 FF FF 00 01 04 00 06 00 01 00 51 23 00 FF FF 00 01 04 00 06 00 01 00 52 24 00 FF FF 00 01 04 00 06 00 01 00 53 25 00 FF FF 00 01 04 00 06 00 01 00 54 26 00 FF FF 00 01 04 00 06 00 01 00 55 27 00 FF FF 00 01 04 00 06 00 01 00 56 28 00 FF FF 00 01 04 00 06 00 01 00 57 29 00 FF FF 00 01 04 00 06 00 01 00 58 30 00 FF FF 00 01 04 00 06 00 01 00 59 31 00 FF FF 00 01 04 00 06 00 01 00 5A 32 00 FF FF 00 01 04 00 06 00 01 00 5B 14 33 34 }}} 35 36 37 We use MsgReader to print out the messages. 38 39 {{{ 40 41 node1-2:~# java net.tinyos.tools.MsgReader -comm serial@/dev/ttyUSB0:telosb BlinkToRadioMsg 42 43 }}} 44 45 MsgReader reads the packet send to the serial port, looks at its AM type, and if it matches the AM type of one of the Java message classes passed at the command line, it prints out the packet. We see the output like this: 46 47 {{{ 48 49 1152232617609: Message 50 [nodeid=0x2] 51 [counter=0x1049] 52 53 1152232617609: Message 54 [nodeid=0x2] 55 [counter=0x104a] 56 57 1152232617609: Message 58 [nodeid=0x2] 59 [counter=0x104b] 60 61 1152232617621: Message 62 [nodeid=0x2] 63 [counter=0x104c] 64 65 }}}