MultiConnNet Module Instruction Set #
The MultiConnNet is Inplay’s proprietary Multi-Connection Private Network system. It is a 2.4GHz wireless communication network based on a private SDR (Software Defined Radio) protocol, utilizing a one-to-many star connection topology.
The system is comprised of two primary components: the gateway module and the node module. The module is connected to the HOST via UART, and this instruction set defines the data interaction format between the module and the HOST.
The data received by the module is referred to as a Command, and after executing the command, the module will return a Result. The data actively sent by the module is called an Event.
Whether it is a command, result, or event, the data consists of a sequence of bytes, which are divided into two parts: header and body. Header exists in any data packet while body varies depending on the specific command or event.
The format of the instruction is as follows, while the data body varies depending on the specific command or event.
Header(4bytes) | Body(viriable) |
---|
Figure 1: Data format
Sync Word(1byte) | ID(1byte) | Len(1byte) |
---|
Figure 2: Header format
Sync Word field of header is fixed 0x4A for command and corresponding result, and 0xA4 for event.
ID field of header is the unique command or event ID.
Len field of header indicates the length of variable body that follows.
Command Description #
Reset(ID=1) #
This command resets the module. The command is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | option | 1 | 0: Reset 1: Clear configuration before reset 2: Save configuration before reset |
Example:
→ 4A 01 01 02 ;Save configuration before reset
Get State(ID=2) #
This command retrieves the module status, and the length of this command is 0. The response is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | state | 1 | Current module state. 0: Not running, module may not be fully configured yet 1: Running |
Example:
→ 4A 02 00 ;Try retrieving module status
← 4A 02 01 01 ;Module is running normally
Get Connection(ID=3) #
This command retrieves the connection status of the device. For the gateway, it returns the number of connected nodes and their corresponding device addresses; for nodes, a return value of 0 of number indicates not connected, while a value of 1 indicates connected.
The length of this command is 0. The response is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | number | 1 | Number of connected devices |
4 | device address | number*2 | Device addresses of connected nodes or gateway. |
Example:
→ 4A 03 00 ;Try retrieving the connection status of the device
← 4A 03 06 03 00 01 01 01 02 01 ;Gateway returns connection with 3 nodes and corresponding device address are 0x0100,0x0101,0x0102
← 4A 03 03 01 01 00 ;Node returns connection with gateway with device address 0x0001
Serial Port Configuration(ID=4) #
This command changes the serial port parameters. It is optional, meaning that if not configured, the module will use following default configurations:
- GPIO_2_1 as UART TX and GPIO_2_7 as UART RX
- 921,600 bps
- 8 bits
- No Parity
- 1 Stop bit
- Hardware flow control disabled
The command is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | TX GPIO | 1 | Specify which GPIO is multiplexed for UART TX function. The upper 4 bits represent the Port, and the lower 4 bits represent the Pin. For example, for GPIO_0_2, TX GPIO=0x02. |
4 | RX GPIO | 1 | Same as TX GPIO |
5 | RTS GPIO | 1 | Same as TX GPIO. If 0xFF, RTS signal is not used. |
6 | CTS GPIO | 1 | Same as TX GPIO. If 0xFF, CTS signal is not used |
7 | baud rate | 4 | Support 921600, 460800, 230400, 115200, 57600, 38400, 19200 |
11 | data bit | 1 | Data bit length. 5 - 8 |
12 | polarity | 1 | 0: None 1: Odd 2: Even |
13 | stop bit | 1 | Stop bit number |
14 | receive buffer size | 4 | Receive buffer size, Maximum 2048 |
18 | reserved | 1 | 0x00 |
Example:
→ 4A 04 10 21 27 FF FF 00 C2 01 00 08 00 01 2C 01 00 00 00 ;GPIO_2_1, GPIO_2_7, 115200bps
← 4A 04 02 00 00
Network Parameter Configuration(ID=5) #
This command configure network parameters for Gateway and Node. When Gateway, the command is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | gateway device address | 2 | A 16-bit value that can only be taken from 0x1000 to 0xF000, where the lower 12 bits are all zeros. |
5 | access address on connection | 4 | Access Address when data communication after connection |
9 | access address on pairing | 4 | Access Address when pairing procedure |
13 | channel on pairing | 1 | Channel when pairing procedure. |
Example:
;Device address (Gateway) is 0x1000, Access Addresses are 0x67453201 and 0xABABABAB, Channel for pairing is 37
→ 4A 05 0B 00 10 01 23 45 67 AB AB AB AB 25
← 4A 05 02 00 00
When Node, the command is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | node device address | 2 | A 16-bit value that can only be taken from 0x0000 to 0x0FFF, where the upper 4 bits are all zeros. |
5 | gateway device address | 2 | A 16-bit value that can only be taken from 0x1000 to 0xF000, where the lower 12 bits are all zeros. |
7 | access address on pairing | 4 | Access Address when pairing procedure |
11 | channel on pairing | 1 | Channel when pairing procedure. |
12 | connection interval | 2 | Node's connection interval. |
14 | supervision timeout | 4 | Time in millisecond, that allowed for a device to receive data or signals from another device. If no data is received within this timeframe, the connection may be considered lost or disconnected. |
18 | pair interval | 2 | Time interval in millisecond for sending pairing interaction information. The smaller the interval, the faster the pairing will be successful, but power consumption will increase. |
20 | pairing duration | 4 | Duration of pairing procedure in millisecond. 0 if non stop. |
Example:
;Node's device address is 0x0100, access address on pairing is 0x67453201, connection interval is 800ms, supervision timeout is 20000ms, pair interval is 50ms and pairing is not stopped.
→ 4A 05 15 00 01 00 10 AB AB AB AB 25 20 03 20 4E 00 00 32 00 00 00 00 00
← 4A 05 02 00 00
External Power Amplifier Control Configuration(ID=6) #
This command sets up module’s external Power Amplifier (PA) Control function. TX GPIO will automatically output high to open electronic circuits of power amplifier when RF is opened for transmission. RX GPIO and BIAS GPIO share similar working principles.
This command is optional, meaning that if not configured, the module will by default use GPIO_3_3 and GPIO_2_5 as the TX and RX GPIOs with BIAS unused.
The command is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | TX GPIO | 1 | GPIO which is used to control Tx_En of expernal PA. The upper 4 bits represent the Port, and the lower 4 bits represent the Pin. For example, for GPIO_3_3, it is 0x33. |
4 | RX GPIO | 1 | GPIO which is used to control Rx_En of expernal PA. The upper 4 bits represent the Port, and the lower 4 bits represent the Pin. For example, for GPIO_2_5, it is 0x25. |
5 | BIAS GPIO | 1 | GPIO which is used to control bias of expernal PA. The upper 4 bits represent the Port, and the lower 4 bits represent the Pin. If no bias control, set it to 0xFF. |
Example:
→ 4A 06 03 33 25 FF ;TX GPIO is GPIO_3_3, RX GPIO is GPIO_2_5, no BIAS
← 4A 06 02 00 00
GPIO Input Configuration(ID=7) #
This command configures the input functionality of the module’s GPIO. When the input state is triggered, it will send an ‘IO Trigger’ event to the local HOST via UART or remotely send the event to connected device over the air. The command is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | GPIO | 1 | GPIO which is configured as input functionality. The upper 4 bits represent the Port, and the lower 4 bits represent the Pin. For example, for GPIO_0_4, it is 0x04. |
4 | internal pull up/down | 1 | 0: no pull up/down 1: internal pull up 2: internal pull down |
5 | edge-triggered condition | 1 | 0: falling edge 1: rising edge 2: both edge |
6 | target | 1 | 0: local HOST 1: remote connected device |
Example:
→ 4A 07 04 04 01 00 01 ;GPIO_0_4 falling edge trigger with internal pull up enabled, event will be remotely sent.
← 4A 07 02 00 00
Run(ID=8) #
This command start or stop running of module. If network parameter configuration is not stored, it is necessary to send this command to start the module, otherwise system will automatically start running after power on reset. The command is as follows:
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | option | 1 | 0: Stop1: Start |
Example:
→ 4A 08 01 01 ;GPIO_0_4 falling edge trigger with internal pull up enabled, event will be remotely sent.
← 4A 08 02 00 00
Data Transmission(ID=9) #
This command initiates data transmission either from Gateway to Node or Node to Gateway. The module will return the result indicating that the command has been accepted and is ready to send. The actual transmission result in the air will depend on the outcome of the completion event.
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | device address | 2 | Destination device address |
5 | data | Len-2 | Banary byte data array |
Example:
→ 4A 09 05 01 01 0A 0B 0C ;Send 3 bytes (0A 0B 0C) to node of 0x0101
← 4A 09 02 00 00 ;Send data is accepted
...
← A4 66 04 01 01 00 00 ;Transmission done event
→ 4A 09 05 00 10 0A 0B 0C ;Send 3 bytes to gateway of 0x1000
← 4A 09 02 00 00 ;Send data is accepted
...
← A4 66 04 00 10 00 00 ;Transmission done event
GPIO Output(ID=10) #
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | GPIO | 1 | GPIO which is configured as output functionality. The upper 4 bits represent the Port, and the lower 4 bits represent the Pin. For example, for GPIO_0_4, it is 0x04. |
4 | level | 1 | Output level. 0 : Low level other : High level |
5 | target device address | 2 | 0 : local other : for Gateway it is remote node's device address; for Node it's not applicable. |
Example:
→ 4A 0A 04 01 01 00 01 ;Gateway send command to remote control Node's GPIO_0_1 output high
← 4A 0A 02 00 00 ;Send data is accepted
...
← A4 66 04 01 01 00 00 ;Transmission done event
→ 4A 09 05 00 10 0A 0B 0C ;Send 3 bytes to gateway of 0x1000
← 4A 09 02 00 00 ;Send data is accepted
...
← A4 66 04 00 10 00 00 ;Transmission done event
Result #
A Result is the response returned by the module, indicates whether the command sent to the module has been accepted or not. The Result is a fixed length of two bytes, following the same header as the corresponding command. The available results are as follows:
NAME | VALUE | MEANING |
---|---|---|
WL_ERR_NO_ERROR | 0 | Success |
WL_ERR_CMD | 0x1001 | Sync Word in data head error |
WL_ERR_CMD_ID | 0x1002 | ID in data head error |
WL_ERR_CMD_PARAM | 0x1003 | Parameter error |
WL_ERR_TIMEOUT | 0x1004 | Command executing timeout |
WL_ERR_BUSY | 0x1005 | Command is not acceptable due to system busy |
WL_ERR_NOT_READY | 0x1006 | System is not ready of well configured |
Event Description #
An Event is data actively sent by the module to the HOST. As described before, Event also includes data header with Sync Word 0xA4 and unique event identifier.
Ready Event(ID=0x64) #
This event indicates system is ready to accept command from HOST. It has no data body.
Example:
← A4 64 00
Connection Event(ID=0x65) #
This event indicates Gateway/Node has successfully connected or disconnected to each other.
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | connection | 1 | 0: disconnect 1: connect |
4 | device address | 2 | Remote device address |
Example:
← A4 65 03 01 00 01 ;Gateway has connected with node with device address 0x0100
Transmission Done Event(ID=0x66) #
This event indicates data has been actually transmitted over the air.
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | device address | 2 | Remove device address |
5 | result | 2 | Transmission result. 0 : success other : protocol-level errors |
Example:
← A4 66 04 00 01 00 00 ;Gateway has transmitted data to node with device address 0x0100
Data Reception Event(ID=0x67) #
This event indicates data has been received from remote connected devices.
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | device address | 2 | Remote device address |
5 | data | Len-2 | Banary byte data array |
Example:
← A4 67 05 00 01 00 01 02 ;Gateway has received 3 bytes data from node with device address 0x0100
GPIO Input Trigger Event(ID=0x68) #
This event indicates GPIO’s input status is triggered, which is configured by GPIO Input Configuration command. This event can be sent to local HOST or remote devices, depending on device address parameter in event data body.
OFFSET | NAME | LENGTH | VALUE |
---|---|---|---|
3 | device address | 2 | Remote device address, or local if 0. |
5 | GPIO | 1 | GPIO which input status is triggered. The upper 4 bits represent the Port, and the lower 4 bits represent the Pin. For example, for GPIO_0_4, it is 0x04. |
6 | level | 1 | Current GPIO level |
Example:
← A4 68 04 01 01 04 00 ;GPIO_0_4 falling edge trigger from node with device address 0x0101