Pages: [1]   Go Down
Author Topic: Arduinio FIO with XBEE and Funnel IO - Config  (Read 6085 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So. I am helping a performance artist interface some battons to Max.MSP. We have everything working great except the Funnel IO configuration of the nodes at startup\power on.

Currently we have to run and re-run the processing server code - sometimes many times - before the digital IO configuration works. This seems to be due to firmata not getting told to configure - or not being told at the right time - or similar.

Funnel IO is essentially closed source - I cannot see the code anywhere (not the current version anyway).

We are getting desperate - this thing has to travel from Chicago to NYC. I cannot move on to finishing the hardware fabrication until the prototypes work!

Has anyone gotten configurations to work correctly with procession\fio\funnel IO\ xbee ? The unpredictable nature of the problem (it takes random re-runs to get the processing funnel IO server to configure the nodes) is maddening!

Thank you! thank you! (In adavance)

The relevant code in processing:
Code:
// Creates FIO Funnel Object
Fio fio;

PFont myFont;
// Creates MaxLink Processing to MAX/MSP interconnection Object "bouncer"
MaxLink link = new MaxLink(this, "bouncer");

void setup()
{  
  size(600,600);
  frameRate(25);
  myFont = loadFont("CourierNewPSMT-24.vlw");
  textFont(myFont, 24);
  int[] orbIDs = {1,2,3};

Configuration config  = Fio.FIRMATA;
    config.setDigitalPinMode(4,Fio.IN);   // Left Glove In 1
    config.setDigitalPinMode(5,Fio.IN);   // Left Glove In 2
    config.setDigitalPinMode(6,Fio.IN);   // Right Glove In 1
    config.setDigitalPinMode(7,Fio.IN);   // Right Glove In 2
    config.setDigitalPinMode(8,Fio.IN);   // Right Glove In 3                    
    config.setDigitalPinMode(9,Fio.PWM);  // Red LED Out
    config.setDigitalPinMode(10,Fio.PWM); // Green LED Out
    config.setDigitalPinMode(11,Fio.PWM); // Blue LED Out  
    config.setDigitalPinMode(12,Fio.IN);  // Left Glove In 3  
fio = new Fio(this,orbIDs,config);
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It was an obscure question..

Anyways: for anyone looking into this question in the future: the processing library seems to have trouble initializing\configuring firmata. I cannot tell if it is because of errors in the compiled libraries, or other issues -but the  0021 version throws a few compiler errors.

Our solution was to create a flash interface that does the required configuration .

The flash library is far nicer than the processing one. We are stuck with processing for the MAX/MSP integration though. Getting Flash to talk to max/msp is surprisingly difficult.
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

do you need to use Firmata, i had some random issues with it and gave up and starting writing only the specific functionality i needed through a super basic protocol on the processing side.

careful not to send too much in one go, the buffer is super small (took awhile to find that problem)

 smiley _J
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah.. Funnel uses a 'special' version of firmata. I think the differences are really small though.. Both funnel and firmata are based on something called OSC - which is a pretty complicated thing.

We do not need firmata, but we do need a robust 2-way communication between max.msp and arduinos.

I started with a fully custom solution - but the code was getting over-wrought and the scope of  the project does not really have support for develping a full xbee wireless communication system.. We have about 30 parameters going to each arduino\xbee...

The problems all went away after using the flash library to configure the devices. This problem ate up like 6 hours of my life. The extremely cordial emails I sent to the funnel people were not answered.

I hope they enjoyed their grant. Maybe it should have gone to someone who cares abut their work actually working.
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i've had good luck with an OSC library that will take incoming OSC messages and forward it to a processing function. (i think it's the standard OSC library for processing) you could use this functionality to forward simple serial messages to your arduinos??

i'm guessing your OSC message is being built in MAX/MSP , then from there, where is the OSC message being parsed? (is this what funnel does?)  forwarded the parsed message via an
 xbee->xbee link to the connected Arduino?

the reverse direction, the link could be setup to receive in processing, the OSC bundle could constructed in processing to be broadcast so that Max/Msp would be listening?

maybe... just some thoughts on the problem, if none of this is helping let me know  

Jon

Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The system we have arrived at works this way:

1) There are arduino FIO boards with XBEEs in API mode. these FIOs have the special 'Funnel' version of Firmata. The difference between standard and funnel firmata is that the Funnel version keeps resending until it gets an OK signal back from firmata.

2)We have a USB serial\TTL to XBEE API in oordinator mode. (The master XBEE) No arduino Here

3) We then have processing running a sketch with 'maxlink' - an easy to use library that allows for processing to talk to max very easily.

4) In Max/MSP we have a maxlink object. It works very well with processing. This is, I think, a basic method of moving data. Not quite OSC.


the problem I was having was that my devices seemed to work perfectly - but not right away. I was having to start and restart the processing server over and over - sometimes dozens of times. then all of a sudden it would work. Sometimes it worked right after only 1 or 2 restarts. So I was very frustrated and came here looking for help.

In the end we do the following:

1) Turn on\plugin coordinator Xbee\USB
2)Turn on all Xbee Nodes (arduino FIO boards)
3) Start the standalone Funnel server
4) Use a flash movie which configures and tests each FIO node
5) Close flash movie and standalone funnel server
6) Start Max/MSP
7) Start processing movie

AND IT WORKS!

Quite convoluted. I am trying to get the flash movie itself to work with max - but it is not going easily.

I can share my code if you want. It will eventually be open sourced - the whole project will be including custom PCB designs - but in the meantime we are keeping a wrap on it.  Let me know if you are curious.

Robert

Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Logged

Pages: [1]   Go Up
Jump to: