Pal App (App_PAL) is an application dedicated to the wireless tag system TWELITE PAL Series.
It is installed on TWELITE BLUE / RED PAL at factory shipment.
This is the multi-page printable view of this section. Click here to print...
Pal App (App_PAL) is an application dedicated to the wireless tag system TWELITE PAL Series.
It is installed on TWELITE BLUE / RED PAL at factory shipment.
To write the Pal App (App_PAL
), install TWELITE STAGE SDK and rewrite using the TWELITE STAGE App.
App_PAL_EndDevice
is for child devices.
Previously, App_PAL_Parent
was included for parent devices, but now it has been integrated into App_Wings
.
The number of child devices that can communicate with one parent device depends on the number of packets reaching the parent.
For example, if one child device continuously sends acceleration data, one-to-one communication is recommended.
When child devices operate intermittently, it is recommended to set the transmission interval for all child devices to at least 0.1 * the number of transmitters seconds. For example, if there are 10 child devices transmitting, each should have a transmission interval of at least 1 second.
This section explains features specific to the Pal app (App_PAL). For common features, please refer to the TWELITE APPS Manual main page.
Interactive mode cannot be used while TWELITE is sleeping.
Please start up with the SET
pin connected to GND
. TWELITE STAGE apps and TWELITE R2/R3 automatically perform this operation.
The screen will display as follows.
--- CONFIG/App_PAL V1-05-2/SID=0x810e0e23/LID=0x01 ---
a: set Application ID (0x67726305)
i: set Device ID (--)
c: set Channels (15)
x: set Tx Power (13)
b: set UART baud (38400)
B: set UART option (8N1)
k: set Enc Key (0xA5A5A5A5)
o: set Option Bits (0x00000001)
t: set Transmission Interval (60)
p: set Sensor Parameter (0x00000000)
e: set Event Parameter(s) (0180002A0208002A0300802A0488002A0580802A0608802A0880000A1008000A)
d: set Temperature Coefficient (0)
D: set Temperature Offset (0)
f: set Humidity Coefficient (0)
F: set Humidity Offset (0)
---
S: save Configuration
R: reset to Defaults
Setting Item | Default | Remarks | |
---|---|---|---|
a | Application ID | 0x67720107 | 32bit |
i | Logical Device ID | 120 | Child 1 -100 |
c | Frequency Channel | 16 | 11 -26 |
x | Retry Count and Tx Power | 3 | |
Retry Count | 0 | 1 -9 times, 0 is default: none | |
Tx Power | 3 | 0 -3 | |
b | UART Alternative Baud Rate | 38400 | Enabled with BPS pin |
B | UART Option | 8N1 | Enabled with BPS pin |
k | Encryption Key | 0xA5A5A5A5 | 32bit |
o | Option Bits | 0x00000000 | Other detailed settings |
t | Transmission Interval | 60 | 1 -4095 seconds |
p | Sensor-specific Parameter | 0 | |
e | Notification Event | 0180002A 0208002A 0300802A 0488002A 0580802A 0608802A 0880000A 1008000A | Notification Pal only |
d | Temperature Coefficient | 0 | Environmental Pal only 0 -60000 |
D | Temperature Offset | 0 | Environmental Pal only -2000 -2000 |
f | Humidity Coefficient | 0 | Environmental Pal only 0 -60000 |
F | Humidity Offset | 0 | Environmental Pal only -2000 -2000 |
Details of each command are as follows.
a
: Application IDAll devices communicating must use the same value. This logically separates networks.
i
: Logical Device IDSet when it is necessary to distinguish multiple child devices.
If there is no need or it is not possible to distinguish, set to 120
. If distinction is needed, children should use any value from 1
to 100
, and the parent should use 0
or 121
.
c
: Frequency ChannelAll devices communicating must use the same value. This physically separates networks.
x
: Tx Power and Retry CountSpecify the radio transmission power and the number of additional packet transmissions in transparent mode and headered transparent mode.
b
: UART Alternative Baud RateOverrides the alternative baud rate selected when the BPS
pin is connected to GND
at startup.
Selectable values are 9600
/19200
/38400
/57600
/115200
/230400
. Specifying other values may cause errors.
BPS
pin is left open at startup, this setting does not apply. It is fixed at 115200
bps.B
: UART OptionOverrides the alternative UART settings selected when the BPS
pin is connected to GND
at startup.
Parity can be set to N
: None, O
: Odd, or E
: Even. Hardware flow control cannot be set. Settings like 8N1 or 7E2 can be used, but settings other than 8N1 are unverified. Please confirm operation in advance.
BPS
pin is left open at startup, this setting does not apply. It is fixed at 115200
bps.k
: Encryption KeySpecify the 32-bit hexadecimal encryption key used when enabling encrypted communication in option bits.
o
: Option BitsSpecify a 32-bit value. Various settings linked to each bit can be enabled.
Bit | Setting Description | Default |
---|---|---|
0x00000001 | Enable Transmission to Repeater | 0️⃣ |
0x00001000 | Enable Encrypted Communication | 0️⃣ |
0x00010000 | Enable UART Output on Child | 0️⃣ |
t
: Transmission IntervalSpecifies the data transmission interval. For notification pals, it indicates the interval for querying control information from the parent and reflecting it on LED output.
p
: Sensor-specific ParameterDepends on the hardware.
e
: Notification EventSpecifies the behavior when an event number is received.
For details, see Notification Event Details.
d
: Temperature CoefficientSpecify the temperature data coefficient (d) in the range 0
-60000
.
0
disables it. Otherwise, the final temperature is multiplied by (\frac{d}{1024}).
D
: Temperature OffsetSpecify the temperature data offset (D) in the range -2000
to 2000
.
(D) is added to the temperature multiplied by 100. The final temperature changes by (\frac{D}{100}) °C.
f
: Humidity CoefficientSpecify the humidity data coefficient (f) in the range 0
-60000
.
0
disables it. Otherwise, the final humidity is multiplied by (\frac{f}{1024}).
F
: Humidity OffsetSpecify the humidity data offset (F) in the range -2000
to 2000
.
(F) is added to the humidity multiplied by 100. The final humidity changes by (\frac{F}{100}) %.
Explanation of settings linked to each bit of the option bits value.
00000001
: Enable Transmission to RepeaterEnables transmission not only to the parent but also to repeaters.
You can use repeaters even without setting this option, but the parent will remove duplicated packets. In this case, there is no way to determine which repeater the packet passed through or if it was not relayed.
If this option is set, the parent can output packets received from multiple devices separately. Devices connected to the parent can analyze the output to determine which device the child was near.
00001000
: Enable Encrypted CommunicationEnables encrypted communication. The other party must also enable encrypted communication.
00010000
: Enable UART Output on ChildEnables message output on the child device.
Explanation of settings linked to the sensor-specific parameter value.
Not used.
Not used.
Specify a 32-bit value.
bit | 31-28 | 27-24 | 23-20 | 19-16 | 15-12 | 11-8 | 7-4 | 3-0 |
---|---|---|---|---|---|---|---|---|
Function | - | - | - | - | ATH | SFQ | SCT:7-4 | SCT:3-0 |
Default | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Each function represents the following:
Name | Item | Description |
---|---|---|
SCT | Sample Count | Number of acceleration samples |
SFQ | Sampling Frequency | Sampling frequency of acceleration |
ATH | Active Detection Mode | Acceleration threshold, 0 disables |
SCT
: Sample CountSCT
affects the number of samples transmitted.
When ATH
is 0
and t
: Transmission Interval is non-zero, intermittent transmission mode is active.
If SCT
value is (C_i), the sample count is represented as (16C_i+16).
p | SCT | Sample Count |
---|---|---|
0x??????00 | 0x00 | 16 samples (default) |
0x??????01 | 0x01 | 32 samples |
… | ||
0x??????07 | 0x07 | 128 samples |
… | ||
0x??????FF | 0xFF | 4096 samples |
When ATH
and t
: Transmission Interval are both non-zero, active detection mode is active.
In active detection mode, when acceleration exceeds the threshold given by ATH
, it transmits the samples immediately after, in addition to the previous 30 samples.
If SCT
value is (C_a), the number of subsequent samples is (30C_a+30).
p | SCT | Subsequent Sample Count |
---|---|---|
0x??????00 | 0x00 | 30 samples (default) |
0x??????01 | 0x01 | 60 samples |
… | ||
0x??????07 | 0x07 | 240 samples |
… | ||
0x??????FF | 0xFF | 7680 samples |
SFQ
: Sampling FrequencySFQ
affects the sampling frequency of acceleration data.
p | SFQ | Sampling Frequency |
---|---|---|
0x?????0?? | 0x0 | 25Hz (default) |
0x?????1?? | 0x1 | 50Hz |
0x?????2?? | 0x2 | 100Hz |
0x?????3?? | 0x3 | 190Hz |
ATH
: Active Detection ModeATH
affects the behavior of active detection mode.
0
disables it. Values 1
-F
enable it with the value as the threshold.
p | ATH | Description |
---|---|---|
0x????0??? | 0x0 | Disabled (default) |
0x????1??? | 0x1 | 1G (not recommended) |
0x????2??? | 0x2 | 2G |
… | ||
0x????F??? | 0xF | 15G |
ATH
is set to 1
, the device will always be in active state even when stationary.Specify a 32-bit value.
p | Description |
---|---|
0x00000000 | Tap & Shake Mode |
0x00000001 | Dice Mode |
00000000
: Tap & Shake ModeSends data when tapped or shaken.
00000001
: Dice ModeDetects six different top faces and sends data.
The value is binary data up to 68 bytes, represented as a hexadecimal string.
One event consists of 4 bytes. The maximum number of events is 17.
# | Data | Description | Remarks |
---|---|---|---|
1st event | |||
0 | uint8 | Event ID | 0x00 -0x10 |
1 | uint8 | Red and Green Brightness | Red 0x0? -0xF? , Green 0x?0 -0x?F |
2 | uint8 | Blue and White Brightness | Blue 0x0? -0xF? , White 0x?0 -0x?F |
3 | uint8 | Blink Pattern and On Time | |
Blink Pattern | Steady 0x0? , Slow 0x1? , Medium 0x2? , Fast 0x3? | ||
On Time | No off 0x?0 , Seconds specified 0x?1 -0x?F | ||
2nd event | |||
4 | uint8 | Event ID | 0x01 -0x10 |
5 | uint8 | Red and Green Brightness | Red 0x0? -0xF? , Green 0x?0 -0x?F |
6 | uint8 | Blue and White Brightness | Blue 0x0? -0xF? , White 0x?0 -0x?F |
7 | uint8 | Blink Pattern and On Time | |
Blink Pattern | Steady 0x0? , Slow 0x1? , Medium 0x2? , Fast 0x3? | ||
On Time | No off 0x?0 , Seconds specified 0x?1 -0x?F | ||
3rd event | |||
17th event | |||
64 | uint8 | Event ID | 0x01 -0x10 |
65 | uint8 | Red and Green Brightness | Red 0x0? -0xF? , Green 0x?0 -0x?F |
66 | uint8 | Blue and White Brightness | Blue 0x0? -0xF? , White 0x?0 -0x?F |
67 | uint8 | Blink Pattern and On Time | |
Blink Pattern | Steady 0x0? , Slow 0x1? , Medium 0x2? , Fast 0x3? | ||
On Time | No off 0x?0 , Seconds specified 0x?1 -0x?F |
An example of the default setting is shown.
0180002A0208002A0300802A0488002A0580802A0608802A0880000A1008000A
# | Data | Description | Value | |
---|---|---|---|---|
1st event | ||||
01 | 0 | uint8 | Event ID | 0x01 |
80 | 1 | uint8 | Red and Green Brightness | Red 8 /15 , Green 0 /15 |
00 | 2 | uint8 | Blue and White Brightness | Blue 0 /15 , White 0 /15 |
2A | 3 | uint8 | Blink Pattern and On Time | Medium, 10 seconds |
2nd event | ||||
02 | 4 | uint8 | Event ID | 0x02 |
08 | 5 | uint8 | Red and Green Brightness | Red 0 /15 , Green 8 /15 |
00 | 6 | uint8 | Blue and White Brightness | Blue 0 /15 , White 0 /15 |
2A | 7 | uint8 | Blink Pattern and On Time | Medium, 10 seconds |
3rd event | ||||
8th event | ||||
10 | 28 | uint8 | Event ID | 0x10 |
08 | 29 | uint8 | Red and Green Brightness | Red 0 /15 , Green 8 /15 |
00 | 30 | uint8 | Blue and White Brightness | Blue 0 /15 , White 0 /15 |
0A | 31 | uint8 | Blink Pattern and On Time | Steady, 10 seconds |