Skip to content

Newer boards (e.g. Arduino Uno R4) might need ConfigurableFirmata #5

@banchan86

Description

@banchan86

Description

For a long time, the Firmata Arduino Library and in particular the StandardFirmata.ino sketch has been the recommended Firmata protocol implementation for setting up Arduinos so that they could be used in the Bonsai.Arduino package. To avoid confusion between the protocol, library and sketch, I will refer to this route as StandardFirmata from here on out.

However StandardFirmata has not been actively maintained (last version release Dec 13, 2022) and active development and support for newer boards has shifted over to the ConfigurableFirmata Arduino library.

A collaborator accidentally bought 20 Arduino Uno R4 Minima (released June 2023) so I had a chance to test it out and can confirm that this board does not work with StandardFirmata. There was also a comment in the bonsai-rx discord #support channel reporting the same issue for a Arduino Uno R4 Wifi (the other Uno R4 variant).

Proposed Solution

I did a quick test with ConfigurableFirmata and can confirm that it does work, but this needs to be extensively tested and also for other boards.

Steps to setup ConfigurableFirmata

  1. Update to latest version of Arduino IDE
  2. In Arduino IDE, go to Manage Libraries -> search for ConfigurableFirmata. Install all dependencies
  3. Go to File -> Examples -> Examples from Custom Libraries -> ConfigurableFirmata -> ConfigurableFirmata
  4. Upload sketch to your Arduino (I tested with Arduino Uno R4 Minima)
  5. Profit! (Just kidding).

You can use this test Bonsai workflow which generates a simple TTL pulse on one digital output channel and reads it on another channel to test the Uno R4 out in Bonsai. If you like to live dangerously like I do, you can write and read on the same Arduino by connecting digital pins 2 and 8 with a wire. Otherwise, its safer to use another Arduino to read/write (the workflow includes duplicate branches) or throw in a 220Ω–1kΩ resistor. You can also test it out with a Uno R3 as a positive control. Remember to change PortName to the correct device.

Test_R4.zip

Help Needed

  • It is unclear which other newer boards might still work with StandardFirmata, need ConfigurableFirmata, or some other Firmata implementation so if you happen to have newer boards and want to try this method out and test them, please report back on this thread with results.
  • It would also help if someone has time to verify all the pins or any other functionality that might have changed from the switch to ConfigurableFirmata. In theory it follows the same Firmata protocol as StandardFirmata.
  • Like the name suggests the advantage of ConfigurableFirmata is that you can mix and match different functions for a smaller footprint, faster runtime, etc but I have not tested dropping anything and have just used it out of the box. If anyone messes around with the customization, some reports here would also be appreciated.

Alternative Solution

We could wait for StandardFirmata to be updated. Although there have been some attempt to backport Arduino Uno R4 compatibility from ConfigurableFirmata to StandardFirmata (see link) that fix does not work and it is unclear when that would be ported over or if it will even make it to release.

Followup

If it does hold though, then I will raise another issue to update the pending docfx website and article to reflect this setup route for newer boards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions