This is the multi-page printable view of this section. Click here to print...

Return to the regular view of this page

As of 2025-07-24

TWELITE STAGE APP Manual

An application for building, rewriting, configuring, and displaying data
TWELITE STAGE APP is an application used for building and rewriting firmware, configuring TWELITE APPS, and displaying data. It is used in the TWELITE STAGE evaluation and development environment.

It operates on various platforms:

  • Windows 10
  • macOS (High Sierra or later, supports both Intel and Apple Silicon Macs)
  • Linux (Ubuntu 18.04)
  • Raspberry Pi (Raspberry Pi 3 Model B, LCD Touch Screen, Raspberry Pi OS August 2020)
  • (M5stack: Supported up to version 1.0. Versions 1.3 and later are not supported at the source level.)

※ Depending on the platform, operating conditions, distribution formats, and features may differ.

Root Menu

Root Menu

Real-time Acceleration Graph

Real-time Acceleration Graph

About this Document

  • To indicate the target platforms, some pages specify the following:
    • Windows   – Windows 10
    • macOS   – Mac OS X, OS X, macOS
    • Linux   – Ubuntu, etc. (64bit)
    • RasPi   – Raspberry Pi

1 - Obtaining the Package

How to obtain TWELITE STAGE APP

The latest TWELITE STAGE app can be obtained by one of the following methods.

Entire TWELITE STAGE SDK (Official Website)

The Mono Wireless official website distributes a complete set of development tools (for Windows/macOS/Linux), including the TWELITE STAGE app.

TWELITE STAGE-トワイライトステージ - MONO-WIRELESS.COM

TWELITE STAGE App Only (GitHub)

The Mono Wireless official repository distributes the standalone binary of the TWELITE STAGE app. Please use this if you want to update only the TWELITE STAGE app or obtain the M5Stack version. The version of each binary can be identified from the tags on GitHub.

Windows

monowireless/TWELITE_Stage_BIN_Win: Binary Distribution of TWELITE Stage.

macOS

monowireless/TWELITE_Stage_BIN_macOS: Binary distribution of TWELITE Stage for macOS

Linux

Linux binaries are not distributed separately. Please obtain binaries from the TWELITE STAGE SDK package or build from source code.

Raspberry Pi

Raspberry Pi binaries are not distributed separately. Please obtain binaries from the TWELITE STAGE SDK package or build from source code.

M5Stack

Versions up to 1.0.3a are distributed on the following page.

monowireless/TWELITE_STAGE_Bin_M5Stack

Source Code (MWM5 Library)

The MWM5 library, including the source code of TWELITE STAGE, is published on the following page.

monowireless/mwm5

The source code of the TWELITE STAGE app is placed in examples/TWELITE_Stage.

2 - How to Use

How to use TWELITE STAGE APP
This section explains the screens and operation methods of the TWELITE STAGE APP.

How to Launch the App

To launch the TWELITE STAGE app, execute the executable file located in {MWSTAGE Installation}.

The method of execution varies depending on the platform (Windows, macOS, Linux).

SystemExtensionNotes
Windows.exeDouble-click the executable file in Explorer
macOS.commandDouble-click the executable file in Finder
Linux RasPi.runDepends on the distribution and installation environment.
Execute as a command from a terminal window (such as xterm) on the X Window System

Executable Types of the App

The TWELITE STAGE APP has two types of executables.

  • TWELITE_Stage.{extension} - Launches with standard settings.
  • TWELITE_Stage_VSCode.{extension} - Configured to “Use VSCode” (settings saved in TWELITE_Stage_VSCode.ini). When the VSCode usage setting is enabled, the app operates in a way suitable for development work using VSCode.

App Interface

When you launch the app, two types of windows are displayed:

  • Main Window
    • Displays the user interface of the TWELITE STAGE APP.
      • The serial port under connection (e.g. TWELITE-R or TWELITE STICK) is displayed in the title bar.
    • All operations of the TWELITE STAGE APP are performed within this window.
      • Press the ALT (Cmd) key to display the operating aid screen.
      • The [ A ] [ B ] [ C ] buttons appear at the bottom of the screen and are used for operation. These buttons can be pressed and held down to call up sub-functions.
  • Command Window
    • Usually not used, but displays auxiliary information.
      • Shows serial communication content, making it ideal for checking logs.
      • When launched from the command line, the originating terminal acts as the command window.
Example Screen of TWELITE STAGE APP

Example Screen of TWELITE STAGE APP

Exiting the App

Exit the app by any of the following methods:

  • Move the mouse pointer to the upper right of the execution screen and press the exit button displayed within the screen.
  • Close the app window (on macOS, ⌘Q can also be used).

2.1 - Key and Mouse Operations

Key and mouse operations for TWELITE STAGE APP

Windows   macOS   Linux   RasPi

This section explains the key and mouse operations used in TWELITE STAGE APP.

Key Operations

Windows   macOS   Linux   RasPi

Key inputs performed while holding down Alt (Cmd) are assigned to operations such as changing the settings of TWELITE STAGE APP. Other key operations generally function as normal text input.

Common Keys

Windows   macOS   Linux   RasPi

KeyMeaning
ESC ESCQuickly press ESC twice. Cancel or return to the previous screen.
On some screens, pressing once returns to the previous screen.
ENTEREnter, Select
BSDelete one character
Cursor Keys
Select item

Help Screen

Windows   macOS   Linux   RasPi

Hold down Alt (Cmd) to display the help screen. The help screen shows explanations of keys that can be used together with Alt (Cmd) and some operational status.

The help screen can also be displayed by moving the mouse pointer to the top-left corner of the screen.

Help Screen

Help Screen

Alt (Cmd) + Operations

Windows   macOS   Linux   RasPi

This section explains operations performed while holding down Alt (Cmd).

In the table below, the Alt (Cmd)+ prefix is omitted. You can check the available keys from the help screen above, but supplementary explanations are provided in the table below.

Alt (Cmd)+ KeyMeaning
IInputs + + +. This is the key sequence to enter interactive mode.
※ Apps that perform intermittent operation due to sleep are not supported.
RResets the module. Controls the reset pin using the functions of TWELITE R or MONOSTICK.
A, S, DPress buttons A, B, C.
Shift+A, S, DLong press buttons A, B, C.
CCopies the text displayed on the screen to the clipboard. (The range varies depending on the screen)
VPastes from the clipboard as keyboard input.
FSwitches to full-screen display. If Shift+F is pressed, it enlarges further if possible.
GChanges the screen rendering method. It emulates a 640x480 LCD screen, but for enlargement, four rendering styles can be selected: (1. LCD monitor style / 2. CRT style / 3. Enlarged with dots emphasized / 4. Enlarged with dots blurred).
※ You can change the startup setting in the settings menu.
JSelects the screen size. Available sizes are {640,480}, {1280,720}, {1280,960}, {1920,1440}, {2560,1440}, {320,240}.
※ Can be set as startup setting in the settings menu.
QQuits TWELITE STAGE APP.
0Disconnects the serial port and shows the list of serial ports again.
1, 2, …Selects the serial port.
BChange baud rate if serial port is open (9600, 19200, 38400, 57600, 115200, 234000).
L, Shift+LStarts logging serial port input/output. When finished, the log file opens with Notepad on Windows or Log Viewer on macOS. Shift+L opens the log storage folder.

Other Operations

KeyMeaning
Alt (Cmd)+Shift+Ctrl+mOpens the MWX library code folder.
Alt (Cmd)+Shift+lOpens the log folder.

Mouse Operations

Windows   macOS   Linux   RasPi

Mouse operations mainly involve left-clicking, but right-click, right double-click, and the scroll wheel may be used.

Mouse OperationMeaning
Left clickSelect
Left click and dragUsed on some screens (e.g., dragging on graph screens)
Left double-clickNot used
Right clickUsed on some screens
Right double-clickExit the screen (same as ESC ESC)
Scroll wheelUsed on some screens (e.g., zoom in/out on graph screens)

Mouse Control of A, B, C Buttons

Windows   macOS   Linux   RasPi

When you move the mouse pointer to the menu display at the bottom of the screen, buttons labeled [ A ], [ B ], and [ C ] appear. TWELITE STAGE APP assigns functions of the hardware buttons arranged in this way to each screen. You can call the functions by left-clicking or long-pressing these buttons. (They can also be selected with Alt (Cmd)+a,s,d or Alt (Cmd)+Shift+a,s,d)

Example of virtual [ B ] button displayed at the bottom of the screen

Example of virtual [ B ] button displayed at the bottom of the screen

Mouse Control of Screen Operations

Windows   macOS   Linux   RasPi

On Windows/macOS/Linux, TWELITE STAGE APP screens are basically composed of text only, but menus, buttons, and tabs can be operated with the mouse.

Example of Commander Screen

Example of Commander Screen

The screen consists of text only, but the tabs at the top of the screen and inverted text can be selected by left-clicking with the mouse.

2.2 - Screen Operations

Operation instructions for each screen of TWELITE STAGE APP

Windows   macOS   Linux   RasPi

Example of the menu screen

Example of the menu screen

Windows / macOS / Linux / Raspberry Pi

TWELITE STAGE APP is an application launched from the console screen (command line). It outputs information to both the console screen and window screen.

The console screen displays UART output similar to a terminal.

Raspberry Pi (nox)

Displays on the framebuffer without using X11.

Normally (when started from a shell screen on the framebuffer), the console screen is not displayed.

2.2.1 - Serial Port Selection

Operation instructions for the serial port selection screen

Windows   macOS   Linux   RasPi

Overview

On Windows / macOS / Linux, a screen to select the serial port connected to TWELITE is displayed at startup. However, the serial port can also be connected later.

Example of the serial port selection screen

Example of the serial port selection screen

Windows

Press the c key to display the COM port name of the serial port currently highlighted in the list.

Raspberry Pi

On Raspberry Pi, in addition to USB devices, if /dev/serial0 and /dev/serial1 exist, serial0 and serial1 will be displayed. Normally, serial0 is used.

2.2.2 - Main Menu

Operation instructions for the main menu screen

Windows   macOS   Linux   RasPi

This is the top level of the hierarchical menu.

Example of the main menu screen

Example of the main menu screen

On this screen, you select a menu. When a menu is highlighted, a brief explanation is displayed in green text at the bottom.

  • Viewer: A viewer that interprets and displays packets received from TWELITE. In many cases, the receiving TWELITE is programmed with App_Wings.
  • Write Firmware: Build the firmware and write it to the connected TWELITE.
  • Interactive settigns mode: Configure the connected TWELITE settings via interactive mode.
  • Settings of TWELITE STAGE: Configure various settings of the TWELITE STAGE app.
  • Select SERIAL port: Select the serial port.
  • Open MANUAL: Menu to display manuals. Opens the following manuals in a browser:
    • TWELITE STAGE App (this document)
    • MWX Library
    • TWENET_C Library

2.2.2.1 - Viewer

About the viewer

Windows   macOS   Linux   RasPi

The viewer is a feature for displaying information received from a connected TWELITE and sending commands.

2.2.2.1.1 - Terminal

Operation instructions for the Terminal screen

Windows   macOS   Linux   RasPi

Example of the Terminal screen

Example of the Terminal screen

Overview

A general VT100-compatible serial terminal.

Supports TWELITE interactive mode and reset control.

Operations

OperationDescription
[ A ]Input the + + + sequence (interactive mode)
[ A ]
Long press
Exit this screen and return to the previous menu.
[ B ]Display a partial area of the first screen with a larger font.
The area is selected so that the cursor is visible on the screen, but depending on the screen output, the desired part may not be visible.
[ B ]
Long press
Toggle word wrap ON/OFF.
By default, word wrap is enabled, but you can also display without wrapping. Characters beyond the right edge of the screen will not be displayed.
[ C ]Move to the firmware update screen.
During firmware development, source code modification, operation check, build & write are frequently performed, so a shortcut is provided.
[ C ]
Long press
Control and reset the TWELITE reset pin.
ESC ESCPress the ESC key twice quickly to exit this screen.
※ In most screens, pressing the ESC key once exits the screen, but in the terminal, a single ESC key input is used for other purposes, so double input is assigned.

2.2.2.1.2 - Standard App Viewer

Operation instructions for the Standard App Viewer screen

Windows   macOS   Linux   RasPi

Example of the Standard App Viewer screen

Example of the Standard App Viewer screen

Overview

The TWELITE communicating partner should have App_Twelite (Standard App) programmed. When a message indicating the status of buttons or analog inputs of the Standard App (0x81 message) is received, its contents are interpreted and displayed using the mwm5 parser library.

Operations

OperationDescription
[ A ]No assignment
[ A ]
Long press
Exit this screen and return to the previous menu.
[ B ]Change the font.
[ B ]
Long press
Display the screen with test dummy data.
[ C ]No assignment
[ C ]
Long press
Control the reset pin of the TWELITE to reset it.
ESC ESCPress the ESC key twice to exit this screen.

2.2.2.1.3 - Graph

List of graph screens
  • Accelerometer Real-Time Graph: Displays accelerometer sensor packets in real time. Frequency domain display and CSV file saving are available.
  • Sensor Graph: Saves data from various TWELITE sensors into an sqlite3 database and displays graphs.

2.2.2.1.3.1 - Accelerometer Real-Time Graph

Operation instructions for the Accelerometer Real-Time Graph screen

Windows   macOS   Linux   RasPi

Example Display of Demo Data

Example Display of Demo Data

Overview

This refers to packets received from TWELITE CUE and TWELITE Motion Sensor PAL. It can display accelerometer data in real-time, and includes features for frequency analysis and CSV export.

It supports three modes: CUE mode, MOT mode, and 2525 FIFO mode.

When a continuous series of samples reaches a certain number (analysis window), frequency analysis of the XYZ axes is displayed. However, in 2525 FIFO mode, it is assumed to be always continuous.

When packet boundaries are explicit (e.g., when more than 3 seconds have elapsed since the previous packet, in CUE mode for each packet, or in MOT mode when the packet sequence number is discontinuous), four dummy samples are inserted and a pink background is shown.

Data from up to four nodes are stored on a first-come, first-served basis.

Operation

OperationDescription
Top right
(i)ID# button
Click to switch the ID.
(Note: Continuous sample data in FIFO mode is not suitable for multi-ID operation)
Top right
(f)SMP# button
Click to change the analysis window size among 64, 128, and 256.
Bottom right
(c)Save Display Data button
Exports data in CSV format to the log folder.
Outputs from the oldest sample in the buffer to the latest sample at the right edge of the screen.
(Note: The output is always 5120 samples, with the latest data at the end)
Bottom right
PAUSE( ) button
Pauses display updates.
(Note: Samples are still collected until the internal temporary sample buffer is full)
Mouse drag
(Graph area)
Moves the position of displayed samples.
Mouse drag
(Bottom scrollbar)
Moves the displayed sample position in larger steps.
Arrow keys
Moves the sample display area.
Arrow keys
Zooms in/out on the horizontal axis of samples (1x / 2x / 3x / 4x).
(Note: Up to 2x when the analysis sample count is 256)

Sample Rate Estimation

The sampling rate is calculated from the packet reception times. It averages the reception times of multiple past samples to estimate one sample interval, so packet drops may cause significant errors. Also, the related log timestamp (T_SMPL) is an estimated value and is delayed compared to the packet acquisition time. Once sample rate estimation completes, graph scrolling becomes smooth.

Opening the CUE Graph Mode on Startup

Specify 31 in [STAGE Common Settings → Startup App Selection].

Log Output (Save Display Data)

Pressing the (c) Save Display Data button outputs up to 512 samples starting from the current display position (rightmost sample).

Log file name is {log folder}/acc_snap_{timestamp}.csv.

  • Data has the newest sample at the right edge as sample number 512 (file end).
  • When frequency analysis is performed, the last samples used for frequency analysis are included.
  • Frequency analysis results are added to rows containing frequency analysis target samples (for 64 samples, results appear from sample 449 for 32 rows, showing from DC to high frequency components).
LabelItem NameDescription
#Sample
Number
T_PKT[ms]Packet
Reception Time
Multiple samples may be included in one packet, so samples with the same timestamp are listed.
SEQPacket
Sequence Number
Assigned to each packet; continuity indicates no packet loss.
T_SMPL[ms]Sample
Time (Virtual/Estimated)
Timestamp generated for each sample from packet reception time.
Does not match the actual sampling time.
(Note: Sample rate is estimated from packet reception intervals, and sample times are cumulatively added, so timestamps are delayed by one packet interval compared to actual sample time)
X[G]X-axis Sample ValueUnit is G. Based on sensor values.
Y[G]Y-axis Sample ValueUnit is G. Based on sensor values.
Z[G]Z-axis Sample ValueUnit is G. Based on sensor values.
FD#Frequency Analysis Calculation IndexFor 64 samples, ordered as DC,1,2,...,31.
HzFrequency Analysis Frequency Axis ValueEstimated frequency, calculated as (FD# / FD_Len) * FD_Freq.
XFrequency Analysis Value on X-axis
YFrequency Analysis Value on Y-axis
ZFrequency Analysis Value on Z-axis
LabelAdditional Info NameSee table below
InfoAdditional InfoSee table below

Additional Information

Info NameDescription
ModuleSIDSerial number of the sender
Tick[ms]System time when the log file was opened
(Note: TWELITE STAGE app side)
DateDate when the log file was opened
TimeTime when the log file was opened
Time_Msec_partSub-second part of time when the log file was opened [ms]
SamplesValid sample data
FD_LenFrequency analysis sample count
FD_Start#Frequency analysis start sample number
FD_FreqEstimated frequency range for frequency analysis [Hz]
(Note: estimated from sample reception interval)

Log Output (Auto Save)

When the Accelerometer Real-Time Graph screen is opened and data is input, log files are automatically saved.

Log file name is log folder/accel_{serial number}_{timestamp}.csv.

LabelItem NameDescription
#Sample
Number
T_PKT[ms]Packet
Reception Time
Multiple samples may be included in one packet, so samples with the same timestamp are listed.
SEQPacket
Sequence Number
Assigned to each packet; continuity indicates no packet loss.
T_SMPL[ms]Sample
Time (Virtual/Estimated)
Timestamp generated for each sample from packet reception time.
Does not match the actual sampling time.
(Note: Sample rate is estimated from packet reception intervals, and sample times are cumulatively added, so timestamps are delayed by one packet interval compared to actual sample time)
X[G]X-axis Sample ValueUnit is G. Based on sensor values.
Y[G]Y-axis Sample ValueUnit is G. Based on sensor values.
Z[G]Z-axis Sample ValueUnit is G. Based on sensor values.
LabelAdditional Info NameSee table below
InfoAdditional InfoSee table below

Additional Information

Info NameDescription
ModuleSIDSerial number of the sender
Tick[ms]System time when the log file was opened
(Note: TWELITE STAGE app side)
DateDate when the log file was opened
TimeTime when the log file was opened
Time_Msec_partSub-second part of time when the log file was opened [ms]

2.2.2.1.3.2 - Sensor Graph

Operation instructions for the Sensor Graph screen

Windows   macOS   Linux   RasPi

Example of data display

Example of data display

Overview

Various sensor data are recorded in an SQLite database and displayed on the screen in graph format. The database file can also be accessed by external applications.

  • The database uses SQLite (sqlite3) and is stored in the file {MW_STAGE Install}/log/{executable_name}_WSns.sqlite.
  • Screen navigation is [List (with graph preview)] > [24-hour Data] > [Live View].
    • From [24-hour Data], you can further navigate to [Year], [Month], and [Day (with graph preview)] selection screens.
  • About the [Live] display screen:
    • Select a specific node from the list.
    • Displays real-time data every second, showing data from the past 450 seconds.
  • About the [24-hour Data] display screen:
    • Displays data for a specific day.
    • Updates every second; if multiple data points occur during that time, some are thinned out.
    • Except at maximum zoom (1 pixel = 1 second), the average value for the data within each pixel range is displayed.
    • If values exceed the screen, measurement points are shown at the top or bottom edges.
    • If the current time is included, the display updates with new data.
    • Mouse wheel or cursor keys and : zoom in/out on the time axis.
    • Moving the mouse pointer: briefly displays the data corresponding to the time under the pointer.
      • Cursor keys and : move to the adjacent data point.
    • Mouse click & drag: scroll (only when zoomed).
    • When zoomed, scrollbar operation is also possible.
    • The [CSV Export] function outputs all data in the database.

Operations

OperationDescription
Mouse drag
(graph area)
Move the displayed sample position when zoomed.
Mouse drag
(bottom scrollbar)
Move the displayed sample position.
Cursor keys
Move the sample display area.
Cursor keys
Zoom in/out on the sample horizontal axis.
[Live]Switch to the view displaying the latest data updated every second.
[24-hour Data]Switch to the daily graph view.
[<<List]Switch to the list selection screen.
[Year] [Month] [Day]Select a specific date by year, month, and day.
[Latest]Switch to today’s data.
[CSV Export]Export one day’s data to a CSV file.
In the list, [Display]Change the list display mode.
In the list, [Sort]Change the list sorting order.
In the list, [↑]Reverse the list sorting order.

Editing Sensor Node Notes (Supplementary Information)

v1.3.9+

In the “24-hour Data” screen, left-clicking on the sensor node’s note area at the top right of the screen allows you to edit the note using a prompt.

Editing sensor node notes

Editing sensor node notes (IME enabled)

KeyDescription
Normal half-width charactersIf you directly enter normal half-width alphanumeric characters, they are displayed on the screen.
Input via IMEInput from IME is displayed as intermediate characters at the top left of the screen.
Press ENTER to confirm the input string.
BSDeletes the last character displayed.
ENTERReflects the entered string in the database.

Screen Navigation

The basic screens are divided into three types: List, 24-hour, and Live.

[List] <--> [24-hour] <--> [Live]
              ↓↑
          [Year/Month/Day Selection]

Starting Sensor Graph Mode on Launch

Specify 32 in [STAGE Common Settings → Launch App Specification].

About the Database Tables

sensor_data

Stores received data.

Column NameTypeDescription
_uqidINTEGERSequential number used in the database
sidINTEGER
int32_t
Serial number stored as int32_t type.
For example, a serial number “8123abcd” is stored as the integer value -2,128,368,691.
tsINTEGER
int64_t
Timestamp when the system received the packet, stored as int64_t.
UNIX epoch (seconds since 1970).
ts_msecINTEGERMilliseconds part of the timestamp.
yearINTEGERYear part of the local time from the timestamp.
monthINTEGERMonth part of the local time from the timestamp.
dayINTEGERDay part of the local time from the timestamp.
hourINTEGERHour part of the local time from the timestamp.
lidINTEGERIdentifier such as LID assigned by the user.
lqiINTEGERLink Quality Indicator, an estimate of reception strength.
pkt_seqINTEGERPacket sequence number. The range of values depends on the firmware.
pkt_typeINTEGERType of wireless packet.
2 PAL AMB 6 ARIA 1 PAL MAG *3 PAL MOT 5 CUE 0x101 App_Twelite *0x103 App_IO
*Currently unsupported types
valueREALMeasured value (definition varies by packet type).
pkt_type->
2,6: Temperature [°C]
1: Magnet detection (00->No magnet, 01->N pole, 02->S pole)
3,5: X-axis acceleration (average if multiple samples in packet) [G]
0x101,103: Input IO bitmap (same as lower 8 bits of val_dio)
value1REALMeasured value (definition varies by packet type).
pkt_type->
2,6: Humidity [%]
1: Unused
3,5: Y-axis acceleration (average if multiple samples in packet) [G]
0x101: ADC1 [V]
103: Unused
value2REALMeasured value (definition varies by packet type).
pkt_type->
2: Illuminance [lx]
6: Unused
1: Unused
3,5: Z-axis acceleration (average if multiple samples in packet) [G]
0x101: ADC2 [V]
103: Unused
value3REALMeasured value (definition varies by packet type).
pkt_type->
2: Unused
6: Unused
1: Unused
3,5: Unused
0x101: ADC3 [V]
103: Unused
val_vcc_mvINTEGERPower supply voltage [mV]
val_dioINTEGER
int32_t
b0..b7: Values of DI1..DI8 (1 is LOW, 0 is HIGH level)
b24..b25: Magnet value (if b28 is 1): 00->No magnet, 01->N pole, 10->S pole
b28: If 1, magnet data is stored in b24..b25
b31: Periodic transmission bit (magnet only)
val_adc1_mvINTEGERADC1 measurement value for pkt_type->
1,2,3,0x101
val_adc2_mvINTEGERADC4 measurement value for pkt_type->
0x101
val_auxINTEGERFor storing other data
ev_srcINTEGEREvent source
ev_idINTEGEREvent ID
pal_type->
5: Dice (1...6)
16→MOVE etc.Refer to documentation
ev_paramINTEGEREvent parameter

sensor_node

Stores text notes (supplementary information) for sensor nodes.

Column NameTypeDescription
sidINTEGERSID as described above
sid_textTEXTString representation of SID converted to hexadecimal for readability
descTEXT
UTF-8
Note (supplementary information) corresponding to the SID, displayed in lists, etc.

sensor_last

Manages the timestamp of the last received data.

Column NameTypeDescription
sidINTEGERSID as described above
tsINTEGERTimestamp of the last reception
lidExcerpt of data from the last reception below
lqi
pkt_type
value
value1
value2
value3
val_vcc_mv
val_dio
ev_id

2.2.2.1.4 - Simple Monitor

Simple Monitor list
  • CUE Viewer: Interprets packets from TWELITE CUE and displays them simply
  • ARIA Viewer: Interprets packets from TWELITE ARIA and displays them simply
  • Glancer: A simple monitor supporting many formats of TWELITE

2.2.2.1.4.1 - CUE Viewer

Operation instructions for the CUE Viewer screen

Windows   macOS   Linux   RasPi

Example of Dice Face Detection

Example of Dice Face Detection

Overview

Interprets and displays messages received from TWELITE CUE.

Operation of TWELITE CUE

The factory default setting of TWELITE CUE is configured to CUE mode.

In CUE mode, it operates intermittently to enable coin cell battery operation, waking from sleep due to several factors and transmitting various data.

Wake-up Factors

TWELITE CUE requires one of the following factors to wake from sleep:

  • Wake-up by timer (periodic wake-up)
  • Wake-up by acceleration detection
  • Wake-up by magnetic sensor (when a magnet is detected nearby)

Types of Data Transmitted

TWELITE CUE sends the following data in packets:

  • Detection events (see below)
  • Module power voltage
  • Magnetic sensor detection value
  • Acceleration data

Packet Attributes

The attributes of received packets provide basic information.

AttributeDescription
#????The count of received packets so far.
TypePacket type as the value of E_PKT in the mwm5 library.
Packets from TWELITE CUE are usually PKT_PAL=02.
IDLogical ID of the sender, usually a value from 0..100.
ADSerial number of the sender.
LQApproximate reception strength (Link Quality Indicator).
SQSequence number of the packet.

Events

In CUE mode, acceleration events are always output. Regardless of the wake-up factor, a fixed number of acceleration samples are measured after waking. Events are determined based on the acceleration measurement results.

EventNumberDescription
Dice1(0x00) .. 6(0x06)Determined based on periodic wake-up and magnetic sensor wake-up.
If a large acceleration is detected after waking,
an undetermined event (0xFF) may be detected.
Move16(0x10)Occurs when the acceleration sensor detects acceleration above a threshold,
resulting in a move or shake event.
Move occurs when the measured acceleration change is relatively small,
(acceleration change detected but no continuous acceleration change).
Shake0x08Occurs when the acceleration sensor detects acceleration above a threshold,
resulting in a move or shake event.
Shake occurs when the measured acceleration change is relatively large,
(continuous acceleration changes detected).

Voltage

Power supply voltage of the module [mV].

Magnet

Displays the detected magnetic pole or no detection.

Acceleration

Displays acceleration measured after waking.

  • Samples: Displays the number of acceleration samples, fixed at 10 samples.
  • Rate ID: Sample rate of acceleration, fixed at 04 (100Hz).
  • X, Y, Z: Acceleration on three axes. Calculated as the average of 8 samples. Unit is milli-G (1000mG = 1G = 9.8m/s²).

Example Screens

Example of Move Event Detection

Example of Move Event Detection

Example of Shake Event Detection

Example of Shake Event Detection

2.2.2.1.4.2 - ARIA Viewer

Operation instructions for the ARIA Viewer screen

Windows   macOS   Linux   RasPi

Example display of temperature and humidity data table

Example display of temperature and humidity data table

Overview

Interprets and displays messages received from TWELITE ARIA.

Operation of TWELITE ARIA

The factory default setting of TWELITE ARIA is TWELITE ARIA mode.

In TWELITE ARIA mode, it operates intermittently to allow coin battery power, waking from sleep due to several factors, and sending various data.

Wake-up Factors

TWELITE ARIA requires one of the following factors to wake from sleep:

  • Wake-up by timer (periodic wake-up)
  • Wake-up by magnetic sensor (when a magnet is detected nearby)

Types of Data Sent

TWELITE ARIA sends the following data packed in a packet:

  • Module power supply voltage
  • Magnetic sensor detection value
  • Temperature and humidity data

Packet Attributes

Basic information can be obtained from the attributes of the received packet.

AttributeDescription
#????Number of packets received so far.
TypePacket type based on the E_PKT value in the mwm5 library.
Packets from TWELITE ARIA are usually PKT_PAL=02.
IDLogical ID of the sender. Usually a value between 0..100.
ADSerial number of the sender.
LQApproximate received signal strength (Link Quality Indicator).
SQPacket sequence number.

Temperature and Humidity Data Table

Displays the history of the last 9 data packets received from TWELITE ARIA. The latest data is displayed at the top.

Time [s]

Time [seconds] from when the TWELITE STAGE APP started until the data was received.

ID

Logical device ID of the module.

VCC (mV)

Power supply voltage of the module [mV].

Temperature (°C)

Temperature measured by the module (°C).

Humidity (%)

Humidity measured by the module (%).

Magnet

Displays the detected magnetic pole or no detection.

2.2.2.1.4.3 - Glancer

Operation instructions for the Glancer screen

Windows   macOS   Linux   RasPi

Overview

Glancer provides a simplified display of the information contained in received messages.

By programming the connected TWELITE with App_Wings, it can display information received from communication partners’ TWELITE devices (App_Twelite, TWELITE PAL, … as long as the application ID and frequency channel match, mixed operation is possible).

Operation

Use by switching between the list display screen and the selection display screen.

List Display

Example of list display

Example of list display

Lists information from communication partners.

Displayed content includes message type, logical device ID, serial ID, LQI (Lq), power voltage (if included in the information), and timestamp.

OperationDescription
[ A ]Move to the previous item in the list.
[ A ]
Long press
Exit this screen and return to the previous menu.
[ B ]Switch to selection display.
[ B ]
Long press
Sort items.
The sort key changes sequentially each time sorting is performed.
[ C ]Move to the next item in the list.
[ C ]
Long press
Control the TWELITE reset pin and reset it.
ESCExit this screen.

Selection Display

Example of selection display

Example of selection display

By moving items and highlighting one in the list display, then performing a selection operation, you transition to this screen. It shows information related to a specific communication partner in order of arrival.

The number of received packets and the average LQI since selection are displayed.

OperationDescription
[ A ]No assignment
[ A ]
Long press
Exit this screen and return to the previous menu.
[ B ]No assignment
[ B ]
Long press
No assignment
[ C ]No assignment
[ C ]
Long press
Control the TWELITE reset pin and reset it.
ESCReturn to the list display screen.

2.2.2.1.5 - Commander

Operation instructions for the Commander screen

Windows   macOS   Linux   RasPi

Overview

Commander is a feature to send serial messages to TWELITE.

Operation

The first screen of the Commander displays important notes.

At the top of the screen, there are tabs represented by text, which you can navigate by clicking with the mouse to switch between tab screens.

OperationDescription
[ A ]Move tab (left)
[ A ]
Long press
Exit this screen and return to the selection screen.
[ B ]No assignment
[ B ]
Long press
No assignment
[ C ]Move tab (right)
[ C ]
Long press
Control the reset pin of TWELITE to reset it.
ESCExit this screen and return to the selection screen.

Tab: TWELITE

This screen generates and sends the 0x80 command of the Standard App (App_Twelite).

Make sure the connected TWELITE has App_Twelite or parent/relay app (App_Wings) programmed, and after setting the application ID and channel, confirm that messages are being received from the communication partner.

Example display of the TWELITE tab

Example display of the TWELITE tab

ItemDescription
DestinationSpecify the TWELITE to send to.
If you are a child device, specify “Parent:0”.
If you are a parent device, specify “All children = 0x78” or a specific child ID (can be specified from 1 to 8).
DI1..DI4Settings state from DI1 to DI4.
■ means selected (LOW = GND level), □ means (HIGH = VCC level).
Please specify SEL in the next item.
SELSelection bits for each DI.
(If 0, the DI specification is ignored; if 1, the specification is enabled.)
PWM1..4Set the PWM duty ratio.
0 corresponds to GND level, 1024 (100%) corresponds to VCC level.
PWM ports set to N.A. will not be changed.
(Note: On the MW-STA-KIT-0/MW-STA-SOLO-0 boards, PWM1 is pulled up to VCC, so the LED lights brightest at 0 and turns off at 100%.)

Tab: NOTICE

This screen generates the LED control command of the Notification PAL (NOTICE PAL).

Make sure the connected TWELITE has App_Wings programmed, and after setting the application ID and channel, confirm that messages are being received from the communication partner.

Example display of the NOTICE tab

Example display of the NOTICE tab

ItemDescription
DestinationSpecify the ID of the TWELITE PAL to send to.
Valid range is 1 to 8.
ColorSpecify the lighting color from 7 colors.
There are two types of white: one is RGB mixed color, and the other is a single white LED lit.
BrightnessSpecify from 0 to 15. 0 means off.
Lighting/BlinkingSelect lighting or blinking pattern.
Lighting TimeAutomatically turns off after a certain time has passed since the command was issued.
Turn off (x)Generate a turn-off message to turn off the LED.
Turn on (SPACE)Send the current settings to turn on the LED.

Display at the bottom of the screen

At the bottom of the screen, the timestamp when the command was generated and the command starting with : are displayed. The clipboard copies the contents of this screen.

2.2.2.2 - Write App Firmware

About the firmware writing function

Windows   macOS   Linux   RasPi

The firmware writing function allows you to write the TWELITE app (firmware).

  • Write pre-built .BIN files
  • Build from source files such as act and write

It eliminates the hassle of building source files, terminal disconnection, launching the writing utility, and terminal connection.

  • Automatically recognize TWELITE
  • After writing is complete, reset and then transition to interactive mode or terminal
  • From the list of projects, launch the project folder or environments like VSCode (except Raspberry Pi version)
  • From the list of projects, open related information web pages (except Linux and Raspberry Pi versions)

2.2.2.2.1 - Select from BIN

Operation instructions for the Select from BIN screen

Windows   macOS   Linux   RasPi

Overview

You can write pre-built applications ( .BIN files ).

Example of the Select from BIN screen

Example of the Select from BIN screen

When you select the menu, a list of .BIN files will be displayed. Please select the firmware to write.

If you want to use a file other than the pre-prepared .BIN files, please store the file to be written in the following location before selecting the menu.

PlatformLocation
Windows, macOS, Linux, Raspberry Pi{MWSTAGE folder}/BIN

In the BIN folder, please store .BIN files built with TWELITE STAGE without renaming the files (they are stored under the build folder of each project).

../BIN/App_Wings_MONOSTICK_BLUE_L1304_V1-1-3.bin
       App_Wings_MONOSTICK_RED_L1304_V1-1-3.bin
       App_Twelite_BLUE_L1304_V1-9-1.bin
       App_Twelite_RED_L1304_V1-9-1.bin
       ...

2.2.2.2.2 - act Build & Write

Operation instructions for the act build & write screen

Windows   macOS   Linux   RasPi

Overview

You can build and rewrite acts (act) written with the MWX library.

Example of sample act selection screen

Example of sample act selection screen

This screen displays a list of projects using acts placed in the following path.

{MWSTAGE installation folder}/MWSTAGE/Act_samples

Operation

You can build and write by selecting the project to write from the list.

After writing is finished, pressing ENTER or the [ B ] button will reset the TWELITE and transition to the interactive mode screen (or terminal screen, depending on settings).

Build and Write Screen

OperationDescription
[ A ]Menu selection up
[ A ]
Long press
Exit this screen and return to the selection screen.
[ B ]Select
[ B ]
Long press
Open related website in the OS default browser.
(If registered in 000desc.txt in the project folder)
[ C ]Menu selection down
[ C ]
Long press
Open folder (project or related folder).
You can set it to open with VS Code in the settings menu.
ESCExit this screen and return to the app rewrite menu.
Mouse click [Help]Open related website.
Mouse click [Folder] or [VSCode]Open related folder.
Mouse click [▽] or [△]Move to next page or previous page.

2.2.2.2.3 - TWELITE APPS Build & Write

Instructions for operating the TWELITE APPS Build & Write screen

Windows   macOS   Linux   RasPi

Overview

You can build and write TWELITE APPS written with the TWENET C library.

Example of the app selection screen

Example of the app selection screen

This screen displays a list of projects located in the following path:

{MWSTAGE installation folder}/MWSTAGE/Wks_TweApps

Operation

By selecting the project to write from the list, you can perform build and write operations.

After writing is completed, pressing ENTER or the [ B ] button will reset the TWELITE and transition to the interactive mode screen (or terminal screen, depending on settings).

Build and Write Screen

OperationDescription
[ A ]Menu selection up
[ A ]
Long press
Exit this screen and return to the selection screen.
[ B ]Select
[ B ]
Long press
Open the related website in the OS default browser.
(If registered in the project folder’s 000desc.txt)
[ C ]Menu selection down
[ C ]
Long press
Open folders (project, related folders).
You can set to open with VS Code in the settings menu.
ESCExit this screen and return to the App Write menu.
Mouse click [Help]Open the related website.
Mouse click [Folder] or [VSCode]Open the related folder.
Mouse click [▽] or [△]Move to the next or previous page.

2.2.2.2.4 - Act_extras

Operation instructions for the Act_extras screen

Windows   macOS   Linux   RasPi

Overview

You can build and rewrite acts written with the MWX library.

Example of the act selection screen

Example of the act selection screen

This screen displays a list of projects using acts placed in the following path:

{MWSTAGE installation folder}/MWSTAGE/Act_extras

Operation

By selecting a project to write from the list, you can perform build and write operations.

After writing is complete, pressing ENTER or the [ B ] button will reset the TWELITE and transition to the interactive mode screen (or terminal screen, depending on settings).

Build and write screen

OperationDescription
[ A ]Menu selection up
[ A ]
Long press
Exit this screen and return to the selection screen.
[ B ]Select
[ B ]
Long press
Open the related website in the OS default browser.
(If registered in the project folder’s 000desc.txt)
[ C ]Menu selection down
[ C ]
Long press
Open the folder (project or related folder).
You can set it to open with VS Code in the settings menu.
ESCExit this screen and return to the app rewrite menu.
Mouse click [Help]Open the related website.
Mouse click [Folder] or [VSCode]Open the related folder.
Mouse click [▽] or [△]Move to the next or previous page.

2.2.2.2.5 - Folder (Specify)

Write a specified firmware

Windows   macOS   Linux  

By dragging and dropping a folder or .BIN file onto the TWELITE STAGE APP screen, you can write a specific project. Select the dropped target when performing build or write operations.

2.2.2.2.6 - Last (Re-execute)

Re-execute writing the most recently written firmware

Windows   macOS   Linux   RasPi  

Re-select the most recently rewritten or specified project.

2.2.2.2.7 - Build & Write Screen

Operation instructions for the build & write screen

Windows   macOS   Linux   RasPi  

This section provides operation instructions for the screen displayed when building or writing a project.

During Build

This is the screen during the build (compile) process. The contents of the build command are output to the console screen. The ... in the middle of the screen indicates the number of files built, and the dark-colored display at the bottom shows the filenames currently being built.

Example of the screen during compilation

Example of the screen during compilation

Build Error

If a build error occurs, a screen like the one above is displayed. You can execute a rebuild or display the error log. Also, after a certain timeout, it will return to the previous menu.

Example of error display screen

Example of error display screen

Only representative error messages are displayed on the screen. When the build fails, there may be cases where the error message is not displayed.

OperationDescription
[ A ]No assignment
[ A ]
Long press
Exit this screen and return to the previous menu.
[ B ]Rebuild on error.
[ B ]
Long press
No assignment
[ C ]
[ C ]
Long press
Display the error log (Windows/macOS).
The save location is {project folder}/build/builderr.log.
ESCExit this screen and return to the write menu.
ENTERRebuild on error.

During Write

When the build succeeds, the screen to write the firmware is displayed.

Example of write-in-progress screen

Example of write-in-progress screen

Write Failure

If writing results in an error, a screen like the one below is displayed.

Example of write failure screen

Example of write failure screen

OperationDescription
[ A ]
Long press
Exit this screen and return to the selection screen.
[ B ]Rewrite again
(Returns to the previous write menu.
Since the menu item is automatically selected,
pressing [ B ] again will rewrite.)
ESCExit this screen and return to the write menu.

Write Complete

When writing completes successfully, a screen like the one below is displayed.

Example of write completion screen

Example of write completion screen

OperationDescription
[ A ]
Long press
Exit this screen and return to the selection screen.
[ B ]Reset the TWELITE and move to the interactive mode screen (or terminal screen depending on settings).
ESCExit this screen and return to the write menu.

2.2.2.3 - Interactive Settings Mode

Using Interactive Settings Mode

Windows   macOS   Linux   RasPi

Overview

From this screen, you can use the interactive mode of the connected TWELITE.

Example of the Interactive Mode screen

Example of the Interactive Mode screen

This screen behaves almost the same as a terminal, but adds functions specific to interactive mode, such as operations to transition to interactive mode and detection of exit from it.

  • The connected TWELITE must have firmware compatible with interactive mode pre-installed.
  • Since TWELITE input/output is used, if garbled characters occur in serial communication, transitions to and exits from interactive mode may not work as expected.
  • Mouse operations are not supported. Please use keyboard operations (cursor keys are usable).

Interactive Mode Screen Operation Flow

Below is an outline of the process flow.

[Set screen background to black]
  ↓
[Reset TWELITE (if controllable, SET=LO)]
  ↓
 --YES--> [Operation screen]
  ↓timeout
[Input '+' three times]
  ↓
 --YES--> [Operation screen]
  ↓timeout
[Operation screen] ※ This state is not interactive mode

[Operation screen]
  ↓
 --> [Exit]
  ↓
 --> [Exit]
  ↓
 ->  --NO-> [Exit]
  ↓            ↓
[Send input string to TWELITE]
  ↓
[Return to operation screen]

[Exit]
  ↓
[Reset TWELITE]
  ↓
[Exit screen] Exit the interactive mode screen and return to the previous screen

2.2.2.4 - Settings of TWELITE STAGE

Settings for TWELITE STAGE APP

Windows   macOS   Linux   RasPi

Overview

From this screen, you can configure various settings of the TWELITE STAGE APP.

Example of the settings screen

Example of the settings screen

Some menu items explained below may not exist on certain platforms, but all are listed and explained.

Color settings other than the common menu are omitted from the explanation.

Root Menu

Common
 Terminal
 Standard App Viewer
 Graph Viewer (Acceleration Real-time/Sensors)
 Simple Monitor (CUA/ARIA/Glancer)
 Commander
 Write firmware
 Interactive Settings Mode
Save Data Utilities (Dump/Erase)
Information

Common Settings

a: (      0x00) Startup App Specification
G: (      0x00) Screen Size and Drawing Method
F: (          ) Serial Device ID
f: (0x00FFFFFF) Foreground (Text) Color
b: (0x005A0032) Background Color
B: (    115200) Baud Rate
SettingDescription
Startup App SpecificationThis setting determines which viewer app to switch to when TWELITE STAGE starts.
The setting value is 1..{the number listed in the viewer app menu}.
Note: If the serial device ID is not set,
the startup will wait for input on the serial device selection screen.
Screen Size and Drawing Method(Except for M5Stack version) Specified by two characters XY (X: screen size, Y: drawing method).
X 0:640x480 1:1280x720 2:1280x960 3:1920x1440 4:2560x1440 5:320x240
Y 0:LCD style 1:CRT style 2:Blur 3:Block
Serial Device ID(Except for M5Stack version) Set by serial device name or a number 1..9.
Note: The number indicates the device enumeration order.
Text Color / Background ColorSpecify text and background colors.
The common settings color values are inherited by other screens’ settings.
If not set on other screens, the common settings colors are used.
Colors are specified as 24-bit RGB hexadecimal values but are internally rounded to 16-bit 565 format.
Baud RateSet to avoid garbled display in terminals etc. when the TWELITE baud rate is not 115200.

Write Firmware

f: (0x00FFFFFF) Foreground (Text) Color
b: (0x005A0032) Background Color
j: (         0) Number of make jobs at build time
v: (         0) Open a folder with VSCode
l: (         0) Disable LTO
n: (         0) Screen after rewriting is completed
SettingDescription
Number of make jobs at build time(Except for M5Stack version) Number of parallel jobs during build to shorten build time.
Default 0 calculates jobs as (physical processor count - 1).
A guideline is to set up to the number of logical processors.
Open a folder with VSCode(Requires VSCode installation) Setting 1 opens folders using the code command (VSCode) instead of the OS standard folder window.
The executable TWELITE_Stage_VSCode defaults to 1.
Screen after rewriting is completed(Except for M5Stack version) Setting 1 opens the terminal instead of the interactive mode screen.
Setting 2 returns to the rewrite menu.
TWELITE_Stage_VSCode sets this to 2.
Disable LTO(Windows only) Setting 1 disables LTO in the Windows compiler.
LTO produces smaller binaries but takes longer to link.
Disabling LTO results in faster linking.

Save Data Utilities

r: Read sector.
R: Read ALL sectors.
e: Erase sector.
E: Erase ALL sectors.

This screen is a utility for maintaining data save areas. It emulates EEPROM (64 bytes per sector, up to 60 sectors, 3840 bytes).

SettingDescription
rReads a sector.
Input 0..59 to display the contents of the specified sector.
RInput YES to read all sectors, but only the tail part is displayed.
eErases a sector (0xFF).
Input 0..59 to erase the specified sector.
EInput YES to erase all sectors.

2.2.2.5 - Select SERIAL port

Select SERIAL port menu

Windows   macOS   Linux   RasPi

Overview

On this screen, you can (re)select the serial port.

Example of the serial port selection screen

Example of the serial port selection screen

2.3 - Logging Function

Logging function between TWELITE and PC

Windows   macOS   Linux   RasPi

You can record serial communication logs between TWELITE and PC.

Operation

Start Recording

Press Alt(Cmd)+L.

Example of the log start screen

Example of the log start screen

Stop Recording

While recording, press Alt(Cmd)+L again.

Example of the log stop screen

Example of the log stop screen

The log recording will stop, and the log file at that point will be opened using the OS default application (Notepad on Windows, Console.app on macOS).

Specifications

Log Recording

Strings received from TWELITE are recorded as-is.

Strings sent to TWELITE are recorded one character at a time. On Windows, they are enclosed in 「 」, and on macOS / Linux / Raspberry Pi, they are enclosed in « ». For example, «t» means that the character t was input from the keyboard.

Log Folder and File Name

Logs are saved in the {folder where the TWELITE STAGE APP executable is located}/log folder, with a file name based on the start date and time of the logging.

Press Alt(Cmd)+Shift+L to open that folder.

Example of the log output folder

Example of the log output folder

3 - Detailed Specifications

Detailed specifications of TWELITE STAGE APP

3.1 - Detailed Settings with Command-line Arguments and ini Files

Detailed settings for TWELITE STAGE APP using command-line arguments and ini files

Command-line Arguments

Command-line arguments configure some detailed settings of the TWELITE STAGE APP.

Command-line ArgumentDescription
-E 0Disables graphical effects such as fade-out.
-R {type}Sets the rendering type with the {type} value.
0: Default
1: OpenGL
2: DirectX (Windows) Metal (macOS)
3: Software
-JEnables the game controller.
-x {x_pos},
-y {y_pos}
Sets the position of the TWELITE STAGE App graphical window at startup.
{x_pos} and {y_pos} are the screen coordinates of the top-left corner of the window.

ini Files

ini files are used to configure basic settings of the TWELITE STAGE APP (such as referencing the MWSDK folder).

The ini file name is {base name of the TWELITE STAGE APP executable} + .ini. Usually, it is TWELITE_Stage.ini.

;;; Change the MWSDK reference.
; MWSDK=MWSDK
mwsdk=mwsdk2020_10

;;; Interface language
; LANG=en

;;; Window geometry
GEOM_X=200
GEOM_Y=100

Syntax

  • ini files are written as plain text files.
  • Keys and values are stored on a single line separated by = (e.g., KEY=value).
  • The key and value strings start at the beginning of the line (no spaces or other characters allowed before the key).
  • Spaces are not allowed between the key and the value.
  • Comment lines start with ; or # at the beginning of the line.

Settings

KeyValue
MWSDKChanges the MWSDK folder. The default folder is MWSDK located in the same folder as the TWELITE STAGE APP executable. If you need to use an older or custom MWSDK, you can specify the folder name here.
LANGLANG=en changes the user interface language from the default (Japanese) to English. This setting is carried over to the make parameter (TWE_LANG_PREF) and is reflected in the interactive mode display language setting of some firmware (apps) such as TWELITE_Apps.
GEOM_X, GEOM_YChanges the location where the TWELITE STAGE App window appears.

Running TWELITE STAGE APP with Different Settings

If you need different settings for the TWELITE STAGE APP, copy the executable to the same folder as the TWELITE STAGE APP and create an .ini file with the same name.

For example, to use the English interface, copy TWELITE_Stage.exe (note: .exe is the Windows executable extension) to TWELITE_Stage_en.exe and write the setting LANG=en in TWELITE_Stage_en.ini to create an executable with the English interface enabled.

  TWELITE_Stage.exe
  TWELITE_Stage.ini | No special settings

  TWELITE_Stage_ja.exe | Copy of TWELITE_Stage.exe
  TWELITE_Stage_en.ini | LANG=en is set.

3.2 - Environment Variables

Environment variables used by TWELITE STAGE APP

Environment Variables Set Internally

Environment VariableDescription
MWSDK_ROOTBy default, the MWSDK folder located in the folder where the TWELITE STAGE APP executable is stored (that is, ../MWSTAGE/MWSDK) is specified. If MWSDK.ini is specified, the specified folder name is adopted.
MWSDK_TWENET_LIBSRCFor sample code and TWELITE APPS source code folders, definition files for Microsoft Visual Studio Code (VS Code) are pre-created. In these definition files, the library source code reference path is specified for code interpretation within the VS Code editor, and this environment variable is used for that purpose.
If the MWSDK_TWENET_LIBSRC environment variable is properly set, code interpretation will work even in project folders outside of MWSDK, enabling features such as function name completion for the library. (Reference)
LANG=CExplicitly set to make the toolchain messages appear in the default language (English).
PATHOn Windows, adds the PATH to the SDK-included msys utilities.
MWSDK_MAKE_JOBS
MWSDK_MAKE_DISABLE_LTO
MWSDK_MAKE_LANG_PREF
Used in VS Code configuration definitions.
JOBS: Passes the number of parallel builds set in STAGE APP
DISABLE_LTO: Disables LTO ( Windows )
LANG_PREF: The display language (JP: Japanese, EN: English) of the TWELITE STAGE APP is set.This setting is also inherited by the parameter (TWE_LANG_PREF) of make at build time.

Reference

Excerpt from .vscode/settings.json configuration example:

    "C_Cpp.default.includePath": [
        "${env:MWSDK_TWENET_LIBSRC}/include/**",
        "${env:MWSDK_TWENET_LIBSRC}/src/**"
    ],
    "C_Cpp.default.browse.path": [
        "${env:MWSDK_TWENET_LIBSRC}/include/**",
        "${env:MWSDK_TWENET_LIBSRC}/src/**"
    ],

Definitions starting with "../../" are unnecessary when opening a project from the TWELITE STAGE app. These specify source reference paths in the default folder structure when the environment variable MWSDK_TWENET_LIBSRC is not set.

3.3 - Adding Project Descriptions with 000desc.txt

How to add project descriptions using 000desc.txt

When you create a 000desc.txt file in the project folder, TWELITE STAGE APP displays its contents in the project folder list.

Example display of 000desc.txt

Example display of 000desc.txt

The file should be written as plain text in UTF-8 format. There are two formats as follows.

Format 1

LED lights up when the switch is pressed
act4 operates an act that lights up the LED when the switch connected to TWELITE DIP is pressed.
https://mono-wireless.com/jp/products/act/index.html
  • The first line is the title line.
  • The following lines describe details.
  • If the last line starts with http, it becomes a link to a website.

Format 2

[JAPANESE]
TITLE=act template
DESC=This file contains only empty setup() and loop() functions.
Please use it to write a new act.
URL=jp/MWX/content/Act_samples/README.html
[ENGLISH]
TITLE=act empty template
DESC=This act file only contains empty setup() and loop(),
which is intended to write a new act.
URL=en/MWX/content/Act_samples/README.html

This format is like an ini file. The item name starting from the beginning of the line and the = character define the item, and the content after = is the item’s content.

Item DefinitionDetails
[JAPANESE], [ENGLISH]Block separators
TITLE=Title line
DESC=Description. Can include multiple lines with line breaks.
URL=Link to a website or file

About URL specification

URL=Details
Starting with https:, http:Opens that address
OthersSpecify a relative folder based on {MWSDK_ROOT}/docs/.
If set as a/b/c.html, it is converted to {MWSDK_ROOT}/docs/a/b/c.html.

4 - License

About the license

The executable format of TWELITE_Stage distributed by Mono Wireless Inc. is subject to MW-SLA-1J,1E.

Open Source Components Used

We appreciate the open source projects that provided high-quality source code.

NameDescription
SDL2Simple DirectMedia Layer Copyright (C) 1997-2020 Sam Lantinga
getoptCopyright (c) 1987, 1993, 1994 The Regents of the University of California. All rights reserved.
regexregex - Regular expression pattern matching and replacement By: Ozan S. Yigit (oz) Dept. of Computer Science York University
printfCopyright (c) 2014 Marco Paland
Shinonome Font2001 The Electronic Font Open Laboratory http://openlab.ring.gr.jp/efont/
M+ BITMAP FONTSCopyright 2002-2005 COZ coz@users.sourceforge.jp
SQLiteC++Copyright (c) 2012-2021 Sebastien Rombauts (sebastien.rombauts@gmail.com)
sqlite3All of the code and documentation in SQLite has been dedicated to the public domain by the authors.

5 - Revision History

Revision history of TWELITE STAGE APP

Please refer to https://github.com/monowireless/mwm5 for the source code change history.

  • Depending on the platform, the latest version distributed and the latest version in the revision history may not match.
  • The latest version of the source code may not be registered at the above sites.

2.4.4 MWSTAGE2025_07 Release

Major Version Upgrade

  • Added support for TWELITE STICK
  • Enhanced serial port functionality
    • Added baud rate switching via ALT+B
    • Connection status now displayed in the title bar
  • Makefile error message handling
    • Extracts the message part ... from errors output in the format $(error <MWERRM>...</MWERRM>)
    • These error messages are intended to be used when attempting to build projects for unsupported architectures (e.g., GOLD only, or BLUE/RED only)
  • Support for language setting in interactive mode
    • Interactive mode language can now be specified at build time via TWE_LANG_PREF=(JP|EN)
    • When launching external tools (e.g., VSCode), the MWSDK_MAKE_LANG_PREF environment variable is now set

2.4.3

  • For projects with multiple configuration types located in subfolders (and not directly under the root build), folder listing is now limited to only those that contain a build/ directory, preventing unnecessary folders from being shown
  • Fixed a crash that occurred when error messages were too long during build errors
  • Changed the order of serial protocol checks for determining BLUE/RED/GOLD: now tries GOLD first (for GOLD-targeted SDK)

2.4.2

  • Added support for interactive mode transition control using the SET pin (CTS pin on MONOSTICK)
    • Behavior in TWELITE_Apps is as follows:
      • If SET pin is held for less than ~100ms → normal boot (prevents accidental interactive mode entry due to noise)
      • If held longer than the above → enter interactive mode on boot
      • If held for ~3 seconds or more → erase entire EEPROM on startup
      • Each app is informed of the interactive mode transition via a startup parameter
        • Apps receiving this parameter will, in principle:
          • Skip app-specific initialization
          • Skip interrupt handler setup, etc.
          • Automatically start interactive mode on UART0 at 115200 8N1
          • Suppress exit from interactive mode via +++
    • Under this spec, the STAGE app behaves as follows:
      • For regular transition to interactive mode, hold the SET pin for about 300ms
        • When holding [ C ] on the interactive mode guidance screen, SET pin is held for about 5 seconds
        • If Entering Interactive ... message is not received within timeout, fallback to trying +++ as per previous behavior
  • Additional code cleanup

2.4.1

  • Initial support for TWELITE GOLD
    • If a control command response from GOLD is received at startup, it’s recognized as GOLD; if it fails, control commands for the BLUE/RED series are attempted instead

1.3.8 MWSTAGE2022_08 Included Version

Major version upgrade.

  • Changed internal rendering resolution from 320x240 to 640x480 pixels
  • Added real-time graph for accelerometer sensor
  • Added sensor graph that saves sensor data and displays graphs
  • Supported English display
  • Changed main manuals to local HTML files

1.0.8 MWSTAGE2021_09 Included Version

  • There was a case where buttons [ A ] [ B ] [ C ] remained pressed even after the pointer moved away
  • STAGE APP sends CRLF to TWELITE when Enter is input
  • Updated Mac FTDI library to allow operation without serial intermediary program on Apple Silicon (M1)
  • Internally set PATH for msys toolset on Windows to prevent unexpected make calls
  • Allowed moving to the writing screen even if TWELITE is not connected (input B,R keys and specify the target TWELITE model)
  • When configured to use VSCode, selecting act or TweApps opens the writing screen for .bin files under build/ without building (build is done from VSCode)
  • Internally set several environment variables so that VSCode launched from TWELITE STAGE can refer to them, enabling proper builds and library resource referencing in VSCode
  • Sample code is stored under MWSDK folder, but dropping a folder for build target allows build and write operations for folders other than MWSDK (folder names must not contain spaces or Japanese characters)
  • Displayed internal folder settings and environment variable settings on the console screen at startup
  • Waited 1 second before exiting STAGE APP on termination

1.0.7pre2

  • Enhanced support for Raspberry Pi (1.0.7pre2)
    • Support for serial0 (TWELITE STAGE HAT)
    • Added build for Zero (build with supported libraries & disabled rendering fade feature)
    • Added build for X11 desktop
  • Made it usable with general FTDI devices (FT232, FT230). Firmware writing mode must be done manually
  • Added feature to display COM ports assigned in Windows by pressing c key on serial port selection screen
  • Allowed changing baud rate from 115200bps
  • Added command line option (-E 0) to disable rendering fade feature.

1.0.3 MWSTAGE2020_12 Included Version

  • Supported TWELITE CUE (parser and CUE viewer)
  • Enabled verification (comparison) during writing in the rewrite menu
  • Provisional support for Apple Silicon (TWELITE_Stage.command is a universal app; external command sersrv_ftdi.command and Tools are rebuilt Intel binaries runnable with Rosetta2; serial communication is slower due to external command)
  • Moved MWSTAGE/MWSDK/Tools to MWSTAGE/Tools (to allow direct use of MWSDK_COMMON repository)
  • TWELITE_Stage.ini (removes extension from startup filename and adds .ini) is loaded at startup to allow selecting MWSDK folder (makes it easy to switch old library sets)
  • Updated SDL2 library for screen rendering to 2.0.12 (Windows, MacOS, RaspberryPi)
  • Static build on Windows with no DLL files required
  • Set parallel build count for make -j to (number of physical CPUs - 1)
  • Explicitly reopened serial port in several places in rewrite menu to improve recovery when USB connection is disconnected due to device removal
  • When opening mwx or twesettings with Alt(Cmd)+Shift+m, t, opens folders listed in TWENET/usever.mk
  • Fixed issue where writing menu transition failed on first startup at /dev/serial0 on Raspberry Pi

Known Issues

  • Help message when pressing Alt(Cmd) at startup may not appear; can be shown by inputting Alt(Cmd)+0
  • Line wrapping may be broken when filenames are too long in rewrite menu
  • Apple Silicon operation has not been sufficiently tested

0.9.11 MWSTAGE2020_10, Raspberry Pi Version (Provisional)

(* This version is not comprehensively tested *)

  • Operation on Raspberry Pi
  • Other feature adjustments

0.9.9 - MWSTAGE2020_10 Included Version

  • Added [Web] button to the top-level menu to open related links in browser
  • Implemented folder, web, and VS Code open features for Linux version
  • Sometimes difficult to transition to writing menu when TWELITE frequently outputs UART

0.9.8a

https://github.com/monowireless/TWELITE_STAGE_Bin_M5Stack/releases/tag/0.9.8a

M5Stack version made dual-licensed for MW-SLA-1J,E / MW-OSSLA-1J,E and updated readme-j.txt.

0.9.8

Added [Web] button to viewer list to open related sites.

Revision Details

  • Added Commander to viewer
    • Standard app 0x80 command
    • NOTICE PAL LED control (send commands to App_Wings)
  • NOTICE PAL support for viewer > PAL viewer
  • Added menu for Act_extras
    • More advanced than Act_samples
    • Uses external open source libraries (e.g. sensor procedures)
  • Expanded mouse operation (lists, buttons, tabs)
    • Focus on mouse move, confirm with left click, right click inputs [ESC] key
  • Reduced screen rendering load
    • Disabled screensaver when app is in background
    • Reduced rendering frequency when app is in background to lower CPU load
  • Enhanced build project list (act, TWE_Apps, Act_extras)
    • Show summary at bottom when selecting items (reads 000desc.txt, processed by TWE_Desc class)
    • Ability to open project folder (or open in VSCode)
    • Ability to open related websites
    • Open mwx library with Alt+Shift+m and twesettings library with Alt+Shift+t
    • Open selected folder or build error files in build menu
  • Added logging (serial port input/output)
    • Start/stop log with (Alt/Cmd+L)
    • Log files saved in {folder containing TWELITE_Stage executable}/log
    • Filename format: twestage_{date-time}.log
    • Open log file folder with Shift+Alt/Cmd+L
  • Other changes and fixes
    • Changed display method for serial (FTDI) device names and IDs
    • Fixed issue where App_UART did not transition to interactive mode
    • Changed behavior on folder drop (previously sometimes triggered binary write, now transitions menu)
    • On terminal long press [C], clears screen in addition to reset

Known Issues

  • M5Stack may hang and reset settings to default when saving settings

0.8.9

2020_05 Release Version

  • Added window icon
  • Relaxed maximum list constraints on BIN file list screen (win/linux/mac)
  • Added Glancer viewer
  • Adjusted explanatory text
  • Adjusted console screen rendering
  • Fixed issue where setting destination screen after firmware write (interactive mode or terminal) did not work
  • Changed assignment of Alt(or Cmd)+W
  • Other bug fixes

0.8.6

Initial release of Linux version

0.8.5

Initial release