How to Use
Preparing Your PC
Extract the downloaded archive to an easy-to-find folder (for example, C:).
Download and install Anaconda suitable for your PC environment from the following webpage.
https://www.anaconda.com/download/
If you do not want to install Anaconda, refer to “If Not Installing Anaconda”.Open Anaconda Prompt and run the following command to install pyserial. (On Windows, open Anaconda Prompt from the Start menu → Anaconda3.)
pip install pyserial
If Not Installing Anaconda
The installation steps below are an example for Windows OS. Please refer to the documentation of each library and install the necessary software and libraries.
Download and install the latest version of Python from the following page.
https://www.python.org/downloads/
At that time, make sure to check the box surrounded by the frame in the figure below
or add Python’s installation directory to your PATH.Open Command Prompt and enter the following command to install pyserial.
pip install pyserial
Preparing TWELITE PAL
- Connect SENSE PAL to BLUE PAL/RED PAL.
- Insert a coin cell battery (CR2032) into the battery holder of BLUE PAL/RED PAL.
Preparing MONOSTICK
- Rewrite the MONOSTICK application (App_PAL-Parent-xxx-MONOSTICK.bin).
- Reset MONOSTICK or reconnect it to the USB port.
Running the Script
If the COM port of MONOSTICK is COM6, run the following command in Anaconda Prompt to output data as shown below. (It cannot be started if Teraterm is connected.)
cd C:\PAL_Script
python PAL_Script.py -t COM6
*** MONOWIRELESS App_PAL_Viewer 1.1.0 ***
*** Open COM6 ***
ArriveTime : 2021/03/05 09:43:28.880
LogicalID : 1
EndDeviceSID : 10B6465
RouterSID : No Relay
LQI : 180 (-35.50 [dBm])
…
To exit the script, press Ctrl+C
in Anaconda Prompt.
Script Arguments
You can use the following arguments when running the script.
Argument: -h
Function: Display a list of command line arguments
Example: python PAL_Script.py -h
Argument: -t
Function: Specify the port name used by MONOSTICK
Setting: MONOSTICK port name
Default: COM3 on Windows, /dev/ttyUSB0 on Linux, etc.
Example: python PAL_Script.py -t COM6
Argument: -b
Function: Specify the baud rate of the port used by MONOSTICK
Setting: MONOSTICK baud rate
Default: 115200
Example: python PAL_Script.py -t COM6 -b 115200
Argument: -l
Function: Output log in CSV format
Example: python PAL_Script.py -t COM6 -l
Note: A CSV file will be generated in the same directory.
The file name will be AppPAL_SerialNumber_PAL_YYYYMMDD.csv
The CSV file columns are explained in the table below.
Header | Description | Unit |
---|---|---|
LogicalID | Logical Device ID of the end device | - |
EndDeviceSID | Serial number of the end device | - |
LQI | LQI | - |
Power | Power supply voltage | mV |
ADC* | Voltage | mV |
HALLIC | Magnetic sensor state | - |
Temperature | Temperature | ℃ |
Humidity | Humidity | % |
Illuminance | Illuminance | Lux |
AccelerationX | Acceleration | g |