-
Notifications
You must be signed in to change notification settings - Fork 0
xbcli modules
xbcli modules is a command set for managing XBee module profiles.
A module profile is a set of properties that describe, among others, module features and how it is configured. Some of these properties are:
- The module hardware type (Series 1, Series 2, ...).
- The module supported data protocol (802.15.4 or Zigbee).
- The serial port that connects the xbcli host and the XBee module
- The module serial interface configuration (baudrate, parity and stop bits).
- The module serial interface protocol (transparent or API).
Adds a module profile.
The profile is stored in a file called xbcli-profiles
in the local directory or in the directory set by the env. var $XBCLI_PROFILES_DIR
if defined.
xbcli modules add (-i |--id=)PROFILE_ID
(-s |--serial-port=)SERIAL_PORT
[(-d |--description=)PROFILE_DESCRIPTION]
[(-h |--hardware=)HARDWARE_TYPE]
[(-p |--protocol=)PROTOCOL]
[(-m |--mode=)OPERATION_MODE]
[(-b |--baudrate=)BAUD_RATE] [(-a |--parity=)PARITY] [(-o |--stop-bits)=STOP_BITS]
Unique profile id. Required.
Serial port identifier that connects the xcli host with the XBee module. Required.
Profile verbose description. Optional.
Module hardware type, being HARDWARE_TYPE
one of these values:
-
x1
: XBee Series 1(PRO) -
x2
: XBee Series 2(PRO) -
x2b
: XBee Series 2B(PRO) -
x2c
: XBee Series 2C(PRO) -
x3
: XBee Series 3(PRO)
Optional, default value x3
.
Data protocol supported by the module, being PROTOCOL
one of these values:
-
dot4
: Module supports 802.15.4 protocol (not available for Series 2/2B and their PRO variants) -
zigbee
: Module supports Zigbee protocol (not available for Series 1 and its PRO variant)
Optional, default value zigbee
(dot4
if HARDWARE_TYPE
=x1
).
Serial interface protocol supported by the module, being OPERATION_MODE
one of these values:
-
api
: Module works in API mode -
transparent
: Module works in transparent mode
Optional, default value api
.
NOTE: Only API mode is supported in the current version.
XBee module serial port baudrate, being BAUD_RATE
one of these values:
1200
2400
4800
9600
19200
38400
57600
115200
-
230400
(available on Series 2C and 3 and their PRO variants) -
460800
(available on Series 2C Zigbee and Series 3 and their PRO variant) -
921600
(available on Series 2C Zigbee and Series 3 and their PRO variant)
Optional, default value 9600
.
XBee module serial port baudrate, being PARITY
one of these values:
-
none
: No parity -
even
: Even parity -
odd
: Odd parity -
mark
: Mark parity (not available on Series 3 and its PRO variant)
Optional, default value n
.
XBee module serial port baudrate, being STOP_BITS
one of these values:
-
1
: 1 stop bit -
2
: 2 stop bits
Optional, default value 1
. Not available on Series 1 and 2C 802.15.4 (and their PRO variants).
The next command creates a profile identified as xbee3ZB
for a XBee Seroes 3 ZigBee module connected to the serial port /dev/ttyS0
with a speed of 9600 bauds, 8 data bits, 1 stop bit and no parity. Note that most of the above options are set by the default values of the missing arguments, as hardware type, data protocol, baud rate, stop bits and parity.
xbcli modules add -i xbee3ZB -s /dev/ttyS0
The next command creates a profile identified as xbee1
for a XBee Series 1 module connected to the serial port COM1
with a speed of 115200 bauds, 8 data bits, 1 stop bit and no parity. Note that long parameter names are used in this example.
xbcli modules add --id=xbee1 --description="My beloved old legacy module" --serial-port=COM1 --hardware=x1 --baudrate=115200
Removes an existing module profile.
The profile must be stored in a file called xbcli-profiles
in the local directory or in the directory set by the env. var $XBCLI_PROFILES_DIR
if defined.
xbcli modules remove (-i |--id=)PROFILE_ID
Unique profile id. Required.
The next command removes the profile identified as xbee3ZB
.
xbcli modules remove -i xbee3ZB
Prints in the standard output a list of the existing module profiles stored in a file called xbcli-profiles
in the local directory or in the directory set by the env. var $XBCLI_PROFILES_DIR
if defined.
xbcli modules list [(-f |--format=)LIST_FORMAT]
Format used for printing the list, being LIST_FORMAT
one of these values:
-
human
: List printed in human-readable format -
json
: List printed in JSON format
Optional, default value human
.
The next command lists the existing profiles in JSON format:
xbcli modules list --format=json