Firmata Protocol Support

Ardulink-2 version 2.2.0 introduces experimental support for the Firmata protocol — a well-established standard for communicating with microcontrollers from host software.

What Is Firmata?

Firmata is a generic protocol for communicating with microcontrollers from a host computer. It is widely supported and allows:

  • Digital pin read/write
  • Analog pin read/write
  • PWM output
  • Servo control
  • I2C communication
  • SPI communication
  • Pin mode configuration

The StandardFirmata sketch is the reference implementation for Arduino boards.

Arduino Firmware for Firmata

Unlike the custom Ardulink firmware, Firmata uses the standard StandardFirmata sketch:

Using Arduino IDE

  1. Open Arduino IDE
  2. Go to File > Examples > Firmata > StandardFirmata
  3. Select your board and port
  4. Click Upload

Using WebSerial

You can also upload StandardFirmata via the WebSerial Flasher or other browser-based tools.

Maven Dependency

<dependency>
    <groupId>org.ardulink</groupId>
    <artifactId>ardulink-core-firmata-proto</artifactId>
    <version>2.3.1</version>
</dependency>
Aspect Ardulink Firmware Firmata
Protocol Ardulink custom Standard Firmata
Custom messages Yes Limited
Tone support Yes Via Firmata extensions
Ecosystem Ardulink-specific Widely supported
Library support Ardulink-2 only Many languages
Active development Yes Yes (different project)

Use Ardulink firmware when you need full feature support and custom protocols. Use Firmata when you want compatibility with other Firmata-based tools or when portability across languages matters.

Protocol Specification

The Firmata protocol is documented at github.com/firmata/protocol. Key message types:

Message Direction Description
ANALOG_MESSAGE Both Analog pin value (0-127 per byte)
DIGITAL_MESSAGE Both Digital port state
SET_PIN_MODE Host → Arduino Configure pin mode
REPORT_ANALOG Host → Arduino Enable/disable analog reporting
REPORT_DIGITAL Host → Arduino Enable/disable digital reporting
START_SYSEX / END_SYSEX Both Extended message boundary

Next Steps