...
Note |
---|
Make sure that the motes you want to control with the OapClient app are running the default Include Page |
---|
| OCSDK:_def_smip |
---|
| OCSDK:_def_smip |
---|
| firmware, in Master mode.We assume that the motes are on and that the network is formed. |
- start the application by double-clicking on
OapClient.py
connect to the manager using the following command. The application lists the motes currently operational.
Code Block |
---|
> connect COM23
Operational motes:
0: 00-17-0d-00-00-38-05-da
1: 00-17-0d-00-00-38-03-ca
2: 00-17-0d-00-00-38-06-45
3: 00-17-0d-00-00-38-03-69
4: 00-17-0d-00-00-38-06-6a
5: 00-17-0d-00-00-38-04-35
6: 00-17-0d-00-00-38-07-18
Currently using mote 0 (00-17-0d-00-00-38-05-da).
notifications are ON.
logging to logfile is OFF. |
The following are things you can do:
Getting help
The help
command lists the commands you can use:
Code Block |
---|
Available commands:
- help (h): print this menu
- info (i): information about this application
- quit (q): quit this application
- uptime (ut): how long this application has been running
- connect (c): connect to a serial port
- motes (m): list all the nodes in the network
- select (s): select the mote to use
- notifs (n): toggle whether to print OAP notifications
- writelogfile (w): toggle whether to write OAP notifications to a LOGFILE
- led (l): set/clear blue led
- temp (t): interact with the OAP "temp" resource
- pkgen (p): set the pkgen application on the mote |
Switching OAP notifications on/off
By default, the app prints every OIAP notification it receives. The notifs
commands toggles that on/off:
Code Block |
---|
Received-Time = 1025666138.5 OAP notification from 00-17-0d-00-00-38-07-18: TEMP=2222
Received-Time = 1025666139.43 OAP notification from 00-17-0d-00-00-38-03-ca: TEMP=2521
Received-Time = 1025666139.43 OAP notification from 00-17-0d-00-00-38-03-69: TEMP=2458
Received-Time = 1025666142.42 OAP notification from 00-17-0d-00-00-38-06-6a: TEMP=1986
Received-Time = 1025666148.6 OAP notification from 00-17-0d-00-00-38-06-6a: TEMP=1986
Received-Time = 1025666152.72 OAP notification from 00-17-0d-00-00-38-06-6a: TEMP=1964
notifs
notifications are OFF.
>
> notifs
notifications are ON.
> Received-Time = 1025666187.72 OAP notification from 00-17-0d-00-00-38-06-6a:TEMP=2007
Received-Time = 1025666190.96 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2650 |
List the motes in the network
Code Block |
---|
motes
Operational motes:
0: 00-17-0d-00-00-38-05-da
1: 00-17-0d-00-00-38-03-ca
2: 00-17-0d-00-00-38-06-45
3: 00-17-0d-00-00-38-03-69
4: 00-17-0d-00-00-38-06-6a
5: 00-17-0d-00-00-38-04-35
6: 00-17-0d-00-00-38-07-18 |
Switch LEDs on/off
Code Block |
---|
> led 5 1
<blue LED on mote 00-17-0d-00-00-38-04-35 goes on>
> led 5 0
<blue LED on mote 00-17-0d-00-00-38-04-35 goes on> |
Interact with the temperature sensor
Code Block |
---|
> Received-Time = 1025666400.97 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2542
> Received-Time = 1025666431.86 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2607
Received-Time = 1025666510.99 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2564
Received-Time = 1025666510.99 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2585
<one temperature reading every 30 s by default>
> temp 5 1 1000
> Received-Time = 1025666551.28 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2585
Received-Time = 1025666555.05 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2628
Received-Time = 1025666555.22 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2585
Received-Time = 1025666555.4 OAP notification from 00-17-0d-00-00-38-04-35: TEMP=2564
<one temperature reading every 1 s>
> temp 5 1 30000
<one temperature reading every 30 s> |
Interact with the packet generator
Have mote 00-17-0d-00-00-38-04-35
send 10 packets, one every 100ms, filled with 15 bytes
Code Block |
---|
> pkgen 0 10 100 15
> Received-Time = 1025666787.65 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=0 startPid=0 numPackets=10
Received-Time = 1025666787.85 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=1 startPid=0 numPackets=10
Received-Time = 1025666787.94 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=2 startPid=0 numPackets=10
Received-Time = 1025666788.04 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=3 startPid=0 numPackets=10
Received-Time = 1025666788.14 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=4 startPid=0 numPackets=10
Received-Time = 1025666788.6 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=5 startPid=0 numPackets=10
Received-Time = 1025666788.63 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=6 startPid=0 numPackets=10
Received-Time = 1025666788.67 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=7 startPid=0 numPackets=10
Received-Time = 1025666788.7 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=8 startPid=0 numPackets=10
Received-Time = 1025666788.74 OAP notification from 00-17-0d-00-00-38-04-35: PKGEN pid=9 startPid=0 numPackets=10 |