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
- Open Arduino IDE
- Go to File > Examples > Firmata > StandardFirmata
- Select your board and port
- 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>
When to Use Firmata vs Ardulink Firmware
| 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
- Ardulink-2 Architecture — Module system internals
- Arduino Firmware — Standard Ardulink firmware
- Link Types — All transport options