Skip to main content

Serial Port Transport

Connects CycBox to a serial device: a USB-UART adapter, an RS-485 converter or a board's own UART. It is a byte-stream transport, so pick a codec that splits the bytes into messages: Line for text protocols, Timeout for unframed binary, Frame or Structured Frame for framed binary, Modbus RTU for Modbus.

Choose the port, then match baud rate, data bits, parity and stop bits to the device (8 data bits, no parity, 1 stop bit at 9600 or 115200 baud is the most common). The port list shows the ports found on this computer.

  • Permissions (Linux): the user needs access to the device node. Add yourself to the dialout group (uucp on Arch-based distributions) and log in again.
  • One program per port: close other serial terminals before starting the engine.
  • Unplugged adapters: if the port cannot be opened, CycBox keeps retrying (1 s, doubling up to 10 s) while the engine runs, so plugging the adapter back in resumes the connection.
  • Not available on Android.

A serial port connection using the Modbus RTU codec.

Configuration reference​

Config IDserial_port_transport
Selected byapp_transport = "serial_port_transport"
PlatformsLinux, Windows
LicenseFree

Serial port communication

Basic Parameters:

  • Port: Select the serial device to connect to (e.g., /dev/ttyUSB0, COM1)
  • Baud Rate: Communication speed, must match the device setting (common: 9600, 115200)
  • Data Bits: Number of data bits per character (typically 8 bits)
  • Parity: Error detection method (None, Odd, Even)
  • Stop Bits: Number of stop bits after each character (typically 1 bit)
  • Flow Control: Data flow control method (None, Software, Hardware)
SettingKeyTypeDefaultNotes
Serial Portserial_port_transport_portText (with presets)detected at runtimeRequired
Baud Rateserial_port_transport_baud_rateInteger (with presets)9600Required
Data Bitsserial_port_transport_data_bitsInteger choice8Required
Parityserial_port_transport_parityText choice"none"Required
Stop Bitsserial_port_transport_stop_bitsText choice"1"Required
Flow Controlserial_port_transport_flow_controlText choice"none"Required

Setting details​

Serial Port​

The available values are detected on the machine running CycBox (attached devices, generated ids), so no fixed default or option list is shown here.

Baud Rate​

Presets (any other value can be entered):

ValueLabel
12001200
24002400
48004800
96009600
1920019200
3840038400
5760057600
115200115200
230400230400
460800460800

Data Bits​

Allowed values:

ValueLabel
55
66
77
88

Parity​

Allowed values:

ValueLabel
"none"None
"even"Even
"odd"Odd

Stop Bits​

Allowed values:

ValueLabel
"1"1 Bit
"2"2 Bits

Flow Control​

Allowed values:

ValueLabel
"none"None
"software"Software
"hardware"Hardware

Example config​

Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.

{
"app": {
"app_transport": "serial_port_transport"
},
"serial_port_transport": {
"serial_port_transport_baud_rate": 9600,
"serial_port_transport_data_bits": 8,
"serial_port_transport_parity": "none",
"serial_port_transport_stop_bits": "1",
"serial_port_transport_flow_control": "none"
}
}