Updated 2013-05-22 16:22:33 by pdt

Tcl Binding to Firmata edit

Areas (De)serialization, RPC, Remote control
Good if student knows Tcl, C
Priority Medium to Low
Difficulty Medium to Low
Benefits to the student
Benefits to Tcl Extend Tcl's glueing reach to hardware in general, the Arduino ecosystem in particular
Mentor ?
Related Project Ideas Possibly GSoC Idea: Common (De)Serialization Infrastructure

Project Description edit

Quoting the Firmata website:
... is a generic protocol for communicating with microcontrollers from software on a host computer.
It is intended to work with any host computer software package. Right now there is a matching object
in a number of languages. It is easy to add objects for other software to use this protocol.
Basically, this firmware establishes a protocol for talking to the Arduino from the host software.
The aim is to allow people to completely control the Arduino from software on the host computer.

The objective of this project is to create a Tcl binding to the protocol and library, so that Arduino can be controlled from Tcl scripts.

For inspiration, bindings for other languages (Python, Perl, ...) can be found at http://firmata.org/wiki/Download

Note: Given Tcl's builtin binary command it might be possible to write the binding purely in Tcl, although a C implementation is likely faster.

As there is likely some data (de)serialization component inside of the protocol it might be useful to coordinate with any student working on GSoC Idea: Common (De)Serialization Infrastructure and related projects.

Requirements: edit

  • ...
  • ...

For a Tcl Firmata Implementation see:


And in particuler see the examples directory.

It is a work in progress, but enough of it works to get/set digital/analog pins. I still need to do servos, I2C, some documentation, etc. I've been using it with an Arduino Uno, and also a bit with an Arduino Leonardo.

(1) Connect Arduino to PC (2) Start Arduino IDE (3) Program Arduino with StandardFirmata from Examples menu in Arduino IDE (4) Run Tcl scripts to control Arduino pins

AK - 2013-02-22 22:31:54

So I guess we should change the objective to complete this project ? Or should I fully retract the idea ?

Might be useful to get the firmata people to list your project on their download page. ... Wait, it looked like a wiki. You may be able to add it yourself there.

And to put it up here on our wiki also (Firmata page, Arduino page, others ...)

pdt I started this project late last year, and expect to have a complete Firmata implementation in a month or so. It's my current weekend Tcl project, so one weekend in the not too distant future, it will likely be finished. My intention is to update the Firmata Wiki page once it's complete. And I'll create a Tcl wiki page as well.

I guess if there is a Tcl Firmata implementation already in existence, and it works fine, then there may not be a huge incentive to write another one. Having said that, there are a couple of Python and a couple of Perl implementations referenced on the Firmata Wiki.

pdt 2013-05-22 tfirmata is now complete.

escargo - Are the serialization/deserialization partitioned separately enough that a different (which is to say, common) package to do the serialization could be dropped in? Alternatively, is the serialization done in a general way that could be used for other serialization needs?

pdt No, I've written the code using simple message passing on the serial stream that connects to the Arduino, rather than using a (de)serialization mechanism, as described in the Common (De)Serialization Infrastructure GSoC idea. I should say that tfirmata was not written with this GSoC idea (Tcl Binding to Firmata) in mind, I started it before this GSoC idea was proposed, and serialization (as per the GSoC idea) wasn't something I was looking at.