Module Instruction Set

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:

OFFSETNAMELENGTHVALUE
3option10: 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:

OFFSETNAMELENGTHVALUE
3state1Current 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:

OFFSETNAMELENGTHVALUE
3number1Number of connected devices
4device addressnumber*2Device 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:

OFFSETNAMELENGTHVALUE
3TX GPIO1Specify 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.
4RX GPIO1Same as TX GPIO
5RTS GPIO1Same as TX GPIO. If 0xFF, RTS signal is not used.
6CTS GPIO1Same as TX GPIO. If 0xFF, CTS signal is not used
7baud rate4Support 921600, 460800, 230400, 115200, 57600, 38400, 19200
11data bit1Data bit length. 5 - 8
12polarity10: None
1: Odd
2: Even
13stop bit1Stop bit number
14receive buffer size4Receive buffer size, Maximum 2048
18reserved10x00

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:

OFFSETNAMELENGTHVALUE
3gateway device address2A 16-bit value that can only be taken from 0x1000 to 0xF000, where the lower 12 bits are all zeros.
5access address on connection4Access Address when data communication after connection
9access address on pairing4Access Address when pairing procedure
13channel on pairing1Channel 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:

OFFSETNAMELENGTHVALUE
3node device address2A 16-bit value that can only be taken from 0x0000 to 0x0FFF, where the upper 4 bits are all zeros.
5gateway device address2A 16-bit value that can only be taken from 0x1000 to 0xF000, where the lower 12 bits are all zeros.
7access address on pairing4Access Address when pairing procedure
11channel on pairing1Channel when pairing procedure.
12connection interval2Node's connection interval.
14supervision timeout4Time 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.
18pair interval2Time interval in millisecond for sending pairing interaction information. The smaller the interval, the faster the pairing will be successful, but power consumption will increase.
20pairing duration4Duration 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:

OFFSETNAMELENGTHVALUE
3TX GPIO1GPIO 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.
4RX GPIO1GPIO 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.
5BIAS GPIO1GPIO 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:

OFFSETNAMELENGTHVALUE
3GPIO1GPIO 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.
4internal pull up/down10: no pull up/down
1: internal pull up
2: internal pull down
5edge-triggered condition10: falling edge
1: rising edge
2: both edge
6target10: 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:

OFFSETNAMELENGTHVALUE
3option10: Stop
1: 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.

OFFSETNAMELENGTHVALUE
3device address2Destination device address
5dataLen-2Banary 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) #

OFFSETNAMELENGTHVALUE
3GPIO1GPIO 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.
4level1Output level.
0 : Low level
other : High level
5target device address20 : 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:

NAMEVALUEMEANING
WL_ERR_NO_ERROR0Success
WL_ERR_CMD0x1001Sync Word in data head error
WL_ERR_CMD_ID0x1002ID in data head error
WL_ERR_CMD_PARAM0x1003Parameter error
WL_ERR_TIMEOUT0x1004Command executing timeout
WL_ERR_BUSY0x1005Command is not acceptable due to system busy
WL_ERR_NOT_READY0x1006System 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.

OFFSETNAMELENGTHVALUE
3connection10: disconnect
1: connect
4device address2Remote 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.

OFFSETNAMELENGTHVALUE
3device address2Remove device address
5result2Transmission 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.

OFFSETNAMELENGTHVALUE
3device address2Remote device address
5dataLen-2Banary 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.

OFFSETNAMELENGTHVALUE
3device address2Remote device address, or local if 0.
5GPIO1GPIO 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.
6level1Current GPIO level

Example:

← A4 68 04 01 01 04 00           ;GPIO_0_4 falling edge trigger from node with device address 0x0101