Linux Peripherals Transport
Uses the I2C, SPI and GPIO buses of the Linux board CycBox runs on, such as a Raspberry Pi, through the kernel's
device nodes (/dev/i2c-N, /dev/spidevB.C, /dev/gpiochipN). It works like the CH347 transport
without the USB bridge, with the same tools:
It is message-based, so no codec is selected.
Each bus is optional: leave a field empty to skip it, but configure at least one. The lists show the device nodes found on the machine. GPIO lines are numbered by their offset on the chosen chip. On a Raspberry Pi that is the BCM GPIO number, not the header pin number.
On a Raspberry Pi:
- Enable I2C and SPI with
sudo raspi-config(Interface Options), then reboot. - Make sure your user can open the device nodes. If it is not already in the
i2c,spiandgpiogroups, runsudo usermod -aG i2c,spi,gpio $USERand log in again. Without access, the connection fails when the engine starts.
Configuration reference
| Config ID | linux_transport |
| Selected by | app_transport = "linux_transport" |
| Platforms | Linux |
| License | Free |
Message-based I2C + SPI + GPIO over native Linux buses (each optional); drives sensors and LCD panels on boards like the Raspberry Pi
Embedded Linux peripherals. Provides an I2C bus, a SPI bus and GPIO from one connection; each is optional — leave a field blank to skip that bus.
I2C is triggered by messages tagged i2c_op, SPI by spi_op, and GPIO by
gpio_op (GPIO is driven from Lua scripts only). With SPI and GPIO configured the
transport can drive an LCD panel just like a CH347. GPIO line numbers are line
offsets on the chosen gpiochip (the BCM numbers on a Raspberry Pi).
Needs read/write access to the relevant device nodes (/dev/i2c-*,
/dev/spidev*, /dev/gpiochip*). Linux only.
| Setting | Key | Type | Default | Notes |
|---|---|---|---|---|
| I2C Bus | linux_transport_i2c_bus | Text (with presets) | detected at runtime | |
| GPIO Chip | linux_transport_gpio_chip | Text (with presets) | detected at runtime | |
| SPI Device | linux_transport_spi_device | Text (with presets) | detected at runtime | |
| SPI Mode | linux_transport_spi_mode | Text choice | "0" | |
| SPI Speed | linux_transport_spi_speed | Text | "1000000" |
Setting details
I2C Bus
The available values are detected on the machine running CycBox (attached devices, generated ids), so no fixed default or option list is shown here.
GPIO Chip
The available values are detected on the machine running CycBox (attached devices, generated ids), so no fixed default or option list is shown here.
SPI Device
The available values are detected on the machine running CycBox (attached devices, generated ids), so no fixed default or option list is shown here.
SPI Mode
Allowed values:
| Value | Label |
|---|---|
"0" | Mode 0 |
"1" | Mode 1 |
"2" | Mode 2 |
"3" | Mode 3 |
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": "linux_transport"
},
"linux_transport": {
"linux_transport_spi_mode": "0",
"linux_transport_spi_speed": "1000000"
}
}