Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Get the latest version
TWELITE STAGE applications are distributed in the following ways
For Windows/Mac/Linux platforms, a complete set is distributed including development tools, etc.
If you have the latest TWELITE STAGE app update from TWELITE STAGE SDK in your update history, or if you want to distribute the M5Stack version, please see below. Please check the tag on GitHub for the distribution version.
The TWELITE STAGE app is intended to work with the latest version of the TWELITE STAGE SDK, which is distributed as a stable plate. Newer TWELITE STAGE apps may not work properly with older SDKs.
The Linux version is included in the package. Individual versions are not distributed. Please build from source code.
Raspberry Pi version is included in the package. Individual versions are not distributed. Please build from the source code.
Versions up to 1.0.3a are stored below.
The MWM5 library containing the source code for TWELITE STAGE is available at.
TWELITE STAGE App
Please refer to handling of materials. If you have any questions or concerns, we would appreciate it if you would contact our support office.
The image files (screen captures), may differ from the version used, and there may be differences in the strings displayed in the images, menu order, etc.
TWELITE STAGE APP is a tool to build/program TWELITE wireless microcontroller series apps and view the execution results.
Designed to work on a variety of platforms.
Windows 10
macOS (High Sierra and later)》(High Sierra and later)
Linux (Ubuntu18.04)
Raspberry Pi (Raspberry Pi 3 Model B, Lcd Touch Screen, Raspberry Pi OS August-2020)
Operating conditions, distribution format, and implemented functions differ depending on the platform.
.
The following pages are listed to indicate supported platforms.
Windows -- Windows 10
LICENSE
The executable of TWELITE™ Stage distributed by Monowireless, Inc. is subject to MW-SLA-1J,1E.
For source code, MW-OSSLA-1J,1E applies. Please refer to the link for an overview.
If you build from source code, you can operate with MW-OSSLA-1J,1E which has more relaxed restrictions for non-commercial purposes.
Some distribution packages (as of 2020/10/9, only the 0.8.9a package for M5Stack is available) apply a dual license with MW-SLA-1J,1E and MW-OSSLA-1J,1E. Please check the license description in the package.
Please note that you must select MW-SLA-1J,1E for commercial use.
We would like to thank the open source projects that provided us with high quality source code.
(M5stack : supported up to version 1.0, v1.3 and later are not supported at source level)
macOS -- Mac OS X, macOSLinux -- Linux (Ubuntu etc.})
RasPi -- RaspberryPi


Copyright 2002-2005 COZ
SQLiteC++
Copyright (c) 2012-2021 Sebastien Rombauts ([email protected])
sqlite3
All of the code and documentation in SQLite has been dedicated to the public domain by the authors.
SDL2
Simple DirectMedia Layer Copyright (C) 1997-2020 Sam Lantinga
getopt
Copyright (c) 1987, 1993, 1994The Regents of the University of California. All rights reserved.
regex
regex - Regular expression pattern matching and replacementBy: Ozan S. Yigit (oz) Dept. of Computer Science York University
printf
Copyright (c) 2014 Marco Paland
東雲フォント
2001 The Electronic Font Open Laboratoryhttp://openlab.ring.gr.jp/efont/
M+ BITMAP FONTS
revision history
For the revision history of the source code, please refer to https://mwm5.twelite.info/changes and https://github.com/monowireless/mwm5.
The latest version of the revision history may not match the distributed version for each platform.
Major version upgrade.
Changed internal drawing resolution from 320x240 to 640x480 pixels
Added real-time graphs for accelerometer
Added sensor graph to save and graph sensor data
Added support for English display
Changed main manual to local html file
[ A ] [ B ] [ C ] buttons sometimes remained out of pointer
CRLF is now sent to TWELITE on Enter input in STAGE APP.
updated FTDI library on Mac to work on Apple Silicon(M1) without using serial intermediary program.
Enhanced support for Raspberry Pi (1.0.7pre2)
Added serial0 support (TWELITE STAGE HAT)
Added build for Zero (disable build & draw fade function in supported libraries)
TWELITE CUE support (parser and CUE viewer)
Verify (compare) when writing in the rewrite menu.
Apple Silicon tentative support (TWELITE_Stage.command is universal app, external command sersrv_ftdi.command for serial processing, Tools rebuilds intel binary that can work with Rosetta2, serial communication is slower because it is via an external command)
Help message may not appear when Alt(Cmd) is pressed down at startup; it appears by typing Alt(Cmd)+0.
In the rewrite menu, when the file name is too long, the line may be disrupted.
We have not fully tested the operation on Apple Silicon.
(* This version is not comprehensively verified.)
Operation on Raspberry Pi
Other functional adjustments
Added [Web] button to the top level menu as well, so that the related links can be opened in the browser.
Implemented the function to open in Folder, Web and VS Code of Linux version.
It was sometimes difficult to transition to the write menu when the TWELITE radio module was frequently outputting UART.
TWELITE CUE support (parser and CUE viewer)
Verify (compare) when writing in the rewrite menu.
Apple Silicon tentative support (TWELITE_Stage.command is universal app, external command sersrv_ftdi.command for serial processing, Tools rebuilds intel binary that can work with Rosetta2, serial communication is slower because it is via an external command)
Help message may not appear when Alt(Cmd) is pressed down at startup; it appears by typing Alt(Cmd)+0.
In the rewrite menu, when the file name is too long, the line may be disrupted.
We have not fully tested the operation on Apple Silicon.
(* This version is not comprehensively verified.)
Operation on Raspberry Pi
Other functional adjustments
Added [Web] button to the top level menu as well, so that the related links can be opened in the browser.
Implemented the function to open in Folder, Web and VS Code of Linux version.
It was sometimes difficult to transition to the write menu when the TWELITE radio module was frequently outputting UART.
M5Stack version with MW-SLA-1J,E / MW-OSSLA-1J,E dual license and updated readme-j.txt.
Added `[Web]' button to viewer list view, added ability to open related sites, etc.
Added Viewer > Commander.
Standard App 0x80 command
NOTICE PAL LED control (send commands to App_Wings)
NOTICE PAL support in Viewer > PAL Viewer.
M5Stack may hang and initialize settings when saving settings.
2020_05 Release Version.
Added window icons.
Relaxed the restriction on the maximum number of listings in the BIN file list screen (win/linux/mac)
Added Glancer viewer
Adjusted explanation text, etc.
First Linux release
First release
TWELITE_Stage installation (Windows)
Windows
The following environment is used for development.
Windows 10 version 1903
VisualStudio 2019 (32bit build )
FTDI's FT232 series may require device driver installation to work; if MONOSTICK or TWELITE-R is not recognized, please install the D2XX driver from . Visual C++ Distributable Code for Visual Studio 2019 (runtime library) may be required. If you get an error when starting the application and it does not start, please redistribute it in this package TWELITE_Stage³_INSTALL³VC_redist.x86.exe or get it from Microsoft's website and install it. Distribution binaries are 32-bit.
Simple monitor
: Interpret packets from TWELITE CUE and display them in a simplified manner
: Interpret packets from TWELITE ARIA and display them in a simplified manner
: Simple monitor compatible with many kinds of TWELITE wireless packets
added setting the PATH of msys tools on Windows to prevent unexpected make from being invoked.
added support for moving to the write screen even when TWELITE is not connected (by entering B,R keys and specifying the target TWELITE model).
When VSCode is used, the screen for writing .bin files under build/ is opened instead of executing build when Act or TweApps is selected. (Build is performed from VSCode)
Set some environment variables internally and made VSCode started from TWELITE STAGE refer to these variables so that VSCode can execute appropriate builds and refer to appropriate library sources for VSCode's code interpretation
Sample code is stored under the MWSDK folder, but by dropping the build target folder, build and write operations can be performed in folders other than the MWSDK folder (folder names must not contain spaces, Japanese characters, etc.)
The internal folder settings and environment variable settings are now displayed on the console screen at startup.
STAGE APP is terminated after waiting 1 second when terminating.
Added support for general FTDI devices (FT232, FT230). Firmware write mode must be done manually
Added the function to display the COM port assigned by Windows by pressing c key on the serial port selection screen on Windows.
added the ability to change the baud rate from 115200bps
Added a command line option (-E 0) to disable the drawing fade function.
Moved MWSTAGE/MWSDK/Tools to MWSTAGE/Tools in the folder structure. (To make MWSDK available as it is in MWSDK_COMMON repository)
TWELITE_Stage.ini (remove extension from startup filename and add .ini) is now loaded at startup and the MWSDK folder can be selected. (It is now possible to easily switch between older versions of the library set.)
Changed SDL2 library for screen rendering to 2.0.12 (Windows, MacOS, RaspberryPi).
The DLL file is no longer necessary for Windows as a static build.
The number of parallel builds by make -j is now (number of physical CPUs - 1).
reopen serial port explicitly in some places of rewrite menu. added support for easy recovery from USB disconnection when a device is unplugged or plugged in.
added support for opening the folder TWENET/usever.mk when opening mwx or twesettings by pressing Alt(Cmd)+Shift+m, t.
The following changes have been made.
[Raspberry Pi] Fixed a problem that write menu transition at /dev/serial0 fails at the first boot.
Moved MWSTAGE/MWSDK/Tools to MWSTAGE/Tools in the folder structure. (To make MWSDK available as it is in MWSDK_COMMON repository)
TWELITE_Stage.ini (remove extension from startup filename and add .ini) is now loaded at startup and the MWSDK folder can be selected. (It is now possible to easily switch between older versions of the library set.)
Changed SDL2 library for screen rendering to 2.0.12 (Windows, MacOS, RaspberryPi).
The DLL file is no longer necessary for Windows as a static build.
The number of parallel builds by make -j is now (number of physical CPUs - 1).
reopen serial port explicitly in some places of rewrite menu. added support for easy recovery from USB disconnection when a device is plugged or unplugged.
Add Act extras menu.
More advanced than Act ⌘_samples
External open source libraries (e.g. sensor procedures)
Expanded mouse actions (lists, buttons, tabs)
Mouse move to focus, left click to confirm, right click to input [ESC] key
Reduced screen display load
Disabled screen saver when application is in background
Reduced CPU load by reducing the number of drawings when the application is in the background.
Enhanced the list of build projects (Act, TWE_Apps, Act Extra)
Displaying a summary at the bottom when an item is selected (load 000desc.txt file, processed by TWE_Desc class)
Open project folder (or open with VSCode)
Open related websites.
Open ALt+Shift+m mwx library and Alt+Shift+t twesettings library.
Ability to open folders and build error files currently selected in the build menu.
Added logging (serial port input/output) function.
(Alt/Cmd+L) to start/end logging
Log files are stored in {folder with {TWELITE_Stage executable}/log
File name is twestage_{date-time}.log
Shift+Alt/Cmd+L to open log file folder
Other changes/modifications, etc.
Changed the display method of serial (FTDI) device names and IDs
Fixed the problem that App_UART did not transition to Interactive settings mode
Changed the behavior when dropping a folder (it used to be a binary write, but now it is a menu transition)
When the terminal is pressed and held down for a long time, the screen is cleared in addition to resetting by pressing [C].
Adjusted drawing of console screen.
The settings for the destination screen (Interactive settings mode or Terminal) after writing the firmware were not working.
Changed the assignment of Alt(or Cmd)+W
Fixed other bugs
The console screen outputs the same information as the terminal.
The screen is displayed on a framebuffer without X11. The console screen is not normally displayed (when started from a shell screen on the framebuffer).

Others
Viewer
Windows macOS Linux RasPi
The viewers display information from the TWELITE wireless microcontroller connected via the serial port and send commands (commands) to the contrary.
Each viewer is a relatively small program that also serves as an example of how to use the mwm5 library.
Terminal
Windows macOS Linux RasPi
This is a simple terminal that supports ANSI escape sequences (partial) and performs I/O directly with the TWELITE radio microcontroller.
Main Menu
Windows macOS Linux RasPi
This is the top level of the hierarchical menu.
On this screen, you can make various menu selections. When the menu is inverted, a simple explanation is displayed in the green text area at the bottom.
Re-programming
Windows macOS Linux RasPi
Re-selects the item that was specified and re-programmed immediately before.
Write(program) Application Firmware
Windows macOS Linux RasPi
Write the application (firmware) for the TWELITE wireless microcontroller.
Write a pre-built .BIN file (Windows/Mac/Linux/RasPi)
Graph
: Displays accelerometer packets in real time. Frequency domain display and CVS save function are available.
: TWELITE Stores data from various sensors in a sqlite3 database and displays graphs.
Re-programming of the selected project
last selected
TWELITE STAGE eliminates the complexity of building source files, disconnecting from the terminal, starting the write utility, and connecting to the terminal during development.
Automatic recognition of TWELITE BLUE/RED (Windows/Mac/Linux/RasPi)
Reset and go to Interactive settings mode or Terminal after writing is finished (Windows/Mac/Linux/RasPi)
Start the project folder or VSCode on the list of each project (Windows/Mac/Linux/RasPi)
Open the related website on the list of each project (Windows/Mac)
app_rewrite : builds and writes firmware to the connected TWELITE radio module.
Interactive settings mode (interactive.md): to set the connected TWELITE radio module to interactive settings mode.
TWELITE STAGE settings : Configure various settings for the TWELITE STAGE application.
Serial port selection : Displays a menu to select a serial port.
Description : Menu to display the description. Open the following instructions in your browser.
TWELITE STAGE application (this document)
MWX library
TWENET_C library

[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Display in large font. Display a partial area of the first screen. Select the area so that the cursor is displayed in the screen, but`, depending on the screen output, the part you want to see may not be visible.
[ B ] long press
Turn-on/off of the wrapping control, which by default is turned on, but can also be turned off. Text after the right edge of the screen is not displayed.
[ C ]
Go to the firmware programming screen. Shortcuts are provided for frequent source code modifications, operation checks, and build & write operations during firmware development.
[ C ] long press
Controls and resets the reset pin of the TWELITE wireless module.
ESC ESC
Exit this screen by quickly entering the ESC key twice. In most screens, pressing the ESC key once is the operation for exiting the screen, but since the terminal may use the ESC key alone, it is assigned to two consecutive entries.
[ A ]

input + + + sequence (Interactive settings mode)
Specified Folder
Windows macOS Linux
Folders or .BIN files can be dragged and dropped throughout the TWELITE STAGE APP screen. Select to perform an operation on the dropped object.
Interactive settings mode
Windows macOS Linux RasPi
Transition to Interactive settings mode and operation.
This screen behaves much the same as the terminal, but has additional features specific to Interactive settings mode, such as operation for Interactive mode transitions and detection of leaving.
The TWELITE radio module to be connected must have furware written for Interactive settings mode.
Since the system operates using input/output from the TWELITE radio microcontroller, it may not be possible to transition to or leave Interactive settings mode as expected, for example, if garbled characters or other problems occur in serial communication.
Mouse operation is not supported. Keyboard operation (using the cursor up/down) is supported.
The following is a rough process flow.
operation manual
This is an explanation of the TWELITE STAGE screen and operation methods.
To start the TWELITE STAGE application, execute the executable found in {MWSTAGE Installation}.
When replacing the TWELITE STAGE application executable due to updates, etc., be sure to copy it to the designated folder {MWSTAGE Installation}. If you place the executable in any other folder, the behavior is undefined.
The execution method differs for each system (Windows, macOS, Linux).
Two executables are available.
TWELITE_Stage.{extension} - starts with default settings
TWELITE_Stage_VSCode.{extension} - "Use VSCode" is already set (settings are stored in TWELITE_Stage_VSCode.ini). Enabling the Use VSCode setting will make the behavior suitable for development work using VSCode It will become
Although it is not an error to launch multiple TWELITE STAGE applications, there are some functions (such as the sensor graph function) that are infeasible when multiple applications are launched.
In this case, make a copy of the executable and launch it as a separate file name. The file names of the various settings and input/output files will be different and will not interfere with each other.
There are two types of running screens: one is the command screen (if started from the command screen, the same screen is used) and one is the main screen of TWELITE STAGE. The command screen is not normally used, although it is possible to check the operation and other auxiliary information.
Please use one of the following methods to exit.
Move the mouse pointer to the upper right on the execution screen, and the Exit button will appear. Press this button.
Close the window of the execution screen.
In rare cases, the run screen may remain after the exit operation. In this case, please try the following.
Close the command line window of the TWELTIE STAGE application.
Perform a forced termination (refer to your system's instructions for how to perform a forced termination).
Select from BIN
Windows macOS Linux RasPi
Writes a pre-built application (.BIN file).
Selecting the menu will display a list of files. Select the firmware you wish to write.
Before selecting the menu, store the BIN file you want to write in the following.
In the BIN folder, store the .BIN file (stored under the build folder of each project) built with TWELITE STAGE, without changing the file name.
The file name is used to identify BLUE/RED.
TWELITE_Stage installation (Linux)
Linux
USB device ID for TWELITE R2 has changed from 0403:6001 to 0403:6015. udev setting needs to be added.
32bit version is not available.
TWELITE Standard App Viewer
Windows macOS Linux RasPi
Interprets of .
The TWELITE wireless microcontroller is written with App_Twelite (standard app) or App_Wings, and the serial message from the communication partner is displayed before it is used.
The communication partner is App_Twelite (standard app), and when it receives a standard app button or analog input status message (0x81 message), its contents are interpreted and displayed by mwm5's parser library.
Serial port selection
Windows macOS Linux RasPi
Reselect the serial port.
Windows
.exe
Double-click on the executable in Explorer.
macOS
.command
Double-click on the executable from the finder.
Linux, RaspberryPi
.run
Depends on the distribution and installation environment; run as a command from a terminal screen (e.g., xterm) on an X window system.

Alt(Cmd)+1,2,... 

Windows, Mac, Linux
{MWSTAGE folder}/BIN
../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
...
The Linux environment has different types of packages available depending on the distribution and version. You may need to install and configure packages individually.
Please refer to general information by referring to the error messages.
TWELITE STAGE is developed and tested in the following environment.
Ubuntu 16.04, 18.04, 20.04
NNLinux Beta8 64bit
Centos7
In order to recognize MONOSTICK or TWELITE-R from TWELITE STAGE, you must unload the ftdi_sio module and also have read/write permission to the USB device.
We have a udev configuration script Ј(Ubuntu, CentOS Ј) to automate this configuration. It copies the definition to /etc/udev/rules.d and reloads the configuration. After configuration, unplug and plug the USB device before running TWELITE_Stage.run. If the USB device appears on the screen right after startup, the configuration is reflected.
Definition file (line breaks for easier reading)
Definition file (line breaks for easier reading)
Register your program according to your desktop environment if necessary.
Definition file generation scripts for Ubuntu are available.
This script creates a .desktop file (app definition) in $HOME/.local/share/applications.
After the script is executed, the TWELITE STAGE icon will be added to the application list.
[Screen black background].
↓↓
[TWELITE wireless microcontroller reset (SET=LO if controllable)]
↓↓
<Detect interactive mode message for intermittent operation application? > --YES--> Go to [operation screen
↓Time out.
['+' three times].
↓↓
<Detect interactive mode message for normal app? > --YES--> Go to [operation screen
↓Time out
Go to [operation screen] * This state is not Interactive settings mode
[operation screen]
↓↓
<Interactive settings mode escape message? > --> [Exit].
↓
<Leaving screen operation [ A ] long press etc. > --> [Exit].
↓
<ESC ? > -> <determination during input> --NO-> [Exit].
↓ ↓
[Send input string to TWELITE radio module]
↓↓
Return to [Operation screen
[Exit]
↓↓
[TWELITE radio microcontroller reset]
↓↓
[Exit screen] Exit Interactive settings mode screen and return to previous screen. $ cd ./MWSTAGE/TWELITE_Stage/INSTALL/ubuntu/
$ sudo ./set_udev_sudo.shACTION=="add",
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001",
MODE="0666",
RUN+="/bin/sh -c 'rmmod ftdi_sio && rmmod usbserial'"
ACTION=="add",
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015",
MODE="0666",
RUN+="/bin/sh -c 'rmmod ftdi_sio && rmmod usbserial'"$ cd ./MWSTAGE/TWELITE_Stage/INSTALL/centos/
$ sudo ./set_udev_sudo.shACTION=="add",
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001",
MODE="0666",
RUN+="/bin/sh -c '/usr/sbin/rmmod ftdi_sio'"
ACTION=="add",
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015",
MODE="0666",
RUN+="/bin/sh -c '/usr/sbin/rmmod ftdi_sio'"$ cd ./MWSTAGE/TWELITE_Stage/INSTALL/ubuntu/
$ ./make_launch_icon.sh[ A ]
No assignment.
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Change the font.
[ B ] long press
Screen display with dummy data for testing.
[ C ]
No assignment.
[ C ] long press
Controls and resets the reset pin of the TWELITE wireless module.
ESC ESC

Act build&Wrt
Windows macOS Linux RasPi
Build and rewrite Act. (Windows/Mac/Linux)
Focus on small-scale source code that can be used as a reference for writing Act (Act).
When this screen is opened, a list of projects is displayed. Select the project you wish to write, and the build - write will be performed. After writing is complete, press Enter or [ B ] button to reset the TWELITE radio module and go to the Interactive settings mode screen (or Terminal screen, configuration required).
If the configuration is set to use VSCode (open a folder with application rewrite>code), do not build, but open the under build/.
The projects to be built are as follows
ARIA Viewer
Windows macOS Linux RasPi
Interpret messages from .
TWELITE APPS build&Wrt
Windows macOS Linux RasPi
Build and rewrite TWELITE APPS. (Windows/Mac/Linux)
The source code is mainly written in C language by TWENET C API and is relatively large in scale to be used as is.
About Folder Structure
Ac extras
Windows macOS Linux RasPi
Build and rewrite Act.
Act Extras include those that use external open source libraries and other resources, and those that perform relatively complex processing.
Exit this screen by entering double ESC keys.
Open a folder (project, related folders). You can set it to open in VS Code in the settings menu.
ESC
Exit this screen and return to the rewriting menu.
mouse click [ヘルプ]
Open the relevant website.
mouse click [フォルダ] (or [VSCode])
Open the relevant folder (with VSCode).
mouse click [▽] or [△]
Go to the next or previous page.
[ A ]
Menu selection ↑
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Selection
[ B ] long press
Open the relevant website (if registered in 000desc.txt in the project folder) with a standard OS browser.
[ C ]
Menu selection ↓

[ C ] long press
Records configuration information within the TWELITE Stage application.
The file name is the TWELITE_Stage app file name + .sav.
see this for details.
MWSDK= Edit to specify a different folder instead of the MWSDK/ folder. This is useful if you want to mix multiple library versions. The above example uses the MWSDK2020_10 folder.
LANG= Specify LANG=en to set the display language of TWELITE Stage to English.
Copy TWELITE_Stage.exe (on Windows) with a different file name. For example, if you change it to TWS1.exe, it refers to the configuration files TRS1.sav and TRS1.ini.
When you select the TWELITE STAGE APP's BINから選択 menu, the firmware files (.BIN) for the TWELITE radio microcontroller in this folder are enumerated.
Log files are stored in this folder when the serial port logging function is performed in the TWELITE STAGE APP.
This folder is also used to store databases when using the graphing function and to output csv files.
This folder contains toolchains for gcc, g++, and other cross-compilers.
Platform specific utilities are also stored in this folder. See Tools/reame-j.txt for details.
This function is introduced as an extra function. It may work differently from what is described.
Search for build project folders (e.g., Act_samples) in the following order
the folder where the TWELITE STAGE app was launched
the folder where the TWELITE STAGE app executable is located
{MWSDK folder}/...
{MWSDK folder}/..
If the Wks_Acts folder exists, this folder is referenced from the menu item Act Build & Rewrite instead of the Act_samples folder.
{MWSTAGE installation folder}/MWSTAGE/Act_samples... /MWSTAGE/ TWELITE STAGE SDK Installation.
/TWELITE_Stage.???? Executable (Windows .exe, macOS .command, Linux .run)
/TWELITE_Stage.sav Configuration file
/TWELITE_Stage.ini Other settings
/TWELITE_Stage/ TWELITE STAGE APP related files
/MWSDK/ MWSDK libraries, etc.
/BIN/ Destination for [BIN file selection
/log/ Logs and databases
/Tools/ gcc compiler and other toolsMWSDK/
Act_samples/ : sample code by mwx library
Wks_TweApps/ : source code for TWELITE APPS
Act_extras/ : more specialized samples by mwx library, citing other libraries
TWENET/ : TWENET library (mwx library and others)
ChipLib/ : semiconductor library
MkFiles/ : body processing part of Makefile
docs/ : Library manuals, etc.
000manifest : Version information of MWSDKThe default setting (ARIA mode) of TWELITE ARIA wakes up due to several factors and transmits various information after waking up while driving intermittently using sleep, which can be operated even with coin cell batteries.
Wake-up by timer (periodic wake-up by set value)
Wake-up by magnetic sensor (when a magnet is detected approaching)
Module power supply voltage
Magnetic sensor detection value
Temperature and humidity data
Displays basic packet information.
#????
The number of packets received so far.
Type
The value of , which is the packet type; packets from CUE usually have PKT_PAL=02.
ID
Logical ID of the sender. Normally the value is 0..100.
AD
The serial number of the sender.
LQ
LQI, the value corresponding to the radio wave strength.
Displays the history of the last 9 data received from TWELITE ARIA. The higher the number, the more recent the data.
The time in seconds from the start of the TWELITE STAGE APP until the data is received.
Logical device ID of the module.
Supply voltage of the module[mV].
The temperature measured by the module (°C).
The humidity (%) measured by the module.
Displays detected or undetected magnet poles.
When this screen is opened, a list of projects is displayed. Select the project you wish to write, and the build - write will be performed. After the writing is finished, press Enter or [ B ] button to reset the TWELITE wireless module and go to the Interactive settings mode screen (or Terminal screen, configuration required).
If you are set to use VSCode (perform programming > open a folder with code), do not build, but open the BIN file writing screen under build/.
The projects to be built are as follows
[ A ]
menu selection ↑
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Selection
[ B ] long press
Open the relevant website (if registered in 000desc.txt in the project folder) with a standard OS browser.
[ C ]
menu selection ↓
When this screen is opened, a list of projects is displayed. Select the project you wish to write, and the build - write will be performed. After the writing is finished, press Enter or [ B ] button to reset the TWELITE radio module and go to the Interactive settings mode screen (or Terminal screen, configuration required).
If you have set up to use VSCode at the TWELITE STAGE settings, do not build, but open screen to write BIN file under build/.
The projects to be built are located as follows
[ A ]
Select menu ↑
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Selecting a menu item.
[ B ] long press
Open the related website (if it is registered in 000desc.txt in the project folder) with a standard OS browser.
[ C ]
Menu selection ↓
CUE Viewer
Windows macOS Linux RasPi
Interpret messages from TWELITE CUE.
The default setting (CUE mode) of TWELITE CUE wakes up due to several factors and transmits various information after waking up while driving intermittently using sleep, which can be operated even with coin cell batteries.
Timer wake-up (periodic wake-up by set value)
Wake-up by acceleration detection
Wake-up by magnetic sensor (when a magnet is detected approaching)
Detection event (see below)
Module power supply voltage
Magnetic sensor detection value
Acceleration data
Displays basic packet information.
The default output of TWELITE CUE is always as an acceleration event. Regardless of the wake-up factor, a fixed number of samples of acceleration is measured after wake-up. The event corresponding to the result of this acceleration is sent.
Supply voltage of the module[mV].
Displays detected or undetected magnet poles.
Displays acceleration measured after waking up.
Commander
Windows macOS Linux RasPi
The Commander sends serial messages to the TWELITE radio microcontroller. The first screen of the Commander describes the notes.
At the top of the screen are tabs represented by text, which can be clicked on with the mouse to move to the screen in the tab.
This screen generates and sends the for , writes App_Twelite or App_Wings to the TWELITE radio microcontroller, sets the Application ID CHANNEL, and confirms that the message is received from the communication partner Confirm that the message has been received from the communicating party.
A command is generated each time each item is changed. Pressing the Send button will re-send the command for the current setting.
This screen generates 's , which writes App_Wings to the TWELITE radio microcontroller, sets the Application ID CHANNEL, and verifies that the message is received from the communication partner.
A command is generated each time each item is changed. Pressing the lit button will re-send the command for the current setting.
The bottom of the screen displays the timestamp at which the command was generated and the command beginning with :. The clipboard will copy the contents of this screen.
Build and Programming Screen
Windows macOS Linux RasPi
This is the screen during the build process. The contents of the build commands are output to the console screen. ..." in the screen shows the number of files being built. is the number of files being built, and the darker color at the bottom is the name of the file being built.
If the build fails, the screen will look like the above. You can execute a rebuild or view the error log. It will also return to the straight line menu as time expires after a certain period of time.
Only typical error messages are displayed on the screen. When a build fails, error messages may not be displayed.
If the build is successful, the screen for writing firmware is displayed.
After v1.0.2 or later, after the firmware is rewritten, a verification process is performed to read and check the rewritten contents.
If the programming is in error, the screen will look like the above
If the programming is successfully completed, the above message is displayed.
From v1.0.2 onward, after the firmware is rewritten, a verification process is performed to read and check the rewritten contents.
000desc.txt
If 000desc.txt is created in the project folder, TWELITE STAGE APP will display its contents in the list of project folders.
The file is written in UTF-8. There are two types of formats.
The first line is the title line.
The second and subsequent lines are descriptions of the details.
If the last line starts with http, it is a link to a website.
The format is like an ini file. The item name starting at the beginning of the line and up to the = character is the item definition, and the rest is the content of the item.
{MWSTAGE installation folder}/MWSTAGE/Wks_TweApps{MWSTAGE installation folder}
MWSTAGE/Act_extrasTurn on LED when switch is pressed
act4 runs an act that turns on an LED when a switch connected to the TWELITE DIP is pressed.
https://mono-wireless.com/jp/products/act/index.html[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Rebuild on error
[ C ]
Show error log (Windows/Mac)
The error log is {project folder}/build/builderr.log.
[ C ] long press
Open a folder (project, related folders). You can set it to open in VS Code in the settings menu.
ESC
Exit this screen and return to the rewriting menu.
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Perform programming again (returns to the previous programming menu. Since the menu item for programming is still selected, press [ B ] again to perform the programming again).
ESC
Exit this screen and return to the programming menu.
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Reset the TWELITE radio module and go to the Interactive settings mode screen (or terminal, depending on your settings) screen.
ESC
Exit this screen and return to the programming menu.
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Reset the TWELITE wireless module and go to the Interactive settings mode screen (or terminal, depending on your settings) screen.
ESC
Exit this screen and return to the programming menu.





SQ
Packet sequence number.

[ C ] long press
Open a folder (project, related folders). You can set it to open in VS Code in the settings menu.
ESC
Exit this screen and return to the programming menu.
mouse click [HELP]
Open the relevant website.
mouse click [Foldr] or [VSCode]
Open the relevant floder (with VSCode).
mouse click [▽] or [△]
Go to the next or previous page.

[ C ] long press
Open a folder (project or related folder). You can set it to open with VS Code in the settings menu.
ESC
Exit this screen and return to the rewriting menu.
Mouse click [HELP]
Opens the related website.
Mouse click [Foldr] (or [VSCode])
Open a related folder (with VSCode).
Mouse click [▽] or [△]
Go to the next or previous page.

Packet sequence number.
#????
The number of packets received so far.
種別
The value of E_PKT, which is the packet type; packets from CUE usually have PKT_PAL = 02.
ID
Logical ID of the sender. Normally the value is 0..100.
AD
The serial number of the sender.
LQ
LQI, the value corresponding to the radio wave strength.
Dice
1(0x00) .. 6(0x06)
The judgment is made based on the regular wake-up and the wake-up detected by the magnetic sensor. If a large acceleration is detected after waking up, an event (0xFF) may be detected that is not allowed to be judged.
Move
16(0x10)
A move or shake event occurs when the accelerometer wakes up when it detects an acceleration above a certain level. A move event occurs when the change in measured acceleration is not very large. (When a change in acceleration is detected, but there is no continuous change in acceleration)
Shake
8(0x08)
A move or shake event occurs when the accelerometer wakes up when it detects an acceleration above a certain level. A shake occurs when the change in measured acceleration is relatively large. (When changes in acceleration are detected and continuous changes in acceleration can be detected. (As the name Shake implies, it occurs when the CUE is continuously shaken.)
sample
The number of samples of acceleration is shown. 10 fixed samples.
Rate ID
The sample rate of acceleration. 04 fixed at 100 Hz.
X,Y,Z
Acceleration of three axes, obtained as an average of 8 samples. The unit is milli-G (1000mG=1G=9.8m/s2).



SQ
Generates a lights-off message.
On button
Transmits the current settings.
[ 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 tabs (right)
[ C ] long press
TWELITE Controls the wireless module's reset pin and resets it.
ESC
Exit this screen and return to the selection screen.
Destination
The Destination. If you are a Child Node, specify "Parent Node:0". If you are the Parent Node, specify "All Child Nodes = 0x78" or a specific Child Node ID (up to 1..8 can be specified).
DI1..DI4
This is the setting status from DI1 to DI4. ■ means selection (LOW=GND level) and □ means (HIGH=VCC level). Specify SEL for the item below.
SEL
Selection bits for each DI (0 to ignore the DI designation, 1 to enable the designation)
PWM1..4
Set the duty ratio of PWM. 0 is equivalent to GND level, 1024 (100%) is equivalent to VCC level, and the PWM port set to N.A. is not changed. The LED of PWM1 on the TWESTAGE board is sucked in from VCC, so it lights up brightest at 0 and turns off at 100%.
Child Node ID
Destination. 1..8. Assign the same ID to the Child Node.
Color
Specify the lighting color from 7 colors. There are two types of white, one is a mixture of RGB colors and one is white LED lighting alone.
brightness
0..15 where 0 is off.
Light blinking
Select light-on or blinking pattern.
Lighting time
This function automatically turns off the light after a certain period of time after issuing a command.


Off button
[JAPANESE], [ENGLISH]
block delimiter
title line
description of details.
DESC=
description of details. Can be multiple lines including line breaks.
URL=
Link to a website or file
URL=
Details
starting with https:, http:
open that address
other than that
relative folder starting with {MWSDK_ROOT}/docs/. If you specify a/b/c.html, it will be converted to {MWSDK_ROOT}/docs/a/b/c.html.

-R {type}
Set rendering type by {type} value:
0: default
1: OpenGL
2: DirectX(Windows) Metal(macOS)
3: Software.
-J
Enable game controller.
-x {x_pos}, -y {y_pos}
Set position of TWELITE STAGE App graphical winodow at launch. The {x_pos} and {y_pos} is the screen coordinate of window top-left.
The ini file is used to set some fundamental settings of TWELITE STAGE (like reference MWSDK folder).
The ini file name is {basename of TWELITE STAGE app executable} + .ini, which is normally TWELITE_Stage.ini.
The ini file is described as a plain text file.
A key and value is stored in a single line separated with = character (e.g. KEY=value).
A key value string shall begin with line head. (No spaces or other character allowed before a key string.)
No space allowed between the = character.
Comment line is started from ; or # characacter.
MWSDK
Change MWSDK folder to another one. The default folder is MWSDK at the same folder where TWELITE STAGE App executable is located. If you need to use older or custom MWSDK, you can specify the name of its folder.
LANG
LANG=en will change the user interface language from default(Japanese) to English.
GEOM_X, GEOM_Y
Change the location of TWELITE STAGE App window is shown
If you need to different setting type of TWELITE STAGE App, just copy an executable at same folder of the original TWELITE_Stage executable.
e.g. if you needs English interface vesion, you just copy TWELITE_Stage.exe(Note: .exe is suffix of Windows executable) to TWELITE_Stage_en.exe and create .ini file with LANG=en setting.
-E 0
Disable graphical effect like fading out
[JAPANESE]
TITLE=Actのテンプレート
DESC=中身が何もない setup(), loop() のみのファイルです。
新しく 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;;; change MWSDK reference.
; MWSDK=MWSDK
MWSDK=MWSDK2020_10
;;; Interface language
LANG=en
;;; Window geometry
;GEOM_X=200
;GEOM_Y=100 TWELITE_Stage.exe
TWELITE_Stage.ini | no special settings
TWELITE_Stage_en.exe | copy of TWELITE_Stage.exe
TWELITE_Stage_en.ini | LANG=en is setkey & mouse operation
Windows macOS Linux RasPi
This section describes the operation through the TWELITE STAGE application.
Windows macOS Linux RasPi
Keystrokes while pressing ALt(Cmd) are operations such as changing the settings of the TWELITE STAGE app. Other keystrokes are usually on-screen inputs.
Windows macOS Linux RasPi
Windows macOS Linux RasPi.
In Windows/macOS/Linux, you can press and hold Alt(Cmd) to display the help screen. The help screen will display a description of the keys that can be operated together with Alt(Cmd) and some operational status.
The help screen is also displayed by moving the mouse pointer to the upper left part of the screen.
! [help screen](... /.gitbook/assets/img_help_ovrly.png)
Windows macOS Linux RasPi.
The following table describes the operations while holding down Alt(Cmd) on Windows/macOS/Linux. In the table, Alt(Cmd)+ is omitted; pressing Alt(Cmd) will bring up a help screen to check the available keys, which are supplemented in the table below.
Windows macOS Linux RasPi.
Mouse is mostly left click, but right click, right double click, and wheel may be used.
Windows macOS Linux RasPi.
The TWELITE STAGE application has a menu that resembles a row of three hardware buttons to which functions are assigned for each screen. When you move the mouse pointer over the menu display at the bottom of the screen, buttons labeled [ A ], [ B ], and [ C ] will appear. Left-click or long-press left-click on this button to select a function. (You can also use Alt(Cmd)+a,s,d or Alt(Cmd)+Shift+a,s,d to select)
Windows macOS Linux RasPi
On Windows/macOS/Linux, the TWELITE STAGE screen structure consists only of text strings in principle, but menus, buttons, and tabs can be operated with the mouse.
Although it consists only of text, tabs at the top of the screen and highlighted text can be selected with a left mouse click.
Setting up a TWELITE STAGE
Windows macOS Linux RasPi
Configure various settings.
Menus on this screen cannot be operated with the mouse.
It may be difficult to see if you change the color of the screen.
In the menus in the following explanations, there are items that do not exist on some platforms, but all are enumerated and explained.
Color settings other than those in the common menu are omitted.
This screen is a utility that performs maintenance of the data save area, emulating an EEPROM(64 bytes as one sector, up to 60 sectors, 3840 bytes).
Glancer
Windows macOS Linux RasPi
Glancer is an English word for a person who glances, and it is a simple display of information in incoming messages. TWELITE Radio App_Wings is written in the microcontroller, and the communication partner (App_Twelite, TWELITE PAL, ...) is set to the same channel as the application ID. Application ID and CHANNEL can be mixed as long as they match).
The screen consists of two types of screens.
Enumerates information from the communication partner. The contents displayed are (message type, logical ID, serial ID, LQI(Lq), supply voltage (if included in the information), and reception time).
This screen is accessed by moving an item in the list view and making a selection when the item is highlighted. Displays information on specific communication partners in order of arrival.
The number of packets received and the average LQI value since the selection is made are displayed.
TWELITE_Stage installation (Raspberry Pi)
RasPi
The TWELITE Stage app runs on a Raspberry Pi.
Mouse and touch screen support.
The build toolchain is included and can be used to compile the application.
Paste from the clipboard as keyboard input.
F
Go to full screen; Shift+F will zoom in more if possible.
G
Change the way the screen is drawn. 640x480 LCD screen is emulated, but you can select one of four drawing methods (1. LCD monitor-like drawing / 2. CRT-like drawing / 3. enlarged with prominent dots / 4. enlarged with blurred dots) when zoomed in. The setting can be changed to the startup setting in the setting menu. The setting can be made at startup in the settings menu.
J
Select the screen size. The available screen sizes are {640,480}, {1280, 720}, {1280,960}, {1920,1440}, {2560,1440}, and {320,240}. * You can set the startup settings in the settings menu.
Q
Exit TWELITE STAGE.
0
Disconnect the serial port and list the serial ports again.
1,2,...
Select a serial port.
L, Shift+L
Start logging serial port input/output. When finished, the log file will be opened in Notepad on Windows or in Log Viewer on macOS. If you want to open the log folder, press Shift+L to open the folder containing the log.
wheel
use depending on screen (zoom in/out on graph screen)
ESC ESC
Press ESC twice quickly. Cancel, return to previous screen. Depending on the screen, one ESC will return you to the previous screen.
Enter
Input, select
Cursor↑↓
Select item
Alt(Cmd)+ key
Meaning
I
Enter + + + key sequence to enter Interactive settings mode. * Interactive settings mode is not entered with + + + for applications that perform intermittent operation due to sleep.
R
Resets the module, using the TWELITE R or MONOSTICK function to control the reset pin.
A, S, D
Press the A, B, or C button.
Press and hold Shift + A, S, D
A, B, C button.
C
Copy the string of the displayed screen to the clipboard. (The range varies depending on the screen.)
Alt(Cmd)+Shift+Ctrl+m
Open MWX library code folder
Alt(Cmd)+Shift+Ctrl+m
Open the log folder
Left Click
Select
Drag while left-clicking
Used depending on the screen (dragging on a graph screen)
left double-click
not used
right-click
use by screen
right double-click
escape from screen (same as ESC ESC)


V
Controls and resets the reset pin of the TWELITE wireless module.
ESC ESC
Exit this screen by entering the ESC key.
Controls and resets the reset pin of the TWELITE wireless module.
ESC
Exit this screen and return to the list view.
[ A ]
Move to the previous item on the list.
[ A ] long press
Exit this screen and return to the previous menu.
[ B ]
Shifts to selection view.
[ B ] long press
Sorts items. Each time the sort is performed, the sort key changes sequentially.
[ C ]
Move to the next item on the list.
[ A ]
No assignment
[ A ] long press
Exit this screen and return to the list view.
[ B ]
No assignment
[ B ] long press
No assignment
[ C ]
No assignment


[ C ] long press
[ C ] long press
Startup App.
This is the setting for moving to the viewer application when TWELITE STAGE is started. The value is 1... {numbers listed in the viewer app menu}. If the serial device ID is not set, it will wait for input on the serial device selection screen when starting.
Screen size and drawing method
Windows macOS Linux RasPi Specify by 2-digit XY character (X:Screen size Y:Drawing method)X 0:640x480 1:1280x720 2:1280x960 3:1920x1440 4:2560x1440 5:320x240, Y 0:LCD-like 1:CRT-like 2:Blurred 3:Block
Serial Device ID
The Windows macOS Linux RasPi setting is a serial device name or a numeric value of 1...9. For numerical values, the order of device enumeration is used.
FG, BG color
Specify the text color and background color. The color setting values of the common settings are inherited by the settings of other screens. If other screens have not yet been set, the color settings in the common settings will be used. Colors are specified as 24-bit RGB hexadecimal numbers, but the values are internally rounded to 16-bit 565 format.
Baud Rate
TWELITE Set the baud rate on the radio module side so that the terminal and other displays will not be corrupted if the baud rate on the radio module side is not 115200.
Number of make jobs at build time
Windows macOS Linux RasPi This is the number of parallel jobs for builds. Setting an appropriate number can be expected to reduce build time. The default value of 0 is calculated by (number of physical processors - 1). As a rough guide, the number of logical processors should be used as the upper limit.
Open a folder with VSCode
Windows macOS Linux Setting 1 opens the folder with the code command (VS Code) instead of the standard OS folder window.
Screen after rewriting is completed
Set Windows macOS Linux RasPi 1 to open the terminal instead of the Interactive settings mode screen. 2 to return to the rewrite menu.
LNo LTO
The Windows Window compiler can generate slightly smaller binaries through the LTO mechanism, but linking takes time. This procedure can be eliminated, allowing for faster linking.
r
Reads a sector. 0..59 is entered, the contents of the sector with the entered sector number are displayed.
R
(Entering YES reads all sectors, but only the last one is displayed.
e
Erase Sector (0xFFFF) (Entering 0...59 will erase the sector with the entered sector number.
E
Entering YES erases all sectors.

Depending on the OS type, version, and installation status of your RaspberryPi, it may not work or you may need to recompile it.
TWELITE STAGE has been developed and tested in the following environment.
Hardware
Raspberry Pi 3 Model B
LCD Screen: Raspberry Pi Touch Display (7")
OS & distribution
Raspberry PI OS (32bit) Lite (Version:August 2020)
Operation of /dev/serial0 may fail on the first boot.
The operation of /dev/serial0 has not been tested on Raspberry Pi 4B.
Touch screen operation has not been tested on Raspberry Pi 4B.
The input string to TWELITE STAGE is passed as is to the input string to the shell or getty running on /dev/tty1. It is recommended to start from /dev/tty1.
This may be affected by other installations or running programs (such as X11).
The downloaded archive file should be extracted to a folder whose path name does not contain spaces or Japanese characters.
In the following, it is extracted to the home folder of the Raspberry Pi.
In order to recognize MONOSTICK or TWELITE-R from TWELITE STAGE, you must unload the ftdi_sio module and also have read/write permission to the USB device.
A udev configuration script is provided to automate this setup. It copies the definition to /etc/udev/rules.d and reloads the configuration. After configuration, unplug and plug the USB device before running TWELITE_Stage.run. If the USB device appears on the screen right after startup, the configuration is reflected.
Definition file (line breaks for easier reading)
In the environment described above, /dev/serial0 is available by configuring the serial port from raspi-config.
Refer to the manufacturer's manual for both TWELITE and RaspberryPi.
DIP# is the pin number of the TWELITE DIP.
The above wiring does not guarantee stable operation of the TWELITE wireless microcontroller module.
It will not run on the X11 desktop; close X11.
Run TWELITE_Stage.run. The TWELITE Stage app will appear on the screen screen.
Mouse and touch screen are supported.
During the TWELITE Stage app, the characters you enter may also be displayed on the console screen.
You may get the following error when starting TWELITE_Stage.run.
You may ignore it.
At build time, if the number of CPUs is 4 or more, the parallel compilation is executed minus one CPU number (3 parallel compilations for 4 cores). In some cases, insufficient memory may occur. In that case, please change the number of parallels.
This information has not been fully validated.
The following settings are required: OpenGL related drivers must be enabled.
Select Advanced Settings → A2 GL Driver → G2 GL (Fake KMS\ in raspi-config)
Install the libgles-dev package.
Touch screen operation has not been tested
Common settings
Terminal
Std App Viewer
Graph Viewer(Accl, Sensors)
Simple monitor (CUA/ARIA/Glancer)
Simple monitor (CUA/ARIA/Glancer)
Commander
Wrt Firmware
Interactive settings mode
Save Data Utility ( Dump/Erase)
Informationa: ( 0x00) Startup App.
G: ( 0x00) Screen size and drawing method
F: ( ) Serial Device ID
f: (0x00FFFFFF) FG color
b: (0x005A0032) BG color
B: ( 115200) Baud Ratef: (0x00FFFFFF) FG color
b: (0x005A0032) BG color
j: ( 0) Number of make jobs at build time
v: ( 0) Open a folder with VSCode
l: ( 0) LNo LTO
n: ( 0) Screen after rewriting is completedr: Read sector.
R: Read ALL sectors.
e: Erase sector.
E: Erase ALL sectors.$ cd /home/pi
$ unzip MWSTAGE2020_XX_YYYY.zip../MWSTAGE
TWELITE_Stage.run TWELITE_Stage App.
BIN/ BIN files of App. firmware
MWSDK/ MWSDK library, etc.
TWELITE_Stage/ TWELITE_Stage Application related files$ cd ./MWSTAGE/TWELITE_Stage/INSTALL/ubuntu/
$ sudo ./set_udev_sudo.shACTION=="add",
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001",
MODE="0666",
RUN+="/bin/sh -c 'rmmod ftdi_sio && rmmod usbserial'"
ACTION=="add",
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015",
MODE="0666",
RUN+="/bin/sh -c 'rmmod ftdi_sio && rmmod usbserial'" $ sudo raspi-config
From the Menu:
"3 Interface Options Configure connections to peripherals"
→"P6 Serial Port Enable/disable shell messages on the serial connection"
Select the following: do not use as a login shell, or enable hardware.
"Would you like a login shell to be accessible over serial?" -> <No>
"Would you like the serial port hardware to be enabled?" → <Yes> [TWELITE] [RaspberryPi]
GND ------------------ Gound (#6,#9,#14,#20,#25,#30,#34,#39のいずれか)
TXD(DIO6,DIP#10) ------ GPIO15/UART0 RXD (#10)
PRG(SPIMISO,DIP#7) ---- GPIO23 (#16)
RXD(DIO7,DIP#3) ------- GPIO14/UART0 TXD (#8)
RST(RESETN,DIP#21) ---- GPIO22 (#15)
VCC ------------------ 3V3 (#1,#17のいずれか)
SET(DIO12,DIP#15) ----- GPIO12 (#32) "The path /dev/dri/ cannot be opened or is not available"Installation
Depending on the environment, this application may not work or may require various settings. If you encounter any problems, please refer to the description in this document to improve your environment.
In order to build a development environment, you must install the software suite and agree to the license agreement. In addition, you may need to configure security settings on your PC or workstation.
Although we take all due precautions when distributing the software, we ask that you take care to check for viruses, etc.
Please check with the administrator of your environment regarding your security policy and operations (e.g., whether or not to install external applications).
In addition, please see . Topics include topics related to the following
Confirmation of identity with downloaded files
Handling of code signatures on macOS/Windows
the TWELITE STAGE SDK for your system (Windows, macOS, Linux, etc.).
Extract the downloaded archive file (e.g. ZIP). The folder name of each level of the destination folder should not contain any characters other than one-byte numbers 0..9, one-byte alphabets a..zA..Z, and some symbols -_. . It must not contain spaces, Kanji characters, Hiragana characters, etc. Example(Windows): × C:\work\作業\ × C:\Users\user1\work dir\
In the text, the expanded folder (e.g. C:\WorkMWSTAGE )} may be written as {MWSTAGE installation}.
See below.
The folder {MWSTAGE installation} where the TWELTIE STAGE SDK is installed contains the following
TWELITE STAGE application executable
MWSDK folder - libraries, source code, etc.
Tools - toolchain for building, etc.
For details, see " for details.
C:\Work\Work1Check the folder after expansion. If you extract on C:\Work, the folder name will be something like C:\Work\MWSTAGE, but your extractor may create a folder with the archive file name. Rename or move the folder as needed.
WindowsmacOSLinuxRasPiAllows logging of serial communications with the TWELITE radio microcontroller.
Press Alt(Cmd)+L key.
Press Alt(Cmd) + L again during logging.
Logging will finish and the log file will be opened in the OS standard way (Notepad for Windows, Console for macOS).
RaspberryPi only saves the log file and does not have the ability to open it.
String received from the TWELITE radio microcontroller → Logged as is
TWELITE Character string sent to the wireless microcontroller → Each character is enclosed by " " for Windows, " " for macOS/Linux/RaspBerryPi. "" to record the characters.
For example, "t" means you entered t from the keyboard.
Windows macOS Linux RasPi
The file will be saved in {Folder with TWELITE STAGE APP executable}/log with a file name based on the date and time when the logging started.
Press Alt(Cmd)+Shift+L to open that folder.
TWELITE_Stage installation (macOS)
macOS
We develop in the following environment
macOS 10.14 (Mojave, Intel)
macOS 12.4 (Monterey, Apple Silicon)
The download archive is not signed. At runtime, you may receive a security warning as an application downloaded from the Internet.
You may be asked for permission to run from the path where you installed TWELITE_Stage.
You may get an installation dialog for the make utility when executing a build.
The toolchain is code-signed, but if the code signature is not properly authenticated, you may be asked for permission to run each executable in the build toolchain (ba-elf-gcc etc.}).
The above is required to give permission or installation work for the TWELITE_Stage to work.
※ Different OS versions and other factors may require a different procedure.
If an error occurs when executing make on the command line (bash), install XCode.
After installation is complete, type "make" and the following message should appear.
MONOSTICK and TWELITE-R use FT232 series semiconductors from FTDI (https://www.ftdichip.com). In order to use them, you may need to deal with device drivers.
If the serial port does not appear when you start TWELITE-R, you need to unload (disable) FTDI's driver. See "Reference" below.
This utility suppresses the loading of the OS standard device driver when our MONOSTICK or TWELITE-R is inserted, but it also suppresses it for non-MONOSTICK devices (those with the same USB ID).
Download and use D2xxHelper from https://www.ftdichip.com/Drivers/D2XX.htm. You can find the same in our archive in the TWELITE_Stage/INSTALL folder.
Unload FTDI-related drivers.
Serial Port Selection
Windows macOS Linux RasPi
On Windows/macOS/Linux, a screen will appear at startup to select the serial port to which the TWELITE wireless microcontroller is connected. The serial port can be connected later without selecting it on this screen.
Pressing the c key displays the COM port name of the serial port currently inverted in the list.
On the Raspberry Pi, serial0 and serial1 will be displayed if there is a /dev/serial0 /dev/serial1 in addition to the USB device. Usually serial0 is used.




$ xcode-select --install$ make
make: *** No targets specified and no makefile found. Stop.$ sudo kextunload -b com.apple.driver.AppleUSBFTDIAcceleration real-time graph
Windows macOS Linux RasPi
Used for the purpose of referencing sample data from TWELITE CUE and TWELITE MOTION SENSE PAL.
CUE mode, MOT mode, and 2525 FIFO mode.
When the number of consecutive samples exceeds a certain number (analysis window), the XYZ axis is displayed with frequency analysis. However, in 2525 FIFO mode, it is always assumed to be continuous.
When a packet is explicitly delimited (when more than 3 seconds have elapsed since the previous packet, every packet in CUE mode, or when the sequence number of packets becomes discontinuous in MOT mode), a dummy of 4 samples is (When more than 3 seconds have elapsed since the last packet.
Data is stored for up to 4 nodes in order of arrival first.
During multi-node operation, communication failures often occur due to mutual packet collisions. In particular, in FIFO mode, the transmission cycle is almost constant, and packets are attempted to be sent at almost the same time to each other, resulting in transmission failures due to interference, which may continue for a long time. In principle, one node per CHANNEL should be used.
measure continuously at about 25 Hz. (Transmit Interval: 0, Sensor Parameter: 03000000)
measure continuously at about 50 Hz. (Transmit Interval: 0, Sensor Parameter: 03000100)
measure continuously at about 100 Hz. (Transmit Interval:
The sampling rate is calculated from the packet reception time. Since the reception time of multiple past samples is averaged to obtain one sample, the error will be larger if there are packet skips, etc.
After the sample rate is estimated, the graph display scrolls smoothly.
The timestamp of the related log record (T_SMPL) is also estimated in the same way, and the timestamp is after the time of packet acquisition.
Specify 31 in [STAGE Common Settings→Designate Startup Application].
By clicking the [Data Save] button, data for up to 512 samples will be output starting from the display position on the screen (rightmost sample). Note that the most recent sample comes last, so there may be no data at the beginning.
The log file name is log folder/accel_{serial number}_{time stamp}.csv.
The most recent sample on the right end is the 512th data (at the end of the file).
When frequency analysis is performed, the number of frequency analysis samples is the number of frequency analysis samples from the last sample.
When this screen is opened and data is entered, a log file is automatically output.
The log file name is log folder/accel_{serial number}_{time stamp}.csv.
While the screen is open, the file is being written out. It may not be opened for reading, or even if it is opened, all data may not be read.
003000200measure 128 samples at about 100Hz about every 10 seconds. (Transmit Interval: 10, Sensor Parameter: 03000208)
measure 256 samples at about 100Hz about every 10 seconds. (Transmit Interval: 10, Sensor Parameter: 03000210)
measure 64 samples at about 50Hz every 10 seconds. (Transmit Interval: 10, Sensor Parameter: 03000104)
measure 128 samples at about 200Hz about every 10 seconds. (Transmit Interval: 10, Sensor Parameter: 03000308)
Move the position of the displayed sample (in larger steps)
Cursor→, ←
Move sample display
Cursor↑, ↓
Zoom in/out on the sample horizontal axis (Equal, 2x, 3x, 4x; for 256 analysis samples, 2x). (Equal, 2x, 3x, 4x, up to 2x if the number of samples is 256)
Sample time (virtual or estimated)
Timestamp of each sample generated from the packet reception time. It does not match the actual time the sample was taken. (The error is large because the sample rate is estimated from the received packet interval, and the timestamp is one packet period later than the actual sample time because the sample period is calculated by adding the sample period to the received sample.
X[G]
Sample value on the X-axis
Based on the value from the sensor, the unit is [G].
Y[G]
sample value of Y axis
based on the value from the sensor, unit is [G].
Z[G]
sample value of Z-axis
based on the value from the sensor, unit is [G].
FD#
Number of the frequency analysis calculated value
If the number of frequency analysis samples is 64, they are ordered in the order of DC,1,2,...,31. ,31` if the number of frequency analysis samples is 64.
Hz
Frequency axis value of the frequency analysis calculation result
Approximate frequency. The frequency is calculated by (FD# / FD_Len) * FD_Freq.
X
Frequency analysis calculated value of X-axis
Y
Frequency analysis calculated value of Y-axis
X
X-axis frequency analysis calculated value
Label
additional information name
see table below
Info
additional information
see table below
Label
Additional Information
Refer to the table below
Time_Msec_part
Time when log file was opened
Time_Msec_part
Less-than-seconds portion of log file open [ms]
Samples
Valid sample data
FD_Len
Number of frequency analysis samples
FD_Start#
Frequency analysis start sample number
FD_Freq
Frequency estimate of frequency analysis range [Hz]
Estimated value from sample reception interval
FD_Freq
Sample time (virtual or estimated)
Timestamp of each sample generated from the packet reception time. It does not match the actual time the sample was taken. (The error is large because the sample rate is estimated from the received packet interval, and the timestamp is one packet period later than the actual sample time because the sample period is calculated by adding the sample period to the received sample.
X[G]
Sample value on the X-axis
Based on the value from the sensor, the unit is [G].
Y[G]
sample value of Y axis
based on the value from the sensor, unit is [G].
Z[G]
sample value of Z-axis
based on the value from the sensor, unit is [G].
Label
Additional information name
Refer to the following table
Info
Additional Information
Refer to the table below
Time_Msec_part
Time when log file was opened
Time_Msec_part
Less-than-second part of log file open [ms]
Right part of the [(I)ID#] button
Switch IDs with each click. (Note: For continuous sample data in FIFO mode, operation with multiple IDs is not practical.
Right part [(f)SMP#] button
Change the frequency analysis size to 64, 128, or 256 with each click.
right part [[>PAUSE( )] button
aborts display update (sample acquisition is performed until the internal temporary sample buffer is full)
right part [(c)SAVE DISPLAYED DATA] button
output data in CSV format (log folder). Outputs data from the sample displayed on the rightmost side of the screen to the oldest sample in the buffer. The number of output is always 5120, and the sample displayed on the rightmost side of the screen is the last data.
Mouse drag (graph section)
Move the position of the displayed sample
#
Sample number
T_PKT[ms]
Packet reception time
Since one packet contains multiple samples, samples with the same timestamp are lined up.
SEQ
Packet Sequence Number
Packets are assigned and if they are consecutive, there is no missing packet.
ModuleSID
Serial number of the sending side
Tick[ms]
System on TWELITE STAGE app side at log file open [ms]
Date
Date when log file was opened
Time
#
Sample number
T_PKT[ms]
Packet reception time
Since one packet contains multiple samples, samples with the same timestamp are lined up.
SEQ
Packet Sequence Number
Packets are assigned and if they are consecutive, there is no missing packet.
ModuleSID
Serial number of the sending side
Tick[ms]
System on TWELITE STAGE app side at log file open [ms]
Date
Date when log file was opened

Mouse drag (bottom scroll bar)
T_SMPL[ms]
Time
T_SMPL[ms]
Time
Sensor Graph
Windows macOS Linux RasPi
Various sensor data are recorded in a database file. There is also a function to simply refer to the measured values on the TWELITE Stage screen.
It is not possible to start multiple TWELITE STAGE with the same executable name and use the sensor graph at the same time.
The database file is stored in the {MWSTAGE installation}/log folder and the file name is determined by the TWELITE_Stage executable name.This is because the same executable file name refers to the same database file. The TWELITE STAGE app implementation does not expect multiple application instances to be adding data to the database at the same time. In some situations, this may result in a database file access error, which may cause the TWELITE STAGE app to crash.
For example, if you want to connect two MONOSTICKs and run multiple "sensor graphs" at the same time, run the TWELITE STAGE application with different executable names (stage_a.exe, stage_b.exe) for each. The database file names are log/stage_a_WSns.sqlite and log/stage_b_WSns.sqlite.
Data is stored in a file named {MW_STAGE Install}/log/{MW_STAGE file name}_WSns.sqlite using sqlite3.
The screen transition is [List (with graph preview)]>[24-hour data]>[Live View].
From [24-hour data], you can move to [Year], [Month], [Day (with graph preview)] selection screen.
v1.3.9or later
On the "24-hour data screen," left-clicking on the memo portion of the sensor node in the upper right corner of the screen will prompt you to edit the memo.
IME input operations (e.g. Japanese) may depend on the system you are using.
Unexpected character strings may be input depending on the operation at the time of IME input. When an unnecessary string is displayed in the input area, delete the unnecessary part by pressing the BS key.
There are three basic types of screens: list, 24-hour, and live.
Specify 32 in [STAGE Common Settings -> Startup Application Designation].
Used to store additional information (text) in sensor nodes.
Used for the purpose of maintaining the last received timestamp.
About the [Live] display screen
Select a specific node from the list.
Display real-time data every second, up to 450 seconds in the past.
About [24-hour data] display screen
Display data for a specific day.
Data is acquired every second, and if there are multiple data, they will be thinned out.
Except for the maximum magnification (1 second per pixel), the data is displayed by averaging the acquired values in each pixel range.
If the value extends beyond the screen, the measurement points are displayed at the top and bottom edges.
If the current time is included, the display is updated when new data arrives.
Wheel, cursor up/down: zoom in/out of time axis
Mouse move: Simplified display of the acquired data in the time axis corresponding to the mouse pointer.
Cursor→, ←: Move to the next acquisition data.
Click and drag: Scroll (only when zoomed in)
When zoomed in, operation by scroll bar is also available.
The [CSV Output] function displays all acquired values contained in the database.
Use the tools at https://sqlitebrowser.org/ to extract data.
Go to daily graph
[<Nodes]
Go to the nodes selection screen
[Yr] [Mo] [Dy]
Select a specific date by year, month, and day.
[ltst]
Go to today's data
[CSV exprot]
Output one day's data to CSV file
[DISP] at Nodes screen
Change the display method of the list
[SORT] at Nodes screen
Change the order of the list
[↑] at Nodes screen
Reverses the order of the listings
INTEGER
The milliseconds portion of the timestamp.
year
INTEGER
The year portion of the local time from the timestamp.
month
INTEGER
The month portion of the local time from the timestamp.
day
INTEGER
The day portion of the local time relative to the timestamp.
hour
INTEGER
The hour portion of local time from the time stamp.
lid
INTEGER
The identification value, e.g., LID, assigned by the user.
lqi
INTEGER
Approximate value of the reception strength (Link Quality Indicator).
pkt_seq
INTEGER
The sequential number of the packet. The possible values depend on the firmware.
pkt_type
INTEGER
The type of wireless packet.
2 PAL AMB, 6 ARIA
1 PAL MAG
*3 PAL MOT,5 CUE
0x101 App_Twelite, *0x103 App_IO
*Not supported at this time
value
REAL
measured value (definition depends on packet type)
pkt_type->
2,6: temperature
1: presence of magnet 00->no magnet, 01->N-pole, 02->S-pole
3,5: X axis acceleration (average if packet includes multiple 0x101,103: bitmap of input IO (same value as the last 8 bits of val_dio)
value1
REAL
measured value (definition depends on packet type)
pkt_type->
2,6: Humidity[%]
1: not used
3,5: Y axis acceleration (average value if packet contains multiple samples)[G]
0x101: ADC1[V] ,103: Not used
value2
REAL
measured value (definition depends on packet type)
pkt_type->
2: illuminance[lx], 6: not used
1: not used
3,5: Z axis acceleration (average value if packet contains multiple samples)[G ]
0x101: ADC2[V], 103: unused
value3
REAL
measurement value (definition depends on packet type)
pkt_type->
2: not used, 6: not used
1: not used
3,5: not used
0x101: ADC3[V], 103: not used
val_vcc_mv
INTEGER
voltage[mV]
val_dio
INTEGER
int32_t
b0..b7: DI1..DI8 values (1 is LO, 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: Regular transmission bit (magnet only)
val_adc1_mv
INTEGER
pkt_type->1,2,3,0x101: Measured value of ADC1
val_adc2_mv
INTEGER
pkt_type->0x101: Measured value of ADC4
val_adc2_mv
INTEGER
Other data storage purpose
ev_src
INTEGER
Source of the event
ev_id
INTEGER
Event ID
pal_type->5: 1.... .6 -> dice 16 -> MOVE ... etc. (see documentation for TWELITE CUE)
ev_param
INTEGER
Event Parameter
pkt_type
value
value1
value2
value3
val_vcc_mw
val_dio
ev_id
Mouse drag (graph area)
Move the display position when zooming in
Mouse drag (bottom scroll bar)
Move the display position when zooming in
Cursor →, ←
Move the sample display
Cursor up, down, wheel
Zoom in/out on sample horizontal axis
[LIVE>>]
Go to the one-second increment view that displays the latest arrival data
ASCII charavcters
If you enter a normal alphanumeric string directly, it will be switched accordingly on the screen.
BS
Delete the trailing characters displayed.
ENTER
The entered string is reflected in the database.
_uqid
INTEGER
continuation number used in the database
sid
INTEGER
int32_t
serial number stored in int32_t type." In the case of the serial number "8123abcd", the integer value of -2,128,368,691 is stored.
ts
INTEGER
The time the system received the packet, a timestamp value stored of type int64_t UNIX epoch (seconds elapsed since 1970).
sid
INTEGER
SID above
sid_text
TEXT
SID converted to hexadecimal string (for readability)
desc
TEXT
Auxiliary information corresponding to the SID, to be displayed together in a list, etc.
sid
INTEGER
SID above.
ts
INTEGER
Timestamp of last receipt
lid
Here are some excerpts from the last data received


[24Hr Data]
ts_msec
lqi
[List] <--> [24 hours] <--> [Live]
↓↑
[Select Year, Month, Date]