Skip to content

Real time provider firmata

Peter Corke edited this page May 25, 2026 · 1 revision

Real-time provider: Firmata

Current status:

  • Provider scaffold exists.
  • Pin mapping/session implementation is not complete yet.

Implementation module: src/bdsim/blocks/io_firmata.py.

What exists now

  • Provider class registration (name = "firmata").
  • Handle types for analog/digital input/output.
  • Placeholder API shape for board session setup.

What is missing

  • Concrete board connect/startup flow (pyFirmata or equivalent).
  • Pin mode mapping (analog_in, analog_out, digital_in, digital_out).
  • Robust shutdown and reconnection behavior.
  • End-to-end tested examples.

Planned usage shape

from bdsim.realtime import BDRealTime

rt = BDRealTime(
    io_provider="firmata",
    io_provider_kwargs={
        "port": "/dev/ttyACM0",
        "baudrate": 57600,
    },
)

Setup notes

Serial port bring-up and permissions are shared with other serial devices. See Real-time provider: Serial transport setup.

Near-term recommendations

Until Firmata provider is completed:

  • Use rpi for direct Raspberry Pi GPIO control.
  • Use serial + TCLab where appropriate.
  • Use mock on desktop for scheduler and telemetry development.

Clone this wiki locally