WiSense coordinator/gateway CLI (command line interface)

The coordinator CLI is a small Linux app which talks to the coordinator node. It can be used to get info from the coordinator as well as configure the coordinator / network. This app comprises a few “.c” and “.h” files. This app can be run on any Linux system including the Raspberry Pi. It can also be run on Cygwin. You can compile the app by running the included script “comp”.

Step #1 – Compile the app by running “comp”.

Step #2 – Connect the coordinator to the laptop/PC using the USB cable

Step #3 – Get the serial port device created when you plugged in the USB cable (other end connected to the coordinator)

Step #4 – Execute the app

$>  ./gw.exe  /dev/ttyUSB0  cea

Coordinator’s 64 bit (extended) address – 0xfc:0xc2:0x3d:0x0:0x0:0x0:0xe8:0xa9

 

List of supported command strings :-

$> ./gw.exe ?
——————————————————————————
* sc – start the coordinator

* nc – get number of nodes in the network

* nid – get the 16 bit network id

* rfb – get the radio frequency band

* grch – get the radio channel number

* srch – set the radio channel number

* rcf – get the radio carrier frequency

* grbr – get the radio baud rate

* grm – get the radio modulation format

* rtp – get the transmit power of the radio on the coordinator

* cea – get the coordinator’s 64 bit address

* nl – list all nodes in the network

* rpn – get the part number of the radio on the coordinator

* nj-ena – allow nodes to join the coordinator

* nj-dis – do not allow nodes to join the coordinator

* nj-sts – are nodes currently allowed to join the coordinator ?

* wl-get – Get white list (list of all nodes allowed to join this nwk)

* wl-add – Add node to white list
example: wl-add fc:c2:3d:0:0:0:e9:54

* wl-del – Remove node from white list
example: wl-del fc:c2:3d:0:0:0:e9:54

* wl-clr – Delete the white list

* cfg-dpi – Confgure node’s data push interval
format: cfg-r-dpi <short-address> <interval in seconds>
example: cfg-r-dpi 0x5 3
——————————————————————————

 

Let us look at each command in detail.

 

[sc]: This command is used to request the coordinator node to start normal operations. After reset (power cycle or push button reset), this command has to be given so that the coordinator will start network formation.

$ ./gw.exe  /dev/ttyUSB0  sc

done

 

 

[nc]: Use this command to get the number of nodes which are currently part of the LPWMN (low power wireless mesh network) managed by this coordinator.

$ ./gw.exe  /dev/ttyUSB0  nc

Number of nodes in the network – 2

 

 

[nl]: Use this command to get a list of nodes which are currently part of the LPWMN (low power wireless mesh network) managed by this coordinator.

$ ./gw.exe  /dev/ttyUSB0  nl

Node Index <0> / short addr <0x2> / ext addr <0xfc:0xc2:0x3d:0x0:0x0:0x0:0xdc:0xef> / node cap <0x80>

Node Index <1> / short addr <0x3> / ext addr <0xfc:0xc2:0x3d:0x0:0x0:0x0:0xdc:0xfd> / node cap <0x80>

 

 

[nid]: Use this command to get the 16 bit network id of the LPWMN manages by this coordinator

$ ./gw.exe  /dev/ttyUSB0  nid

0x1277

 

 

[rfb]: Use this command to get the radio band in which the network is operating

$ ./gw.exe  /dev/ttyUSB0  rfb

865-867 MHz

 

 

[grch]: Use this command to get the specific channel number in which the network is operating

$ ./gw.exe  /dev/ttyUSB0  grch

Radio channel – 5

 

 

[srch]: Use this command to change the specific channel number in which the network will operate. This command can only be given before the coordinator is started (using the sc command).

$ ./gw.exe  /dev/ttyUSB0  srch  3

done

 

 

[rcf]: Use this command to get the frequency of the channel in which the network is operating.

$ ./gw.exe  /dev/ttyUSB0  rcf

865.199829 MHz

 

 

[grbr]: Use this command to get the network’s radio baud rate.

$ ./gw.exe  /dev/ttyUSB0  grbr

38383 baud

 

 

[grm]: Use this command to get the network’s radio modulation scheme.

$ ./gw.exe  /dev/ttyUSB0  grm

GFSK

 

 

[rtp]: Use this command to get the radio transmit power (same for all radios in the network).

$ ./gw.exe  /dev/ttyUSB0  rtp

+10.80 dBm

 

 

[cea]: Use this command to get the coordinator’s fixed 64 bit extended address.

$ ./gw.exe  /dev/ttyUSB0  cea

Coordinator’s 64 bit (extended) address – 0xfc:0xc2:0x3d:0x0:0x0:0x0:0xe8:0xa9

 

 

[rpn]: Use this command to get the part number of the radio on the coordinator

$ ./gw.exe  /dev/ttyUSB0  rpn

CC1101

 

 

[nj-dis]: Use this command to request the coordinator to stop accepting join requests from nodes.

$ ./gw.exe  /dev/ttyUSB0  nj-dis

done

 

 

[nj-ena]: Use this command to request the coordinator to start accepting join requests from nodes.

$ ./gw.exe  /dev/ttyUSB0  nj-ena

done

 

 

[nj-ena]: Use this command to find out if the coordinator is currently accepting join requests from nodes.

$ ./gw.exe  /dev/ttyUSB0  nj-sts

network join enabled/disabled

 

 

[wl-get]: Use this command to get all nodes in the “allowed-to-join” white list. If this list is not empty, the coordinator will only accept join requests from node’s on this list. On the other hand, if this list is empty, the coordinator will not disallow any node from joining.

$ ./gw.exe  /dev/ttyUSB0  wl-get

Tbl Index <0> / ext addr <0xfc:0xc2:0x3d:0x00:0x00:0x00:0xdc:0xef>
Tbl Index <1> / ext addr <0xfc:0xc2:0x3d:0x00:0x00:0x00:0xdc:0xfd>
Tbl Index <2> / ext addr <0xfc:0xc2:0x3d:0x00:0x00:0x00:0x12:0x34>

 

 

[wl-add]: Use this command to add a node to the “allowed-to-join” white list.

$ ./gw.exe  /dev/ttyUSB0  wl-add  0xfc:0xc2:0x3d:0x00:0x00:0x00:0xdc:0xef

request sent …

 

 

[wl-del]: Use this command to delete a node from the “allowed-to-join” white list.

$ ./gw.exe  /dev/ttyUSB0  wl-del  0xfc:0xc2:0x3d:0x00:0x00:0x00:0xdc:0xfd

request sent …

 

 

[wl-clr]: Use this command to empty the “allowed-to-join” white list.

$ ./gw.exe  /dev/ttyUSB0  wl-clr  

request sent …

 

 

[cfg-dpi]: Use this command to configure the frequency at which the specified node send’s sensor data to the external world (through the coordinator node). The third argument is the short address of a node and the fourth argument is the interval between consecutive sensor data messages. In the example below, the interval on node “0x2” is being set to 1 second.

$ ./gw.exe  /dev/ttyUSB0  cfg-dpi   0x2   1 

request sent …

 

 

 

Posted on November 15, 2014, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: