Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Arduino on Firmata

Share your components here. First one to 100 wins!

Arduino on Firmata

Postby snaut » Sun Sep 28, 2014 8:09 pm

Hey,

The Firmata Component has moved into the Palette starting with build 088.50180

attached is a little experiment to send and receive stuff to and from the Arduino using the Firmata API.
Firmata seems essentially to be an Arduino sketch which let's yuo configure and control the Arduino using messages formated as Midi. A good introdction for whoever is interested can be found here: http://www.firmata.org/wiki/Protocol

So what does it let you do? Well, first:
  • hook up your Arduino
  • upload the StandardFirmata Sketch from the Examples/Firmata folder
  • after successful upload start the attached TouchDesigner toe and go into /project1/firmata and select the right COM Port on the serial1 DAT
  • toggle thee Active Parameter of the serial1 DAT off and on --> you should be seeing messages coming into the serial1 DAT
now go one level up to /project1, here you find:

  • a pinCapabilities DAT telling you what each pin of your Board can act as
  • a pinSettings DAT telling you what each pin is currently set to
  • a firmataVersion DAT informing you off the Firmata Sketch and Version uploaded to the Arduino as well as
  • an analogValues and digitalValues CHOP, showing you the pins output
on the input side to the firmata COMP you find:
  • a constant CHOP called values to set pins to certain values
  • a constant CHOP called mode to tell the pin what it should act as (there is a Table DAT called modes docked to the firmata COMP informing you of what value maps to what mode)
  • as well as a Report Analog and a Report Digital Button which enable feedback from the Arduino to TouchDesigner.

Not yet implemented are the I2C and Shift Modes, if anybody has information on how to do that best, I'd be really interested to see this working
Also I ran into a problem with my Arduino Mega, not all pins would report correctly, wonder if my mega somehow is faulty? Further when connecting a servo I had sitting here for a long time, the Arduino would reset, so the servo functionality is not fully tested yet.

If you like to further develop the extension or this patch, the Firmata class sits in /project1/firmata/local/modules/firmata

Anyhow. I hope this is good use for some people. Firmata seems to be great to get a quickstart in using the Arduino as a pure input/output converter for all kinds of Sensors and Devices and keep all the logic inside TouchDesigner.

Cheers
Markus
User avatar
snaut
Staff
 
Posts: 904
Joined: Mon Nov 12, 2007 6:21 pm
Location: Toronto

Re: Arduino on Firmata

Postby rodberry » Tue Sep 30, 2014 7:44 am

I'd been meaning to ask if anyone had tried Firmata with Touch. Thanks Herr Snaut!

I have used PDuino a lot which is a custom firmata to interface arduino directly with PureData.
http://en.flossmanuals.net/pure-data/se ... ng-pduino/

it would be worth having an arduino CHOP to use firmata flashed to an arduino to make it a dumb I/O board for touch.

thanks again, will have a play with it on the weekend.

Rod.
User avatar
rodberry
 
Posts: 1068
Joined: Wed Nov 14, 2007 2:51 pm
Location: Hobart, Tasmania, Australia

Re: Arduino on Firmata

Postby snaut » Tue Sep 30, 2014 12:19 pm

Hi Rodney,

that's what the COMP is trying to be, a fairly simple way to read and write to/from a Arduino which has been loaded with the standard Firmata sketch.

Let me know if it is of any use to you.

cheers
Markus
User avatar
snaut
Staff
 
Posts: 904
Joined: Mon Nov 12, 2007 6:21 pm
Location: Toronto

Re: Arduino on Firmata

Postby stevenmb24 » Mon Jan 19, 2015 1:55 am

Thanks Snaut!!!
This is Awesome!
stevenmb24
 
Posts: 25
Joined: Tue Apr 22, 2014 12:17 pm

Re: Arduino on Firmata

Postby bLackburst » Sun Jan 25, 2015 1:48 am

Does anyone know how to create tones on a piezo module using this? I tried sending the digital pin a square lfo but I can't get anything resembling smooth tones.
bLackburst
 
Posts: 334
Joined: Thu Sep 01, 2011 3:56 am
Location: Melbourne, Australia

Re: Arduino on Firmata

Postby snaut » Thu Apr 16, 2015 11:19 am

Hey,

for the piezo speaker you would have to use PWM mode.

cheers
Markus
User avatar
snaut
Staff
 
Posts: 904
Joined: Mon Nov 12, 2007 6:21 pm
Location: Toronto

Re: Arduino on Firmata

Postby cod65 » Mon Aug 31, 2015 11:59 pm

Hi Snaut!.
First, thanks for your pioneering work. I am looking into firmata as an (hopefully) simpler way to interact with steppers (simpler than serial msg parsing anyway ;) ).
Naturally I have a bunch of questions.

1)I was apparently under the mistaken impression that firmata would be more like a 'firmware' mod of the Arduino, but it seems it is 'only' a sketch upload. (Maybe that is all that is really possible with an arduino anyway? Or maybe Im just not unnerstanding the Arduino paradigm correctly?)....

2)Why do they use the ancient MIDI protocol? (maybe I dont really want to know, as once the talk turns to Most significant/Least Significant bits/ nibbles et al, my eyes kind of glaze over and I try my best to understand .....maybe I dont need to know thks to your work!)(why not a more modern protocol like OSC, as example ?)

3)is there a way to communicate to a firmata'd Arduino other than serial/USB? Ethernet perhaps ?

4) I gots a warning msg from my Diecimila: 'low memory, stability problems may occur' - looks to be about 84% full after uploading the sketch. Is my dfiecimilla just too old and small you think ?

any insights aprec.
<.o'>
cod65
 
Posts: 555
Joined: Mon May 10, 2010 2:55 pm

Re: Arduino on Firmata

Postby cod65 » Tue Sep 01, 2015 12:09 am

I will answer #4 myself: diecimilla is old and small. I switched to an UNo and the problem went away
<.o'>
cod65
 
Posts: 555
Joined: Mon May 10, 2010 2:55 pm

Re: Arduino on Firmata

Postby rob » Wed Sep 02, 2015 9:56 am

1) imo, its great that its a sketch, in that it allows users to upgrade/tweak/develop it using the exact same set of tools they use for any other Arduino development.

2) My guess is because MIDI is a very simple protocol without much overhead (all messages start with a value > 127) etc. Things like OSC would require much more sketch space devoted to parsing.

3) I don't have any experience with them, but I found a few references online about firmata branches supporting ethernet. Maybe the arduino forum is the best place to ask.

4) Haven't seen that before. Wonder if its really a problem, or if firmata memory usage is relatively constant (as most embedded systems usually are).

Rob.
User avatar
rob
Staff
 
Posts: 1686
Joined: Tue Nov 13, 2007 1:14 am

Re: Arduino on Firmata

Postby computersarecool » Thu Sep 03, 2015 12:21 am

@cod65

I have used Firmata for a while and think it is great.

If you are interested in Firmata I would encourage you to checkout the wiki: http://firmata.org/

It answers your questions. To chime in on what @rob said:

1.
The Firmata project is intended to be a Firmware for arduino, (that's how it got the name) and I think it does a pretty good job.

Everything from Touch to a browser to MAX / MSP can interact with Firmata all using the same sketch on Arduino.

2.
http://firmata.org/wiki/Design_Issues Answers this exactly. It goes over why the original author chose to use MIDI instead of HID or OSC. Hint, Rob was right.

3. I have communicated with an Arduino running Firmata wirelessly over Bluetooth, however, that was still via serial. You can do serial over lots of transports.
computersarecool
 
Posts: 184
Joined: Mon Aug 26, 2013 5:15 am

Next

Return to Shared .tox Components

Who is online

Users browsing this forum: shieman and 2 guests