/      日本語

Serial Communication App Format Mode (ASCII)

Mode that adds headers to both transmitted and received outputs (ASCII format)
Format mode adds headers to both transmitted and received outputs. In ASCII format, data is represented as hexadecimal strings.
Example network configuration with format mode

Overview

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 InputReceiving Side Output
Simple/Extended format dataSimple/Extended format data
  • In TWELITE UART, format mode (ASCII) is enabled by starting up with the SET pin connected to GND.
  • In TWELITE / TWELITE DIP, format mode (binary) is enabled by starting up with the EX1 pin connected to GND.

There are two types of formats that can be handled.

  • Simple format: uses only the Logical Device ID. Extremely Simple! Compatible with the UART transmission function of the standard app.
  • Extended format: uses Logical Device ID plus transmission options such as Serial ID and retry count.

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

Basic Format

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).

HeaderPayloadChecksumFooter
:Repeated 00-FFLRC8 of payloadCRLF
  • All ASCII characters
  • Starts with : (0x3A)
  • Checksum is the two’s complement of the sum of the payload
  • Ends with CRLF (\r\n/0x0D 0x0A)
  • Big-endian

For example, binary data 0x00 0x11 0x22 0x33 0xAA 0xBB 0xCC is expressed as follows.

:00112233AABBCC69<CR><LF>

Distinguishing Parent and Child Devices

Format mode distinguishes between parent and child devices.

The Application ID and frequency channel must be matched between parent and child devices.

Source Identification

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.

Simple Format

When using the simple format of format mode, follow the format below.

Transmitting Side Input

#DataDescriptionNotes
charHeaderOnly :
0uint8Destination Logical Device IDParent 0x00, child 0x01-0x64, all children 0x78
1uint8Command numberAny value less than 0x80
2[uint8]Arbitrary dataByte sequence of length (N) (recommended (N \leqq 80))
uint8ChecksumLRC8
charFooterCR (0x0D/'\r')
charFooterLF (0x0A/'\n')

Receiving Side Output

#DataDescriptionNotes
charHeaderOnly :
0uint8Source Logical Device IDParent 0x00, child 0x01-0x64, unset child 0x78
1uint8Command numberValue less than 0x80 specified by the sender
2[uint8]Arbitrary dataByte sequence of length (N)
uint8ChecksumLRC8
charFooterCR (0x0D/'\r')
charFooterLF (0x0A/'\n')

Transmitting Side Output (Response Message)

#DataDescriptionNotes
charHeaderOnly :
0uint8Source Logical Device IDOnly 0xDB: indicates itself
1uint8Command numberOnly 0xA1
2uint8Response IDContinuation number in the range 128-255 (0x80-0xFF)
3uint8ResultSuccess 1, failure 0
uint8ChecksumLRC8
charFooterCR (0x0D/'\r')
charFooterLF (0x0A/'\n')

Example Usage

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 from 0x78 to 0xCC (LSB 8 bits).

[Receiving side: All children]

:0001112233AABBCC68<CR><LF>  <- Output

The trailing 0x68 is the checksum: the two’s complement of the sum from 0x00 to 0xCC (LSB 8 bits).

Extended Format

When using the extended format of format mode, follow the format below.

Transmitting Side Input

When specifying destination using Logical Device ID

#DataDescriptionNotes
charHeaderOnly :
0uint8Destination Logical Device IDParent 0x00, child 0x01-0x64, all children 0x78
1uint8Command numberOnly 0xA0
2uint8Response IDAny value
3[uint8]OptionsOption list of length (N) (Details of option list)
3+(N)[uint8]Arbitrary dataByte sequence of length (M) (recommended (M \leqq 80))
uint8ChecksumLRC8
charFooterCR (0x0D/'\r')
charFooterLF (0x0A/'\n')

When specifying destination using Extended Address

#DataDescriptionNotes
charHeaderOnly :
0uint8Extended Address SpecifierOnly 0x80
1uint8Command numberOnly 0xA0
2uint8Response IDAny value
3uint32Destination Extended AddressSerial ID with 0x8 added at the front
7[uint8]OptionsOption list of length (N) (Details of option list)
7+(N)[uint8]Arbitrary dataByte sequence of length (M) (recommended (M \leqq 80))
uint8ChecksumLRC8
charFooterCR (0x0D/'\r')
charFooterLF (0x0A/'\n')

Details of Option List

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.

IDArgumentDefaultDescription
0x01NoneDisabledEnable MAC ACK
0x02uint80x00Enable application retry
0x03uint160x0000Minimum initial transmission delay
0x04uint160x0000Maximum initial transmission delay
0x05uint1610Application retry interval
0x06NoneDisabledAllow parallel requests
0x07NoneDisabledDisable response messages
0x08NoneDisabledSleep after transmission
0x01: Enable MAC ACK

Enables MAC layer ACK (acknowledgment).

Not suitable for frequent data transmission, but can improve reliability.

0x02: Enable Application Retry

When 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 Delay

Specifies the minimum delay before the first transmission in milliseconds.

0x04: Maximum Initial Transmission Delay

Specifies the maximum delay before the first transmission in milliseconds.

0x05: Application Retry Interval

Specifies the retry interval in milliseconds when application retry is enabled.

0x06: Allow Parallel Requests

Allows 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 Messages

Disables the response messages output when data is input on the transmitting side.

0x08: Sleep After Transmission

Immediately 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.

Receiving Side Output

#DataDescriptionNotes
charHeaderOnly :
0uint8Source Logical Device IDParent 0x00, child 0x01-0x64, unset child 0x78
1uint8Command numberOnly 0xA0
2uint8Response IDValue specified by the sender
3uint32Source Extended AddressSerial ID with 0x8 added at the front
7uint32Destination Extended Address0xFFFFFFFF if using Logical Device ID
11uint8LQIRadio communication quality at reception
12uint16Length of following byte sequenceNumber of bytes (M)
14[uint8]Arbitrary dataByte sequence of length (M)
uint8ChecksumLRC8
charFooterCR (0x0D/'\r')
charFooterLF (0x0A/'\n')

Transmitting Side Output (Response Message)

#DataDescriptionNotes
charHeaderOnly :
0uint8Source Logical Device IDOnly 0xDB: indicates itself
1uint8Command numberOnly 0xA1
2uint8Response IDValue specified at input
3uint8ResultSuccess 1, failure 0
uint8ChecksumLRC8
charFooterCR (0x0D/'\r')
charFooterLF (0x0A/'\n')

Example Usage

An example of sending byte sequence 0x11 0x22 0x33 0xAA 0xBB 0xCC from the parent to a child is shown.

Example specifying Logical Device ID

An example sending from the parent to the child with Logical Device ID 0x42.

  • Response ID is 0x01
  • No options
  • Parent’s extended address is 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 from 0x42 to 0xCC (LSB 8 bits).

[Receiving side: Child]

:00A00181000000FFFFFFFFC80006112233AABBCC7D<CR><LF>  <- Output

The trailing 0x7D is the checksum: the two’s complement of the sum from 0x00 to 0xCC (LSB 8 bits).

Example specifying Extended Address

An example sending from the parent to the child with extended address 0x81000001 (Serial ID 0x1000001).

  • Response ID is 0x01
  • No options
  • Parent’s extended address is 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 from 0x80 to 0xCC (LSB 8 bits).

[Receiving side: Child]

:00A0018100000081000001C80006112233AABBCCF7<CR><LF>  <- Output

The trailing 0xF7 is the checksum: the two’s complement of the sum from 0x00 to 0xCC (LSB 8 bits).

Example using MAC ACK

An example sending from the parent to the child with Logical Device ID 0x42 using MAC ACK.

  • Response ID is 0x01
  • Option 0x01: Enable MAC ACK specified
  • Parent’s extended address is 0x81000000 (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 from 0x42 to 0xCC (LSB 8 bits).

[Receiving side: Child]

:00A00181000000FFFFFFFFC80006112233AABBCC7D<CR><LF>  <- Output

The trailing 0x7D is the checksum: the two’s complement of the sum from 0x00 to 0xCC (LSB 8 bits).

Example using delay

An example sending from the parent to the child with Logical Device ID 0x42 with a 768ms delay.

[Sending side: Parent]

:42A001030300FF112233AABBCC81<CR><LF>  <- Input
:DBA1010182<CR><LF>  <- Output

The trailing 0x81 is the checksum: the two’s complement of the sum from 0x42 to 0xCC (LSB 8 bits).

[Receiving side: Child]

:00A00181000000FFFFFFFFC80006112233AABBCC7D<CR><LF>  <- Output

The trailing 0x7D is the checksum: the two’s complement of the sum from 0x00 to 0xCC (LSB 8 bits).

0xDB Command

Instead of setting interactive mode, you can operate and configure the module by inputting the 0xDB command from UART.


0xDB Command in Serial Communication App Format Mode (ASCII)

Setting functions using the 0xDB command in format mode (ASCII) without using Interactive Mode