Device
| Node | Description | Inputs | Outputs |
|---|---|---|---|
| ble_connect | Connects to a BLE device by address and discovers its services. | address Text | handle Text |
| ble_disconnect | Disconnects from a BLE device and releases the connection. | handle Text | disconnected Boolean |
| ble_list_services | Lists GATT services and characteristics on a connected BLE device. | handle Text | services Json |
| ble_read | Reads data from a BLE characteristic. | handle Text, service Text, characteristic Text | data Text, bytes_read Number |
| ble_scan | Scans for nearby Bluetooth Low Energy devices. | duration_ms Number | devices Json |
| ble_write | Writes data to a BLE characteristic. | handle Text, service Text, characteristic Text, data Text | bytes_written Number |
| disconnect_all | Closes all serial ports and BLE connections opened by this app (does not affect system devices like headsets, mice, etc.). | closed Boolean | |
| gpio_read | Reads the state of a GPIO pin from a connected microcontroller via serial. | handle Text, pin Number, timeout_ms Number | value Boolean, raw Number |
| gpio_set | Sets a GPIO pin high or low on a connected microcontroller via serial. | handle Text, pin Number, value Boolean | sent Boolean |
| i2c_read | Reads data from an I2C device via a serial-connected microcontroller using Firmata protocol. | handle Text, address Number, register Number, num_bytes Number, timeout_ms Number | data Text, bytes_read Number |
| i2c_write | Writes data to an I2C device via a serial-connected microcontroller using Firmata protocol. | handle Text, address Number, register Number, data Text | sent Boolean |
| list_ports | Lists all available serial and USB ports on the system. | ports Json | |
| print_label | Prints an image to a TSPL2-compatible label printer (e.g. Nelko P21) over serial. | handle Text, image Image, width_px Number, height_px Number, width_mm Number, height_mm Number, gap_mm Number, density Number, copies Number, rotate Number, invert Boolean | printed Boolean |
| print_receipt | Prints an image to a thermal receipt printer via ESC/POS protocol over serial or BLE. | handle Text, image Image, width Number, service Text, characteristic Text | printed Boolean |
| serial_close | Closes an open serial connection and releases the port. | handle Text | closed Boolean |
| serial_open | Opens a serial port connection and returns a handle for read/write operations. | port Text, baud_rate Number, timeout_ms Number | handle Text |
| serial_read | Reads data from an open serial connection with a configurable timeout. | handle Text, timeout_ms Number, max_bytes Number | data Text, bytes_read Number |
| serial_write | Sends text data over an open serial connection. | handle Text, data Text | bytes_written Number |
ble_connect
Connects to a BLE device by address and discovers its services.
Inputs:
address(Text) — device address from ble_scan
Output: handle (Text) — connection handle
ble_disconnect
Disconnects from a BLE device and releases the connection.
Inputs:
handle(Text) — connection handle
Output: disconnected (Boolean) — true if disconnected
ble_list_services
Lists GATT services and characteristics on a connected BLE device.
Inputs:
handle(Text) — connection handle from ble_connect
Output: services (Json) — array of services, each with uuid and characteristics array
ble_read
Reads data from a BLE characteristic.
Inputs:
handle(Text) — connection handleservice(Text) — service UUIDcharacteristic(Text) — characteristic UUID
Outputs:
data(Text) — received text databytes_read(Number) — number of bytes received
ble_scan
Scans for nearby Bluetooth Low Energy devices.
Inputs:
duration_ms(Number) — how long to scan in milliseconds
Output: devices (Json) — array of discovered devices
ble_write
Writes data to a BLE characteristic.
Inputs:
handle(Text) — connection handleservice(Text) — service UUIDcharacteristic(Text) — characteristic UUIDdata(Text) — text data to write
Output: bytes_written (Number) — number of bytes sent
disconnect_all
Closes all serial ports and BLE connections opened by this app (does not affect system devices like headsets, mice, etc.).
Output: closed (Boolean) — true when all connections are released
gpio_read
Reads the state of a GPIO pin from a connected microcontroller via serial.
Inputs:
handle(Text) — serial connection handlepin(Number) — GPIO pin numbertimeout_ms(Number) — response timeout
Outputs:
value(Boolean) — true if HIGHraw(Number) — raw byte value
Notes: Sends Firmata REPORT_DIGITAL (0xD0) command.
gpio_set
Sets a GPIO pin high or low on a connected microcontroller via serial.
Inputs:
handle(Text) — serial connection handlepin(Number) — GPIO pin numbervalue(Boolean) — true for HIGH, false for LOW
Output: sent (Boolean) — true if command sent
Notes: Sends Firmata SET_DIGITAL_PIN (0xF5) command.
i2c_read
Reads data from an I2C device via a serial-connected microcontroller using Firmata protocol.
Inputs:
handle(Text) — serial connection handleaddress(Number) — I2C device address (7-bit)register(Number) — register addressnum_bytes(Number) — number of bytes to requesttimeout_ms(Number) — response timeout
Outputs:
data(Text) — hex-encoded response bytesbytes_read(Number) — number of bytes received
Notes: Sends Firmata I2C_REQUEST (0x76) read command.
i2c_write
Writes data to an I2C device via a serial-connected microcontroller using Firmata protocol.
Inputs:
handle(Text) — serial connection handleaddress(Number) — I2C device address (7-bit)register(Number) — register addressdata(Text) — hex-encoded bytes
Output: sent (Boolean) — true if sent
Notes: Sends Firmata I2C_REQUEST (0x76) write command.
list_ports
Lists all available serial and USB ports on the system.
Output: ports (Json) — array of available ports with name and type info
print_label
Prints an image to a TSPL2-compatible label printer (e.g. Nelko P21) over serial.
Inputs:
handle(Text) — serial connection handleimage(Image) — image to print (dithered to 1-bit)width_px(Number) — label width in pixelsheight_px(Number) — label height in pixelswidth_mm(Number) — label width in mmheight_mm(Number) — label height in mmgap_mm(Number) — gap between labels in mmdensity(Number) — print density (1-15)copies(Number) — number of copiesrotate(Number) — rotate image before printing (0, 90, 180, 270)invert(Boolean) — invert bitmap polarity
Output: printed (Boolean) — true if sent successfully
print_receipt
Prints an image to a thermal receipt printer via ESC/POS protocol over serial or BLE.
Inputs:
handle(Text) — serial or BLE connection handleimage(Image) — image to print (dithered to 1-bit)width(Number) — printer width in dotsservice(Text) — BLE service UUID (empty for serial)characteristic(Text) — BLE characteristic UUID (empty for serial)
Output: printed (Boolean) — true if sent successfully
serial_close
Closes an open serial connection and releases the port.
Inputs:
handle(Text) — connection handle to close
Output: closed (Boolean) — true if closed
serial_open
Opens a serial port connection and returns a handle for read/write operations.
Inputs:
port(Text) — serial port name (e.g. COM3, /dev/ttyUSB0)baud_rate(Number) — connection speed in bits per secondtimeout_ms(Number) — read timeout in milliseconds
Output: handle (Text) — connection handle
serial_read
Reads data from an open serial connection with a configurable timeout.
Inputs:
handle(Text) — connection handle from serial_opentimeout_ms(Number) — read timeout in millisecondsmax_bytes(Number) — maximum bytes to read
Outputs:
data(Text) — received text databytes_read(Number) — number of bytes received
serial_write
Sends text data over an open serial connection.
Inputs:
handle(Text) — connection handle from serial_opendata(Text) — text data to send
Output: bytes_written (Number) — number of bytes sent