Based on the latest version preinstalled in the GOLD series.
See here for the BLUE/RED stable version.
Download
To install the Serial Communication App (App_Uart
), install the TWELITE STAGE SDK and rewrite using the TWELITE STAGE App.
This is the multi-page printable view of this section. Click here to print...
Based on the latest version preinstalled in the GOLD series.
See here for the BLUE/RED stable version.
To install the Serial Communication App (App_Uart
), install the TWELITE STAGE SDK and rewrite using the TWELITE STAGE App.
The functions of pins used by the Serial Communication App are represented using the pin names from the Super Simple! Standard App Pins shown in the figure below.
Super Simple! Standard App Pin Assignment Table
Serial Communication | Super Simple! Standard | Function |
---|---|---|
VCC GND | VCC GND | Power Input |
TX RX | TX RX | Serial Input and Output |
TX_SUB RX_SUB | SCL SDA | Serial Sub Input and Output |
RTS | PWM1 | Serial Input Permission |
M1 | M1 | Parent/Child Selection |
M2 | M2 | Adding Relay Function to Child |
M3 | M3 | Sleep |
EX1 | AI2 | Overwriting Operation Mode |
BPS | BPS | Enabling Alternative Baud Rate Setting |
RST | RST | Reset Input |
SET | DI1 | Enter interactive mode |
Connect a 3.3V (2.0-3.6V) power supply to VCC
/GND
.
TX
/RX
are used for transmitting and receiving serial communication (UART).
TX_SUB
(SCL
) / RX_SUB
(SDA
) can be used as sub-ports for serial input and output.
When RTS
(PWM1
) is at Low level, it indicates that serial input to RX
is being accepted.
RX
when at High level, it is expected to prevent data loss.Connecting M1
to GND
sets the device as a parent, while leaving it open or connecting to VCC
sets it as a child.
You can omit this connection and configure it via the interactive mode.
i set Device ID
: 0
When M2
is connected to GND
in child mode, relay functionality can be added.
You can omit this connection and configure it via the interactive mode.
r set Role
: 1
or 0x12
Connecting M3
to GND
puts the device into sleep mode.
By connecting EX1
to GND
at startup, the operation mode can be overwritten to format mode (binary).
Connecting BPS
to GND
enables the alternative baud rate setting specified in interactive mode.
By connecting a push button between RST
and GND
, a reset button can be implemented. RST
has an internal pull-up resistor.
By connection SET
to GND
on startup, the interactive mode will be ready.
The functions of pins used by the Serial Communication App are represented using the pin names of the 7P interface printed on the board (② in the figure below).
Board Antenna Type
Coaxial Connector Type
Silkscreen | Function |
---|---|
VCC GND | Power Input |
TXD RXD | Serial Input and Output |
SET | Overwriting Operation Mode |
RST | Reset Input |
Connect a 3.3V (2.0-3.6V) power supply to VCC
/GND
.
TX
/RX
are used for transmitting and receiving serial communication (UART).
By connecting SET
to GND
at startup, the operation mode can be overwritten to format mode (ASCII).
By connecting a push button between RST
and GND
, a reset button can be implemented. RST
has an internal pull-up resistor.
Each mode is switched by Interactive Mode (some modes can be set via pin input).
ID | Mode |
---|---|
A | Format Mode (ASCII) |
B | Format Mode (Binary) |
C | Chat Mode |
D | Transparent Mode |
E | Header Transparent Mode |
Initial state is Header Transparent Mode.
Due to packet size constraints, please keep the data sent at one time within 80 bytes in binary.
The maximum length of packets in IEEE 802.15.4 adopted by TWELITE is 128 bytes, and considering overhead, the payload area available for the serial communication app is limited to 80 bytes.
If you need to send a large amount of data, please consider other products using Wi-Fi, etc. TWELITE is suitable for efficiently sending small amounts of data.
A
: Format Mode (ASCII)When data is input to the transmitting terminal according to a specific format, the receiving terminal outputs data according to the same specific format.
Data represented in hexadecimal is expressed as ASCII strings.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Simple/Extended format data | → | Simple/Extended format data |
In TWELITE UART, this mode is enabled when started with the SET
pin connected to GND
.
There are two formats to represent data.
For example, 5-byte binary data 0x48 0x45 0x4C 0x4C 0x4F
can be sent using the simple format as follows.
[Transmitting Side]
:000148454C4C4F8B <- Input
:DBA1800103 <- Output
[Receiving Side]
:780148454C4C4F13 <- Output
In format mode, settings such as application ID can be dynamically applied not only by Interactive Mode but also by commands via UART (ASCII format).
B
: Format Mode (Binary)When data is input to the transmitting terminal according to a specific format, the receiving terminal outputs data according to the same specific format.
Data represented in hexadecimal is expressed in binary format as is.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Simple/Extended format data | → | Simple/Extended format data |
In TWELITE / TWELITE DIP, this mode is enabled when started with the EX1
pin connected to GND
.
Like Format Mode (ASCII), there are two formats to represent data.
For example, 5-byte binary data 0x48 0x45 0x4C 0x4C 0x4F
can be sent using the simple format as follows.
[Transmitting Side]
0xA5 0x5A 0x00 0x07 0x00 0x01 0x48 0x45 0x4C 0x4C 0x4F 0x43 0x04 <- Input
0xA5 0x5A 0x00 0x04 0xDB 0xA1 0x80 0x01 0xFB 0x04 <- Output
[Receiving Side]
0xA5 0x5A 0x00 0x07 0x78 0x01 0x48 0x45 0x4C 0x4C 0x4F 0x3B 0x04 <- Output
In format mode, settings such as application ID can be dynamically applied not only by Interactive Mode but also by commands via UART (binary format).
C
: Chat ModeEnables text chat.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Any string | → | Auxiliary information + any string |
Displays prompt and echoes back (outputs the entered characters). All terminals act as child devices and perform broadcast communication.
For example, when a terminal sends the string Hello
to other terminals, the behavior is as follows.
[Transmitting Side]
810A4778:0> Hello <- Input
810A4778:1> <- Output
[Receiving Side]
[810A4778:0] Hello <- Output
82018CA0:0> <- Output
In the above example, the prompt shows the serial ID, but you can also use any handle name.
D
: Transparent ModeWhen arbitrary data is input to the transmitting terminal, the receiving terminal outputs the received data as is.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Any data | → | Any data |
Since no format is required, existing UART communication can be easily wirelessized.
On the other hand, data boundaries become ambiguous, and the receiving output cannot identify the sender, which are drawbacks.
By default, data input to the transmitting side is separated by CRLF, and data before CRLF is sent.
For example, when Hello<Enter>
is input on the transmitting terminal, the receiving terminal outputs Hello
as is.
[Transmitting Side]
Hello <- Input
[Receiving Side]
Hello <- Output
E
: Header Transparent ModeWhen arbitrary data is input to the transmitting terminal, the receiving terminal outputs the received content with auxiliary information added in a specific format.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Any data | → | Any data + auxiliary information |
By default, data input to the transmitting side is separated by CRLF, and data before CRLF is sent.
For example, when Hello<Enter>
is input on the transmitting terminal, the receiving terminal outputs Hello
in a format including auxiliary information. The transmitting terminal also outputs a format that conveys a transmission completion message.
[Transmitting Side]
Hello <- Input
;U;00004;219;0x820163B2;000;000;0,1,Hel...;6E; <- Output
[Receiving Side]
;U;00003;000;0x820163B2;255;000;Hello;42; <- Output
The auxiliary information output by the receiving side includes the sender’s address, received signal strength, checksum, etc. The format of auxiliary information can be customized.
When data formatted in a specific manner is input on the transmitting side, the receiving side outputs data formatted in the same manner.
Data is represented as hexadecimal ASCII strings.
Transmitting Side Input | Receiving Side Output | |
---|---|---|
Simple/Extended format data | → | Simple/Extended format data |
SET
pin connected to GND
.EX1
pin connected to GND
.There are two types of formats that can be handled.
For example, 5-byte binary data 0x48 0x45 0x4C 0x4C 0x4F
can be sent using the simple format as follows.
[Sending side]
:000148454C4C4F8B <- Input
:DBA1800103 <- Output
[Receiving side]
:780148454C4C4F13 <- Output
When sending data sequences expressed in basic or extended formats, they are converted to ASCII strings (0-9, A-F).
The format is extremely simple! It starts with :
and ends with CRLF, just like the output of the standard app (App_Twelite) or the parent device output of the parent/repeater app (App_Wings).
Header | Payload | Checksum | Footer |
---|---|---|---|
: | Repeated 00 -FF | LRC8 of payload | CRLF |
:
(0x3A
)\r\n
/0x0D 0x0A
)For example, binary data 0x00 0x11 0x22 0x33 0xAA 0xBB 0xCC
is expressed as follows.
:00112233AABBCC69<CR><LF>
Format mode distinguishes between parent and child devices.
The Application ID and frequency channel must be matched between parent and child devices.
Format mode allows identifying the source from the received data.
The simple format uses the Logical Device ID, and the extended format uses the Logical Device ID plus the extended address.
0x8
added at the front.When using the simple format of format mode, follow the format below.
# | Data | Description | Notes |
---|---|---|---|
char | Header | Only : | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , child 0x01 -0x64 , all children 0x78 |
1 | uint8 | Command number | Any value less than 0x80 |
2 | [uint8] | Arbitrary data | Byte sequence of length (N) (recommended (N \leqq 80)) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0x01
command of the Extremely Simple! Standard App.# | Data | Description | Notes |
---|---|---|---|
char | Header | Only : | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , child 0x01 -0x64 , unset child 0x78 |
1 | uint8 | Command number | Value less than 0x80 specified by the sender |
2 | [uint8] | Arbitrary data | Byte sequence of length (N) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0x01
command of the Extremely Simple! Standard App.# | Data | Description | Notes |
---|---|---|---|
char | Header | Only : | |
0 | uint8 | Source Logical Device ID | Only 0xDB : indicates itself |
1 | uint8 | Command number | Only 0xA1 |
2 | uint8 | Response ID | Continuation number in the range 128 -255 (0x80 -0xFF ) |
3 | uint8 | Result | Success 1 , failure 0 |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
An example of sending byte sequence 0x11 0x22 0x33 0xAA 0xBB 0xCC
from the parent to all children is shown.
[Sending side: Parent]
:7801112233AABBCCF0<CR><LF> <- Input
:DBA1800103<CR><LF> <- Output
The trailing
0xF0
is the checksum: the two’s complement of the sum from0x78
to0xCC
(LSB 8 bits).
[Receiving side: All children]
:0001112233AABBCC68<CR><LF> <- Output
The trailing
0x68
is the checksum: the two’s complement of the sum from0x00
to0xCC
(LSB 8 bits).
When using the extended format of format mode, follow the format below.
# | Data | Description | Notes |
---|---|---|---|
char | Header | Only : | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , child 0x01 -0x64 , all children 0x78 |
1 | uint8 | Command number | Only 0xA0 |
2 | uint8 | Response ID | Any value |
3 | [uint8] | Options | Option list of length (N) (Details of option list) |
3+(N) | [uint8] | Arbitrary data | Byte sequence of length (M) (recommended (M \leqq 80)) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
# | Data | Description | Notes |
---|---|---|---|
char | Header | Only : | |
0 | uint8 | Extended Address Specifier | Only 0x80 |
1 | uint8 | Command number | Only 0xA0 |
2 | uint8 | Response ID | Any value |
3 | uint32 | Destination Extended Address | Serial ID with 0x8 added at the front |
7 | [uint8] | Options | Option list of length (N) (Details of option list) |
7+(N) | [uint8] | Arbitrary data | Byte sequence of length (M) (recommended (M \leqq 80)) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
In the extended format, you can specify fine settings by specifying the option list.
The option list is represented by repeating option IDs and their arguments. The end is 0xFF
.
0xFF
.ID | Argument | Default | Description |
---|---|---|---|
0x01 | None | Disabled | Enable MAC ACK |
0x02 | uint8 | 0x00 | Enable application retry |
0x03 | uint16 | 0x0000 | Minimum initial transmission delay |
0x04 | uint16 | 0x0000 | Maximum initial transmission delay |
0x05 | uint16 | 10 | Application retry interval |
0x06 | None | Disabled | Allow parallel requests |
0x07 | None | Disabled | Disable response messages |
0x08 | None | Disabled | Sleep after transmission |
0x01
: Enable MAC ACKEnables MAC layer ACK (acknowledgment).
Not suitable for frequent data transmission, but can improve reliability.
0x78
).0x02
: Enable Application RetryWhen using MAC ACK, specify 0x00
-0x0F
. Retries 0-16 times respectively until the transmission succeeds.
When not using MAC ACK, specify 0x81
-0x8F
. Always retries 1-16 times.
Response messages are output after all retries are completed.
0x03
: Minimum Initial Transmission DelaySpecifies the minimum delay before the first transmission in milliseconds.
0x04
: Maximum Initial Transmission DelaySpecifies the maximum delay before the first transmission in milliseconds.
0x05
: Application Retry IntervalSpecifies the retry interval in milliseconds when application retry is enabled.
0x06
: Allow Parallel RequestsAllows parallel requests.
When allowed, the next request can be accepted without blocking until the current request completes.
For example, if three requests with a 0.5-second delay are input consecutively, normally they are processed sequentially at 0.5s, 1.0s, and 1.5s. When parallel requests are allowed, they are processed in no particular order after 0.5s. Note that it cannot be used when packet fragmentation is required.
0x07
: Disable Response MessagesDisables the response messages output when data is input on the transmitting side.
0x08
: Sleep After TransmissionImmediately puts the device to sleep after transmission.
When RX
detects a rising edge, it wakes up from sleep. Please input any 1 byte of data.
After waking up, UART initialization completes and input is accepted.
# | Data | Description | Notes |
---|---|---|---|
char | Header | Only : | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , child 0x01 -0x64 , unset child 0x78 |
1 | uint8 | Command number | Only 0xA0 |
2 | uint8 | Response ID | Value specified by the sender |
3 | uint32 | Source Extended Address | Serial ID with 0x8 added at the front |
7 | uint32 | Destination Extended Address | 0xFFFFFFFF if using Logical Device ID |
11 | uint8 | LQI | Radio communication quality at reception |
12 | uint16 | Length of following byte sequence | Number of bytes (M) |
14 | [uint8] | Arbitrary data | Byte sequence of length (M) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
# | Data | Description | Notes |
---|---|---|---|
char | Header | Only : | |
0 | uint8 | Source Logical Device ID | Only 0xDB : indicates itself |
1 | uint8 | Command number | Only 0xA1 |
2 | uint8 | Response ID | Value specified at input |
3 | uint8 | Result | Success 1 , failure 0 |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
An example of sending byte sequence 0x11 0x22 0x33 0xAA 0xBB 0xCC
from the parent to a child is shown.
An example sending from the parent to the child with Logical Device ID 0x42
.
0x01
0x81000000
(Serial ID 0x1000000
)[Sending side: Parent]
:42A001FF112233AABBCC87<CR><LF> <- Input
:DBA1010182<CR><LF> <- Output
The trailing
0x87
is the checksum: the two’s complement of the sum from0x42
to0xCC
(LSB 8 bits).
[Receiving side: Child]
:00A00181000000FFFFFFFFC80006112233AABBCC7D<CR><LF> <- Output
The trailing
0x7D
is the checksum: the two’s complement of the sum from0x00
to0xCC
(LSB 8 bits).
An example sending from the parent to the child with extended address 0x81000001
(Serial ID 0x1000001
).
0x01
0x81000000
(Serial ID 0x1000000
)[Sending side: Parent]
:80A00181000001FF112233AABBCCC7<CR><LF> <- Input
:DBA1010182<CR><LF> <- Output
The trailing
0xC7
is the checksum: the two’s complement of the sum from0x80
to0xCC
(LSB 8 bits).
[Receiving side: Child]
:00A0018100000081000001C80006112233AABBCCF7<CR><LF> <- Output
The trailing
0xF7
is the checksum: the two’s complement of the sum from0x00
to0xCC
(LSB 8 bits).
An example sending from the parent to the child with Logical Device ID 0x42
using MAC ACK.
0x01
0x01
: Enable MAC ACK specified0x81000000
(Serial ID 0x1000000
)[Sending side: Parent]
:42A00101FF112233AABBCC86<CR><LF> <- Input
:DBA1010182<CR><LF> <- Output
The trailing
0x86
is the checksum: the two’s complement of the sum from0x42
to0xCC
(LSB 8 bits).
[Receiving side: Child]
:00A00181000000FFFFFFFFC80006112233AABBCC7D<CR><LF> <- Output
The trailing
0x7D
is the checksum: the two’s complement of the sum from0x00
to0xCC
(LSB 8 bits).
An example sending from the parent to the child with Logical Device ID 0x42
with a 768ms delay.
0x01
0x03
: Minimum initial transmission delay specified0x81000000
(Serial ID 0x1000000
)[Sending side: Parent]
:42A001030300FF112233AABBCC81<CR><LF> <- Input
:DBA1010182<CR><LF> <- Output
The trailing
0x81
is the checksum: the two’s complement of the sum from0x42
to0xCC
(LSB 8 bits).
[Receiving side: Child]
:00A00181000000FFFFFFFFC80006112233AABBCC7D<CR><LF> <- Output
The trailing
0x7D
is the checksum: the two’s complement of the sum from0x00
to0xCC
(LSB 8 bits).
0xDB
CommandInstead of setting interactive mode, you can operate and configure the module by inputting the 0xDB
command from UART.
0xDB
command instead of Interactive Mode.# | Data | Content | Remarks |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination logical device ID | Only 0xDB itself |
1 | uint8 | Command number | Selected from values below |
2 | [uint8] | Parameter | Optional length N bytes representing setting values |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
Function | |
---|---|
0xF0 | Enable ACK |
0xF1 | Get Device Info |
0xF2 | Apply Device Settings |
0xF3 | Get Device Settings |
0xFD | Erase Device Settings |
0xFE | Save Device Settings |
0xFF | Reset Device |
0xF0
: Enable ACKRequests an ACK response.
No parameters.
# | Data | Content | Remarks |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination logical device ID | Only 0xDB |
1 | uint8 | Command number | Only 0xF0 |
2 | uint8 | Data | Only 0x01 |
uint8 | Checksum | 0x34 : LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0xF1
: Get Device InfoDisplays address and other information. Also output at startup.
No parameters.
# | Data | Content | Remarks |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination logical device ID | Only 0xDB |
1 | uint8 | Command number | Only 0xF1 |
2 | uint32 | Default Application ID | 67720103 |
6 | uint32 | Version number | For 1.4.7 , 00010407 |
10 | uint8 | Logical device ID | |
11 | uint32 | Serial ID | |
15 | uint8 | Silent mode status | Enabled 1 , Disabled 0 |
16 | uint8 | Network status | UP 1 , DOWN 0 |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0xF2
: Apply Device SettingsApplies the settings.
# | Data | Content | Remarks |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination logical device ID | Only 0xDB |
1 | uint8 | Command number | Only 0xF3 |
2 | [uint8] | Settings content | Identifier |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
# | Data | Content | Remarks |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination logical device ID | Only 0xDB |
1 | uint8 | Command number | Only 0xF3 |
2 | uint8 | Error | Only 0xFF |
uint8 | Checksum | 0x33 : LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0xF3
: Get Device SettingsGets the settings.
# | Data | Content | Remarks |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination logical device ID | Only 0xDB |
1 | uint8 | Command number | Only 0xF3 |
2 | [uint8] | Settings content | Identifier and data |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0xFD
: Erase Device SettingsResets device settings and resets the device.
No parameters or response.
0xFE
: Save Device SettingsSaves applied settings and resets the device.
No parameters or response.
0xFF
: Reset DeviceDiscards applied settings and resets the device.
No parameters or response.
0xF2
/ 0xF3
)Parameters for 0xF2
: Apply Device Settings and 0xF3
: Get Device Settings are represented by repeated pairs of identifiers and data (big endian).
Identifier | Data | Content |
---|---|---|
0x00 | uint32 | Application ID |
0x01 | uint32 | Frequency Channel Mask |
0x02 | uint16 | Retry Count and Output |
0x03 | uint8 | Logical Device ID |
0x04 | uint8 | Role |
0x05 | uint8 | Relay Layer |
0x06 | uint8 | Communication Mode |
0x07 | uint32 | Baud Rate |
0x08 | uint8 | Parity |
0x09 | uint8 | Encryption Function |
0x0A | [uint8] | Encryption Key |
0x0B | [uint8] | Header / Handle name |
0x0C | uint16 | Delimiter Character |
0xFF | uint8 | Error |
0x00
: Application IDSpecifies the application ID.
0x01
: Frequency Channel MaskSpecifies the bit mask of frequency channels.
Set bits for channels to be used. For example, to use channel 11, specify 1<<11
.
0x02
: Retry Count and OutputSpecifies the radio transmission output and the number of additional packet transmissions in transparent mode and header-attached transparent mode.
Only the lower 1 byte is used. The upper 4 bits represent the retry count (0
-9
), and the lower 4 bits represent the transmission output (0
-3
). For example, 8 retries / output 3 is 0x0083
.
0x03
: Logical Device IDSpecifies the logical device ID.
0x04
: RoleEffective only for slave devices. Specify one of the following values. Normally, select a delivery method that does not use the network layer.
0
: Normal designation (parent or child device)1
-3
: Relay slave devices (logical device IDs are 1
-100
or 120
). Numbers 1
-3
indicate the maximum relay hop count. This method retransmits up to the maximum relay hops, which may cause duplicate packets depending on relay device placement and count.11
: Parent device12
: Relay device13
: Child device80
to the above values. For example, 93
means “network layer enabled and silent mode”.0x05
: Relay LayerThe relay layer number. Relay devices attempt to connect to relay devices or parent devices in upper (smaller value) relay layers. Effective only when Role is set to 12
.
0x06
: Communication Mode0
: Transparent mode1
: Format mode (ASCII)2
: Format mode (Binary)3
: Chat mode4
: Header-attached transparent mode0x07
: Baud RateSpecifies the UART baud rate.
0x08
: ParitySpecifies the sum of settings in the following combination:
0
: 8Bit8
: 7Bit0
: None1
: Odd2
: Even0
: STOP 14
: STOP 2For example, 7-E-1 is specified as 8+2+0=10(0xA)
.
0x09
: Encryption FunctionSpecifies whether encryption is enabled.
0
: Disabled1
: AES128bit encryption enabled0x0A
: Encryption KeySpecifies a 16-byte encryption key.
Can store binary sequences that cannot be set in Interactive Mode. This may cause display issues in Interactive Mode.
0x0B
: Header / Handle nameSpecifies a header format on the mode E
or handle name on the mode C
.
0x0C
: Delimiter CharacterSpecifies the delimiter character (0x00
-0xFF
).
When data formatted in a specific manner is input on the transmitting side, the receiving side outputs data formatted in the same manner.
Data represented in hexadecimal is output as raw binary.
Transmitting Side Input | Receiving Side Output | |
---|---|---|
Simple/Extended Format Data | → | Simple/Extended Format Data |
SET
pin to GND
at startup.EX1
pin to GND
at startup.There are two types of supported formats.
For example, 5 bytes of binary data 0x48 0x45 0x4C 0x4C 0x4F
can be transmitted using the simple format as follows.
Hereafter, the 0x
in binary data representation is omitted.
For example, 0x48 0x45 0x4C 0x4C 0x4F
is represented as 48 45 4C 4C 4F
.
[Transmitting Side]
A5 5A 80 07 00 01 48 45 4C 4C 4F 43 04 <- Input
A5 5A 80 04 DB A1 80 01 FB 04 <- Output
[Receiving Side]
A5 5A 80 07 78 01 48 45 4C 4C 4F 3B 04 <- Output
When sending data expressed in basic or extended format, handle it as raw binary data.
Header | Length | Payload | Checksum | Footer |
---|---|---|---|---|
A5 5A | Payload Length | Repeated 00 -FF | XOR of Payload | EOT |
A5 5A
0x8000
0x04
(can be omitted on input)For example, binary data 00 11 22 33 AA BB CC
is expressed as follows.
A5 5A 80 07 00 11 22 33 AA BB CC DD 04
Although debugging is troublesome, it offers high efficiency for communication between microcontrollers.
Format mode distinguishes between parent and child devices.
Parent and child devices must match Application ID and Frequency Channel.
Format mode allows identification of the source from received data.
Simple format uses Logical Device ID, and extended format uses Logical Device ID plus extended address.
0x8
added at the front.When using the simple format of format mode, follow the format below.
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+2 | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , All Children 0x78 |
1 | uint8 | Command Number | Any value less than 0x80 |
2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) (recommended \(N\leqq80\)) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+2 | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , Unset Child 0x78 |
1 | uint8 | Command Number | Value less than 0x80 specified by sender |
2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | 4 | |
0 | uint8 | Source Logical Device ID | Only 0xDB : indicates itself |
1 | uint8 | Command Number | Only 0xA1 |
2 | uint8 | Response ID | Continuation number in the range 128 -255 (0x80 -0xFF ) |
3 | uint8 | Result | Success 1 , Failure 0 |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
Example of sending byte sequence 11 22 33 AA BB CC
from parent to all children.
[Transmitting Side: Parent]
A5 5A 80 08 78 01 11 22 33 AA BB CC A4 04 <- Input
A5 5A 80 04 DB A1 80 01 FB 04 <- Output
The last byte
0xA4
is the checksum: XOR from0x78
to0xCC
.
[Receiving Side: All Children]
A5 5A 80 08 00 01 11 22 33 AA BB CC DC 04 <- Output
The last byte
0xDC
is the checksum: XOR from0x00
to0xCC
.
When using the extended format of format mode, follow the format below.
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+\(M\)+3 | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , All Children 0x78 |
1 | uint8 | Command Number | Only 0xA0 |
2 | uint8 | Response ID | Any value |
3 | [uint8] | Options | Option list of length \(N\) (Details below) |
3+\(N\) | [uint8] | Arbitrary Data | Byte sequence of length \(M\) (recommended \(M\leqq80\)) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+\(M\)+7 | |
0 | uint8 | Extended Address Specifier | Only 0x80 |
1 | uint8 | Command Number | Only 0xA0 |
2 | uint8 | Response ID | Any value |
3 | uint32 | Destination Extended Address | Serial ID with 0x8 added at the front |
7 | [uint8] | Options | Option list of length \(N\) (Details below) |
7+\(N\) | [uint8] | Arbitrary Data | Byte sequence of length \(M\) (recommended \(M\leqq80\)) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
In extended format, detailed settings can be specified by providing an option list.
The option list consists of repeated option IDs and arguments. It ends with 0xFF
.
0xFF
.ID | Argument | Default | Description |
---|---|---|---|
0x01 | None | Disabled | Enable MAC ACK |
0x02 | uint8 | 0x00 | Enable Application Retransmission |
0x03 | uint16 | 0x0000 | Minimum Initial Transmission Delay |
0x04 | uint16 | 0x0000 | Maximum Initial Transmission Delay |
0x05 | uint16 | 10 | Application Retransmission Interval |
0x06 | None | Disabled | Allow Parallel Requests |
0x07 | None | Disabled | Disable Response Messages |
0x08 | None | Disabled | Sleep After Transmission |
0x01
: Enable MAC ACKEnables MAC layer ACK (acknowledgment).
Not suitable for frequent data transmissions but can improve reliability.
0x78
).0x02
: Enable Application RetransmissionWhen using MAC ACK, specify 0x00
-0x0F
. Retransmits 0-16 times until successful.
When not using MAC ACK, specify 0x81
-0x8F
. Always retransmits 1-16 times.
Response messages are output after all retransmissions are complete.
0x03
: Minimum Initial Transmission DelaySpecifies the minimum delay before the first transmission in milliseconds.
0x04
: Maximum Initial Transmission DelaySpecifies the maximum delay before the first transmission in milliseconds.
0x05
: Application Retransmission IntervalSpecifies the interval between application retransmissions in milliseconds.
0x06
: Allow Parallel RequestsAllows parallel requests.
When allowed, the next request can be accepted without blocking until the previous request completes.
For example, if three requests each with 0.5 seconds delay are input consecutively, normally they are processed sequentially at 0.5s, 1.0s, and 1.5s. With parallel requests allowed, they are processed in any order after 0.5s. Note that this cannot be used when packet segmentation is required.
0x07
: Disable Response MessagesDisables response messages output when data is input on the transmitting side.
0x08
: Sleep After TransmissionImmediately puts the device to sleep after transmission.
RX
detects rising edge to wake from sleep. Input any 1 byte of data.
After waking, UART initialization completes and input is accepted.
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(M\)+14 | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , Unset Child 0x78 |
1 | uint8 | Command Number | Only 0xA0 |
2 | uint8 | Response ID | Value specified by sender |
3 | uint32 | Source Extended Address | Serial ID with 0x8 added at the front |
7 | uint32 | Destination Extended Address | 0xFFFFFFFF when using Logical Device ID |
11 | uint8 | LQI | Radio signal quality at reception |
12 | uint16 | Length of Following Bytes | Byte count \(M\) |
14 | [uint8] | Arbitrary Data | Byte sequence of length \(M\) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Description | Notes |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | 4 | |
0 | uint8 | Source Logical Device ID | Only 0xDB : indicates itself |
1 | uint8 | Command Number | Only 0xA1 |
2 | uint8 | Response ID | Value specified on input |
3 | uint8 | Result | Success 1 , Failure 0 |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
Example of sending byte sequence 11 22 33 AA BB CC
from parent to child.
Example of sending from parent to child with Logical Device ID 0x01
.
0x01
[Transmitting Side: Parent]
A5 5A 80 0A 01 A0 01 FF 11 22 33 AA BB CC 82 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0xC1
is checksum: XOR from0x42
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 FF FF FF FF FF 00 06 11 22 33 AA BB CC 2D 04 <- Output
The last byte
0x2D
is checksum: XOR from0x00
to0xCC
.
Example of sending from parent to child with Extended Address 0x820163B2
(Serial ID 0x20163B2
).
0x01
[Transmitting Side: Parent]
A5 5A 80 0E 80 A0 01 82 01 63 B2 FF 11 22 33 AA BB CC 51 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0x51
is checksum: XOR from0x80
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 82 01 63 B2 FF 00 06 11 22 33 AA BB CC 7F 04 <- Output
The last byte
0x7F
is checksum: XOR from0x00
to0xCC
.
Example of sending from parent to child with Logical Device ID 0x01
using MAC ACK.
0x01
0x01
: Enable MAC ACK specified[Transmitting Side: Parent]
A5 5A 80 0B 01 A0 01 01 FF 11 22 33 AA BB CC 83 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0x83
is checksum: XOR from0x01
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 00 00 01 01 FF 00 06 11 22 33 AA BB CC 2D 04 <- Output
The last byte
0x2D
is checksum: XOR from0x00
to0xCC
.
Example of sending from parent to child with Logical Device ID 0x01
with 768ms delay.
0x01
0x03
: Minimum Initial Transmission Delay specified[Transmitting Side: Parent]
A5 5A 80 0D 01 A0 01 03 03 00 FF 11 22 33 AA BB CC 82 04 <- Input
A5 5A 80 04 DB A1 01 01 7A 04 <- Output
The last byte
0x82
is checksum: XOR from0x01
to0xCC
.
[Receiving Side: Child]
A5 5A 80 14 00 A0 01 82 03 68 41 FF FF FF FF FF 00 06 11 22 33 AA BB CC 2D 04 <- Output
The last byte
0x2D
is checksum: XOR from0x00
to0xCC
.
0xDB
CommandInstead of setting interactive mode, you can operate and configure the module by inputting the 0xDB
command from UART.
0xDB
command instead of Interactive Mode.# | Data | Content | Remarks |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+2 | |
0 | uint8 | Destination Logical Device ID | Only 0xDB indicating itself |
1 | uint8 | Command Number | Selected from values below |
2 | [uint8] | Parameter | Byte sequence of length \(N\) indicating setting value (optional) |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
Function | |
---|---|
0xF0 | Enable ACK |
0xF1 | Get Device Info |
0xF2 | Apply Device Settings |
0xF3 | Get Device Settings |
0xFD | Erase Device Settings |
0xFE | Save Device Settings |
0xFF | Reset Device |
0xF0
: Enable ACKRequests ACK response.
No parameters.
# | Data | Content | Remarks |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | 3 | |
0 | uint8 | Destination Logical Device ID | Only 0xDB |
1 | uint8 | Command Number | Only 0xF0 |
2 | uint8 | Data | Only 0x01 |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
0xF1
: Get Device InfoDisplays information such as address. Also output at startup.
No parameters.
# | Data | Content | Remarks |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | 17 | |
0 | uint8 | Destination Logical Device ID | Only 0xDB |
1 | uint8 | Command Number | Only 0xF1 |
2 | uint32 | Default Application ID | 67720103 |
6 | uint32 | Version Number | For 1.4.7 , 00010407 |
10 | uint8 | Logical Device ID | |
11 | uint32 | Serial ID | |
15 | uint8 | Silent Mode Status | Enabled 1 , Disabled 0 |
16 | uint8 | Network Status | UP 1 , DOWN 0 |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
0xF2
: Apply Device SettingsApplies settings.
# | Data | Content | Remarks |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+2 | |
0 | uint8 | Destination Logical Device ID | Only 0xDB |
1 | uint8 | Command Number | Only 0xF3 |
2 | [uint8] | Setting Content | Identifier |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
# | Data | Content | Remarks |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | 3 | |
0 | uint8 | Destination Logical Device ID | Only 0xDB |
1 | uint8 | Command Number | Only 0xF3 |
2 | uint8 | Error | Only 0xFF |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
0xF3
: Get Device SettingsRetrieves settings.
# | Data | Content | Remarks |
---|---|---|---|
uint8 | Header | Only 0xA5 | |
uint8 | Header | Only 0x5A | |
uint16 | Data Length | \(N\)+2 | |
0 | uint8 | Destination Logical Device ID | Only 0xDB |
1 | uint8 | Command Number | Only 0xF3 |
2 | [uint8] | Setting Content | Identifier and data |
uint8 | Checksum | XOR | |
uint8 | Footer | EOT (0x04 ) |
0xFD
: Erase Device SettingsInitializes settings and resets the device.
No parameters or response.
0xFE
: Save Device SettingsSaves applied settings and resets the device.
No parameters or response.
0xFF
: Reset DeviceDiscards applied settings and resets the device.
No parameters or response.
0xF2
/0xF3
)Parameters for 0xF2
: Apply Device Settings and 0xF3
: Get Device Settings are represented as repeated identifier and data (big endian) pairs.
Identifier | Data | Content |
---|---|---|
0x00 | uint32 | Application ID |
0x01 | uint32 | Frequency Channel Mask |
0x02 | uint16 | Retry Count and Output |
0x03 | uint8 | Logical Device ID |
0x04 | uint8 | Role |
0x05 | uint8 | Relay Layer |
0x06 | uint8 | Communication Mode |
0x07 | uint32 | Baud Rate |
0x08 | uint8 | Parity |
0x09 | uint8 | Encryption Function |
0x0A | [uint8] | Encryption Key |
0x0B | [uint8] | Header / Handle name |
0x0C | uint16 | Delimiter Character |
0xFF | uint8 | Error |
0x00
: Application IDSpecifies the application ID.
0x01
: Frequency Channel MaskSpecifies the bit mask of frequency channels.
Set bits for channels to use. For example, to use channel 11, set 1<<11
.
0x02
: Retry Count and OutputSpecifies the radio transmission output and the number of additional packets to send in transparent mode and header-attached transparent mode.
Only the lower 1 byte is used. The upper 4 bits indicate retry count (0
-9
), and the lower 4 bits indicate transmission output (0
-3
). For example, 8 retries/output 3 is 0x0083
.
0x03
: Logical Device IDSpecifies the logical device ID.
0x04
: RoleValid only for child devices. Specify the following values. Usually, select a delivery method without using the network layer.
0
: Normal designation (parent or child)1
-3
: Relay child devices (logical device IDs 1
-100
or 120
). Numbers 1
-3
indicate maximum relay hops. This method repeats retries up to the maximum relay hops, which may cause duplicate packets depending on relay device placement and number.11
: Parent device12
: Relay device13
: Child device80
to the above values. For example, 93
means “using network layer and silent mode”.0x05
: Relay LayerThe relay layer number. Relay devices attempt to connect to relay devices or parent devices with higher layers (lower values). Effective only when Role is set to 12
.
0x06
: Communication Mode0
: Transparent mode1
: Format mode (binary)2
: Format mode (binary)3
: Chat mode4
: Header-attached transparent mode0x07
: Baud RateSpecifies UART baud rate.
0x08
: ParitySpecifies the sum of settings in the following combination.
0
: 8Bit8
: 7Bit0
: None1
: Odd2
: Even0
: STOP 14
: STOP 2For example, 7-E-1 is 8+2+0=10(0xA)
.
0x09
: Encryption FunctionSpecifies whether encryption is enabled.
0
: Disabled1
: AES128bit encryption enabled0x0A
: Encryption KeySpecifies a 16-byte encryption key.
Allows storing binary sequences that cannot be set in Interactive Mode. In this case, the display in Interactive Mode may be disrupted.
0x0B
: Header / Handle nameSpecifies a header format on the mode E
or handle name on the mode C
.
0x0C
: Delimiter CharacterSpecifies the delimiter character string (0x00
-0xFF
).
By connecting MONOSTICK to a PC etc., chat can be performed among multiple terminals.
Enables text chat.
Sending Side Input | Receiving Side Output | |
---|---|---|
Any string | → | Any string + auxiliary information |
Displays prompt and echoes back (outputs input characters). All terminals operate as child devices, performing broadcast communication.
For example, when sending the string Hello
from one terminal to another, it behaves as follows.
[Sending Side]
810A4778:0> Hello <- Input
810A4778:1> <- Output
[Receiving Side]
[810A4778:0] Hello <- Output
82018CA0:0> <- Output
Chat mode displays prompt and echoes back (outputs input characters entered by itself).
All terminals are treated as child devices and broadcast their transmitted content. Communication is possible with all terminals but destination cannot be specified. Binary data cannot be sent. Only strings are supported (0x00-0x1F, 0x7F cannot be sent).
Relay supports up to 3 hops. Relay is disabled by default.
Chat mode does not distinguish between parent and child devices.
If the Application ID and frequency channel are the same, data entered in any terminal is sent to other terminals.
Network configuration image
The auxiliary information in the received output can identify the sender.
If the Interactive Mode’s h: Header format
is blank, the 7-digit serial ID with a leading 0x8 is used as the extended address. For example, the following output indicates the sender’s serial ID was 0x10A4778
.
[810A4778:0] Hello
If h: Header format
is set to an arbitrary string, it is used as the handle name. Handle name consumes data space in the wireless packet.
Enter message and newline after prompt.
Data | Content | Remarks |
---|---|---|
[char] | Message | 0x00 -0x1F , 0x7F not allowed |
char | CR (0x0D /'\r' ) | Allowed alone |
char | LF (0x0A /'\n' ) | Allowed alone |
810A4778:0> Hello
Outputs received message following auxiliary info.
Auxiliary information includes the module’s extended address or handle name and a sequence number.
Data | Content | Remarks |
---|---|---|
char | Auxiliary info header | [ only |
[char] | Identification info | 8-digit extended address or handle name |
char | Auxiliary info delimiter | : only |
[char] | Sequence number | Starting from 0 |
char | Auxiliary info footer | ] only |
char | Separator | Space only |
[char] | Message | |
char | Footer | CR (0x0D /'\r' ) |
char | Footer | LF (0x0A /'\n' ) |
(err)
or (canceled)
are output.
[810A4778:0] Hello
Terminals supporting escape sequences can use the following control commands.
Ctrl-L
: Clear screenCtrl-C
: Cancel inputBS
/DEL
: Move cursor backExternal microcontrollers can be easily connected, but to optimize communication using formats, format modes (ASCII / Binary) are suitable.
Purely wirelesss UART.
Sending side input | Receiving side output | |
---|---|---|
Any data | → | Any data |
Since no format is required, existing UART communication can be easily wirelessized.
However, data delimiters are ambiguous and it is impossible to identify the sender from the receiver output.
The initial state specifies CRLF as the transmission trigger character. Therefore, data input to the transmitter is separated by CRLF, and the data before CRLF is transmitted.
For example, entering Hello<Enter>
on the transmitting terminal results in Hello
being output on the receiving terminal.
[Sending side]
Hello <- Input
[Receiving side]
Hello <- Output
Continuous input strings are split and sent in chunks of 80 bytes. Data up to the trigger character should normally be 80 bytes or less.
All terminals are considered child devices, and the transmitted content is broadcast. Communication with all terminals is possible, but the destination cannot be specified. Both ASCII characters and binary data can be sent.
Relay supports up to 3 hops. By default, relay is disabled.
Transparent mode does not distinguish between parent and child devices.
If application ID and frequency channel are the same, data entered into any terminal is sent to other terminals.
Network configuration image
Transparent mode cannot identify the sender.
To identify sender, sender information must be included in data input to the transmitter.
Transmission trigger must be considered, as data is divided and transmitted wirelessly packet by packet.
Therefore, the following transmission triggers must be taken into account:
Transmission trigger settings can be specified from the interactive mode k
: Transmission Trigger item.
When setting the transmission trigger character to LF, minimum data size to 8 bytes, and timeout to 30 ms, set as follows:
m: set UART mode (D)
k: set Tx Trigger (sep=0x0a, min_bytes=8 dly=30[ms])
o: set option bits (0x00000100)
Enabled by default.
When arbitrary data is input to the transmitting terminal, the receiving terminal outputs data with auxiliary information in a specific format.
Transmitting side input | Receiving side output | |
---|---|---|
Any data | → | Any data + auxiliary info |
By default, data input on the transmitting side is separated by CRLF and data before CRLF is sent.
For example, entering Hello<Enter>
on the transmitting side results in output Hello
with auxiliary info on the receiving side. The transmitting side also outputs a message indicating transmission completion.
[Transmitting side]
Hello <- input
;U;00004;219;0x820163B2;000;000;0,1,Hel...;6E; <- output
[Receiving side]
;U;00003;000;0x820163B2;255;000;Hello;42; <- output
The auxiliary information output by the receiving side includes the source address, received signal strength, checksum, etc. The format of the auxiliary information can be customized.
Header Transparent Mode does not distinguish between parent and child devices.
If the Application ID and frequency channel are the same, data input to any terminal is sent to other terminals.
Network configuration image
The header on the received data includes the logical device ID and serial ID of the sender.
The output format is represented as semicolon (;
) separated fields.
[Example output in default state]
;U;00777;120;0x81025A17;120;013;HELLO;79;
This output can be interpreted as follows.
Data | Description | Value | |
---|---|---|---|
U | char | Fixed value | U |
00777 | uint16 | Timestamp at output | 777 seconds |
120 | uint8 | Source logical device ID | 120 ID-less child device |
0x81025A17 | uint32 | Source extended address | 81025A17 |
120 | uint8 | LQI (link quality indicator) | 120/255 |
013 | uint8 | Source sequence number | 13 |
HELLO | [uint8] | Input data | HELLO |
79 | uint8 | XOR checksum | 0x79 |
The source logical device ID is 219
for its own response message.
The extended address is the 7-bit serial ID printed on the TWELITE device with a leading 0x8
added.
The output format on the receiving side follows the header format.
Changing the header format customizes the content of the auxiliary information output and the checksum calculation range.
;U;%t;%i;0x%A;%q;%s;<*;%X;\n
.The header format can be changed via the interactive mode command h: set header format
.
The simplest header format is *\n
. It outputs the received data with CRLF line endings.
h: set header format [*\n]
When sending HELLO
in this case, it behaves as follows.
[Receiving side]
HELLO<CR><LF> or HELLO<LF>
[Transmitting side]
HELLO<CR><LF>
You can customize the output by including the following special characters in the header format.
Description | |
---|---|
* | Received data |
&hl | Arbitrary ASCII character (e.g., &20 is space) |
< | Start position for checksum calculation (default is start of string) |
> | End position for checksum calculation (only from v1.4.6) |
\
(backslash)Description | |
---|---|
\n | CRLF (0x0D 0x0A ) |
\t | TAB |
\* | * |
\% | % |
\< | < |
\> | > |
\& | & |
%
Description | Length | Data format | |
---|---|---|---|
%A | Source address (32bit) | 8 chars | Hexadecimal |
%a | Source address (32bit) | 10 chars | Hexadecimal |
%I | Source logical address (8bit) | 2 chars | Hexadecimal |
%i | Source logical address (8bit) | 3 chars | Decimal |
%T | Current system time (seconds) | 4 chars | Hexadecimal |
%t | Current system time (seconds) | 5 chars | Decimal |
%S | Source sequence number (hex) | 2 chars | Hexadecimal |
%s | Source sequence number (hex) | 3 chars | Hexadecimal |
%Q | Received signal strength | 2 chars | Hexadecimal |
%q | Received signal strength | 3 chars | Decimal |
%X | Checksum | 2 chars | Hexadecimal |
%x | Checksum | 3 chars | Decimal |
The checksum is calculated by XOR (exclusive OR) from the start of the data or from the position indicated by <
in the header format up to just before %X
or %x
.
The default header format is ;U;%t;%i;0x%A;%q;%s;<*;%X;\n
, where the checksum calculation range is *;
.
That is, when sending HELLO
, the binary data HELLO;
is targeted, resulting in checksum 0x79
.
[Verification code in Python]
from functools import reduce
def main():
data = "HELLO;"
checksum = reduce(lambda x, y: x ^ y, data.encode("ascii"))
print(f"{data} -> {hex(checksum)}")
if __name__ == "__main__":
main() # HELLO; -> 0x79
For example, consider the header format ;%I;*;%X
.
Since <
is not specified, the checksum calculation range is ;%I;*;
.
That is, when sending HELLO
, the binary data ;000;HELLO;
is targeted, resulting in checksum 0x49
.
[Verification code in Python]
from functools import reduce
def main():
data = ";000;HELLO;"
checksum = reduce(lambda x, y: x ^ y, data.encode("ascii"))
print(f"{data} -> {hex(checksum)}")
if __name__ == "__main__":
main() # ;000;HELLO; -> 0x49
There is no format on the transmitting side input, but data is split and transmitted packet by packet.
Therefore, the following transmission triggers must be considered.
Transmission trigger settings are specified via the interactive mode k
: set transmission trigger item.
To set the transmission trigger character to LF, minimum data size to 8 bytes, and timeout to 30 ms, use the following settings.
m: set UART mode (E)
k: set Tx Trigger (sep=0x0a, min_bytes=8 dly=30[ms])
o: set option bits (0x00000100)
This section describes features specific to the serial communication app (App_Uart). For common functions, refer to the TWELITE APPS Manual Top Page.
Interactive Mode cannot be used while TWELITE is in sleep mode.
Make sure that the M3
pin is not connected to GND
.
[CONFIG MENU/App_Uart:0/v1-05-1/SID=8300051A]
a: (0x67720103) Application ID [HEX:32bit]
i: ( 120) Device ID [1-100,etc]
c: (18 ) Channel(s)
x: ( 0x03) RF Power/Retransmissions [HEX:8bit]
b: (115200,8N1) UART Baud Alt. [XXXXX]
o: (0x00000100) Option bits [HEX:32bit]
r: ( 0x00) Role [0-3,11-13]
l: ( 1) LayerTree repeat layer [1-63]
m: (E ) UART mode [ABCDE]
t: ( 0x0D0A) Tx trigger character [XX,XXYY]
u: ( 0) Minimum data size [0,1-80]
T: ( 0) Timeout [0,10-200 msec]
h: (;U;%t;%i;0x%A;%q;%s;<*;%X;\n) Header format / Handle name
C: ( 0) Encryption [0,1]
K: (*CRYPT_KEY_HERE*) Encryption key [16chrs]
[ESC]:Exit [!]:Reset System [*]:Extr Menu [:]:AppSel
Parameter | Default | Remarks | |
---|---|---|---|
a | Application ID | 0x67720103 | 32bit |
i | Logical Device ID | 120 | Parent 121 , Child 1 -100 , No ID Child 120 |
c | Frequency Channel | 18 | 11 -26 |
x | TX Power & Retransmit Count | 0x03 | |
Retransmit Count | 0 | 1 -9 times, 0 disables | |
TX Power | 3 | 0 -3 | |
b | UART Alternate Setting | 115200 ,`8N1 | Enable with BPS pin |
o | Option Bits | 0x00000000 | Other detailed settings |
r | Role | 0 | Normal 0 , Relay Child 1 -3 , Other |
l | LayerTree Relay Layer | 0x01 | |
m | Communication Mode | E | A /B /C /D /E |
t | TX Trigger Characters | 0x0D0A | ASCII code of trigger characters |
u | Minimum Data Size | 0 | Disabled 0 , 1 -80 |
T | Timeout | 0 | Disabled 0 , 10 -200 ms |
h | Header Format / Handle Name | Details | |
Header Format | When using Header Transmission Mode | ||
Handle Name | When using Chat Mode | ||
C | Encryption | 0 | Disabled 0 , AES128bit 1 |
K | Encryption Key | *CRYPT_KEY_HERE* | 16 characters |
Each command is described in detail below.
a
: Application IDAll devices participating in communication must use the same value. This logically separates networks.
i
: Logical Device IDSet this value if it is necessary to distinguish between multiple child devices.
If no distinction is needed or possible, set it to 120
. If distinction is required, use any value between 1
and 100
for child devices, and use 121
for parent devices.
c
: Frequency ChannelAll devices participating in communication must use the same value. This physically separates networks.
x
: TX Power & Retransmit CountSpecifies the RF transmission power and the number of retransmissions in Transparent Mode and Header Transmission Mode.
b
: UART Alternate SettingOverrides the default 38400bps alternate baud rate used when booting with the BPS
pin connected to GND
.
Select from: 9600
/ 19200
/ 38400
/ 57600
/ 115200
/ 230400
.
If the device is booted with the BPS
pin open, this setting will not be applied and the baud rate will be fixed at 115200
bps.
To forcibly apply the alternate baud rate regardless of the BPS
pin state, enable the Option Bit Force Apply Alternate Setting.
Bit-Parity-Stop
.o
: Option BitsSpecify a 32-bit value. Each bit enables a corresponding setting.
Bit | Setting Item | Default | A | B | C | D | E |
---|---|---|---|---|---|---|---|
0x00000001 | Disable Internal Pull-up of M3 | 0️⃣ | ✅ | ✅ | ✅ | ✅ | ✅ |
0x00000100 | Enable TX Trigger | 1️⃣ | ✅ | ✅ | |||
0x00000200 | Prioritize New Input Stream | 0️⃣ | ✅ | ✅ | ✅ | ✅ | |
0x00001000 | Suppress Response Message | 0️⃣ | ✅ | ✅ | ✅ | ||
0x00004000 | Relax Duplicate Checker | 0️⃣ | ✅ | ✅ | ✅ | ✅ | ✅ |
0x00010000 | Force Apply Alternate Baud Rate | 0️⃣ | ✅ | ✅ | ✅ | ✅ | ✅ |
0x00020000 | Simultaneous Output to Sub Port | 0️⃣ | ✅ | ✅ | ✅ | ✅ | ✅ |
0x00040000 | Switch Primary Port | 0️⃣ | ✅ | ✅ | ✅ | ✅ | ✅ |
0x01000000 | Disable LED | 0️⃣ | ✅ | ✅ | ✅ | ✅ | ✅ |
0x02000000 | Disable LED in Standby | 0️⃣ | ✅ | ✅ | ✅ | ✅ | ✅ |
r
: RoleValid for child devices only. Select one of the following. Normally, use a transmission mode that does not rely on the network layer (LayerTree).
0
: Default (Parent or Child)1
–3
: Repeater Child (set Logical Device ID to 1
–100
or 120
). The value indicates the maximum number of relay hops. Duplicated packets may occur depending on placement and number of repeaters.Only supported in Header Transmission Mode.
11
: Parent12
: Repeater13
: Childl
: LayerTree Relay LayerSpecifies the relay layer number. A repeater attempts to connect to parent or repeater devices with higher relay layers (smaller values). Valid only when Role is set to 12
.
m
: Communication ModeA
: Format Mode (ASCII)B
: Format Mode (Binary)C
: Chat ModeD
: Transparent ModeE
: Header Transmission Modet
: TX Trigger CharactersIn Transparent and Header Transmission modes, entering these characters triggers transmission of a packet.
If Minimum Data Size is specified, the characters will be ignored until that size is reached.
This setting is applied when Option Bit 0x00000100
(enabled by default) is set.
Initially, CRLF is used as the trigger.
u
: Minimum Data SizeSpecifies the minimum size of data to be handled continuously. TX Trigger Characters are ignored until this size is met.
In Interactive Mode, specify a number between 1
–80
as byte count. Set to 0
to disable. The default is disabled.
T
: TimeoutTime to wait from the last input before transmitting a packet.
In Interactive Mode, specify a value between 10
–200
in milliseconds. Set to 0
to disable. The default is disabled.
h
: Header Format / Handle NameSpecifies the header format for Header Transmission Mode, or the handle name for Chat Mode.
Specify the Header Format Syntax for use in Header Transmission Mode.
Specify the handle name to display on the receiving device.
Up to 23 characters. This consumes part of the data transmission area (80 bytes).
C
: EncryptionSpecifies whether to enable encryption.
To enable AES128-bit encryption, set this to 1
.
K
: Encryption KeySpecify a 16-character encryption key when encryption is enabled.
This section describes each setting associated with the bits of the Option Bits value.
00000001
: Disable Internal Pull-up of M3
Disables the internal pull-up resistor of the M3
pin used for sleep configuration on TWELITE DIP.
00000100
: Enable TX TriggerEnables the TX Trigger setting in Transparent or Header Transmission Mode.
00000200
: Prioritize New Input StreamIn Format Mode (ASCII/Binary), Transparent Mode, and Header Transmission Mode, if multiple input streams are received before the previous transmission is complete, the newer input is prioritized.
00001000
: Suppress Response MessageIn Format Mode (ASCII/Binary) and Header Transmission Mode, suppresses the response message after transmission completes.
00004000
: Relax Duplicate CheckerRelaxes the duplicate check conditions on the receiver side.
The duplicate checker prevents redundant packets that may arrive due to relays.
If the transmission interval is short (e.g., under 100 ms), even different packets might be mistakenly recognized as duplicates (even with different sequence numbers).
Enable this option when using short intervals or multiple transmitters concurrently.
00010000
: Force Apply Alternate SettingApplies the UART Alternate Setting even if the BPS
pin is not pulled low at boot.
00020000
: Simultaneous Output to Sub PortAlso outputs serial TX data to the secondary TX_SUB port.
00040000
: Switch Primary PortSwitches the serial I/O between the main TX/RX and the sub TX_SUB/RX_SUB ports.
When the communication range is insufficient or obstructed, using a repeater can be effective.
A repeater device retransmits packets it receives to other devices.
01000000
: Disable LEDDisables the LED on TWELITE STICK and MONOSTICK.
02000000
: Disable LED in StandbyDisables the LED on TWELITE STICK and MONOSTICK while in standby.
Normally, enter Interactive Mode and change the Role to a value between 1
and 3
. The default is 0
, which does not enable the repeater function.
r: set Role (0x0)
The values 1
to 3
indicate the maximum number of relay hops. For example, setting it to 3
allows up to 3 hops.
This setting is only valid for child devices, not for parent devices.
The following network configuration shows an example where the Role of red devices is set to 0
, and that of blue devices is set to 3
.
Example of relaying via Role setting
By adding more red devices, communication with up to three relay hops between them can be established.
Example of adding transmitters and receivers
4KB buffers are allocated for UART input and output. When outputting two UART lines, 2KB is used for input and output buffers for each line.
In format mode and chat mode, it is rarely necessary to be aware of buffer sizes, but in header transparent mode and transparent mode when continuously inputting streams, or even in format mode when inputting many streams at once, it is necessary to be aware of the buffer size limits. On the output side, if a slow baud rate is set, the output of data received wirelessly may not keep up.
Data beyond the buffer limits is not protected at the boundary, causing data loss. Especially on the input side, consider referring to the flow control pins described below.
Input flow control is implemented to behave like the RTS pin. The pin used is PWM1
(DIO5
), targeting the main UART port. When input is not accepted, the state is High; when input is accepted, the state is Low. Output flow control is not supported. Receiving devices should ensure sufficient baud rate and processing speed.
If data loss occurs on the receiving side, increase the number of wireless retransmissions.
Increasing the number of additional packets sent can improve the success rate of reception.
The number of retransmissions can be set in Interactive Mode (x: set RF Conf
).
For example, if you create firmware that changes the baud rate from 115200bps to 9600bps, you can use it at 9600bps from the start.
Change the settings in Interactive Mode and press S
to save.
Prepare software that can download data using the xmodem protocol.
While still in Interactive Mode (before selecting items), request xmodem download.
In TeraTerm, perform the following operations:
File > Transfer > XMODEM > Receive...
Option > Checksum, Binary
conf.bin
)Open
You can use lrzsz
on macOS or Linux.
lrx --binary --xmodem /path/to/conf.bin
Usually, enter Interactive Mode with
screen
, then pressCtrl+A
and execute:exec !! lrx -b -X /path/to/conf.bin
If the download succeeds, a 128-byte file is generated (may be smaller depending on xmodem implementation).
Concatenate the downloaded file to the end of the firmware binary file to create a custom binary.
Use command line tools or general file concatenation tools for concatenation.
Example assuming downloaded xmodem file is conf.bin
, original binary file is App_Uart_BLUE_L1305_V1-4-X.bin
, and custom binary to create is App_Uart_custom_V1-4-X.bin
.
【Windows】
copy App_Uart_BLUE_L1305_V1-4-X.bin App_Uart_custom_V1-4-X.bin
type conf.bin >> App_Uart_custom_V1-4-X.bin
【macOS / Linux】
cat App_Uart_BLUE_L1305_V1-4-X.bin conf.bin > App_Uart_custom_V1-4-X.bin
Write the concatenated custom binary to TWELITE.
When entering Interactive Mode after writing custom binary, C-
is displayed at the end of the first line.
--- CONFIG/TWE UART APP V1-04-2/SID=0x81001f1c/LID=0x78 C- ---
When overwriting settings from Interactive Mode and saving to custom binary, CE
is displayed instead of C-
.
--- CONFIG/TWE UART APP V1-04-2/SID=0x81001f1c/LID=0x78 CE ---