/      日本語

How to Use

How to use the TWELITE PAL Script
Instructions for using TWELITE PAL with MONOSTICK.

Preparing Your PC

  1. Extract the downloaded archive to an easy-to-find folder (for example, C:).

  2. 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”.

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

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

  2. Open Command Prompt and enter the following command to install pyserial.

    
    
    pip install pyserial

Preparing TWELITE PAL

  1. Connect SENSE PAL to BLUE PAL/RED PAL.
  2. Insert a coin cell battery (CR2032) into the battery holder of BLUE PAL/RED PAL.

Preparing MONOSTICK

  1. Rewrite the MONOSTICK application (App_PAL-Parent-xxx-MONOSTICK.bin).
  2. 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.

HeaderDescriptionUnit
LogicalIDLogical Device ID of the end device-
EndDeviceSIDSerial number of the end device-
LQILQI-
PowerPower supply voltagemV
ADC*VoltagemV
HALLICMagnetic sensor state-
TemperatureTemperature
HumidityHumidity%
IlluminanceIlluminanceLux

AccelerationX
AccelerationY
AccelerationZ

Accelerationg