Firefly

Firefly offers a set of comprehensive software tools dedicated to bridging the gap between Grasshopper, (a free plug-in for Rhino) the Arduino microcontroller and other input/output devices. It allows near real-time data flow between the digital and physical worlds – enabling the possibility to explore virtual and physical prototypes with unprecedented fluidity.

Load Previous Comments
  • kleerkoat

    @Andy... this is really odd. it didn't work with my laptop's camera, plug in the PS Eye, and the laptop camera then works and it doesn't use the PS Eye.  Tried disabling the laptop camera and it stopped capturing.  No complaints, just thought i'd share that oddity. Main thing is, I can get it working now!

  • Mohammad Azinkia

    Thanks andy!

  • Carlos B.M.

    Hi!!!

    I'm having problems With the "UNO READ": it 's red all the time and no data is collected. I can "Write" and control manually some Leds,  but not through the data collected by my sensors. I have developed an equalizer definition, And I need to control it With a sound sensor.

    Even When I change the position of the USB in other sockets, always recognize that I'm using COM 3. Is this normal??

    I hope you could help me to make it work, before Friday! It's my project delivery day.

    Thanks,

    Carlos

  • Andy Payne

    Hi Carlos,

    For future reference, it's probably better to start a discussion (above) for more detailed questions... that way we can start a thread about the topic and track any questions all the way through.  Nevertheless, the description of your problem makes me think that for some reason the data being sent from your arduino isn't being formatted correctly, and thus the Uno Read component is throwing an error when the incoming data doesn't match the expected format.  You may have already tried this, but can you double check that you have loaded the Uno Firmata properly onto your board.  You might have loaded the Mega Firmata onto your Uno board, in which case it may not be sending the right data over to Grasshopper.  To see if the firmata is working properly, load it onto your board and then launch the serial monitor in the Arduino IDE (make sure your port is closed in Grasshopper and that the serial monitor baud rate is set to 115200).  You should see a long string of data (separated by commas) streaming down the page.  That is the string of data that is being sent over to Grasshopper... so if this is working properly, then you should be able to open the port in Grasshopper and then use the Uno Read component to retrieve that data and parse it up.  

    If this doesn't work, could you post a screen shot of your circuit, or provide more information about what type of sensor you are using?  You mentioned a sound sensor (is that a microphone?).  Hopefully we can figure this out before your deadline (although I'm currently out of town and do not have regular access to my computer... so I may be a little less responsive than usual).

    Cheers,

    Andy

  • Carlos B.M.

    Ok Andy!! thank you very much for your suggestions, any way I changed my strategy, and I have used an other arduino board in the computer of my partner, to save up time. I will check forward these steps to try to knwo What-the-Fck is going on with mine!

    Thanks for all!!

  • CarloMaria Ciampoli

    This is not really the way it should look, right?

    Is Firefly supported on R5 64-bit?

    Thanks Andy

  • Andy Payne

    Hi CarloMaria,

    Unfortunately, Firefly isn't yet supported on 64-bit applications.  Well, to be more accurate... the computer vision and audio tools aren't supported on Rhino 5 64-bit.  This is because the C_sawapan_media.dll which is what Firefly uses to tap into the video capture devices and microphones isn't compiled for 64-bit applications (this was noted as a known bug in the ReadMe.txt file in the download zip file).  It's on the list of things to work on over the next few months (it's actually a relatively big task to update that library)... but for now, if you want to use the Computer Vision and Audio tools, you have to use either Rhino 5.0 32-bit or Rhino 4.

    Sorry for the confusion.

    Cheers,

    Andy 

  • CarloMaria Ciampoli

    Thanks for your reply Andy!

  • Steve Moody

    Hey Andy, my Firefly tab looks similar to CarloMaria's, and I wanted to make sure there isn't something I'm missing.  I've never been able to use the vision or audio tools in rhino 5, but the OSC components were invaluable to me and were working fine in 64bit rhino 5 until I upgraded to grasshopper 0.9 and the timer attached to the listener started going haywire.  Are the OSC components also broken in 64bit now?

    Thanks!

  • Andy Payne

    Hey Steve,

    Sorry to hear your having trouble.  Are you using Rhino 5 32-bit or 64-bit?  Just curious.  All of the components should work in 32-bit and the Arduino, Networking, and Utility tools should work in both versions.  I've tested them in Rhino 5 and they work on my machine.  If your screen looks like CarloMaria's, can you double check that all of the .gha files and .dll's have been unblocked.  To do this, right-click on each of those files (included in the installation folder) and select Properties.  On the pop-up menu, at the bottom of the page, you should see a button that says Unblock (this only appears if they are currently being blocked).  For some reason, downloading files off the internet causes some of the files to get blocked... and Rhino 5.0 is more picky about loading them in that instance.  Let me know if that helps.  Also (and I found this out recently from another user)... it's better if you don't have both 32-bit and 64-bit versions installed on your machine at the same time.  It seems that sometimes this can cause a conflict too.  When the other user uninstalled the 64-bit version, everything loaded fine in the 32-bit application.

    There' haven't been any major changes to the OSC components.  I did add a couple of features mainly to parse up some of the messages sent from other applications... notably from GyrOSC (http://www.grasshopper3d.com/video/gyrosc-kangaroo).  Some of the messages are sent as lists of 4 values (like the quaternions sent in that app) or lists of 9 values (like the matrices sent using that app).  Anyway, other than adding datatype parsers for these, I didn't change anything else about the component... so it should work as before.  Let me know if you're still having trouble.

    Cheers,

    Andy 

  • Steve Moody

    Thanks for the quick reply,

    I am using R5 64bit, the arduino and utility tools appear, but no networking, and none of the .dlls are blocked.  When I boot up Rhino 4, all of the components are there.  I'm going to try to reinstall to see if I can get the networking stuff into R5, as that's really what I need.

    On a somewhat related note, I'm trying to upgrade so I can try the updated osc listener because I ran into problems with this component when I upgraded to grasshopper 0.9.  After the upgrade, the output of the osc listener toggles between the received data and an empty list at the rate of the attached timer.  Before it would simply update the values based on the timer, but now it seems to clear all the values and reload them with each tick of the timer, and this breaks the rest of my script.  Is there a way to avoid this?

    If you have any tips they will be much appreciated, otherwise I think I will just downgrade both grasshopper and firefly till everything is worked out.

    Thanks again!

  • Andy Payne

    Hi Steve,

    I think downgrading to Rhino 5.0 32-bit should solve the issue with the toolbar.

    As for the OSC problem... Do you think you could send me a file that shows the issue you described.  In theory, nothing in the list should be removed (and re-added) since the messages are stored in a dictionary (key, value) and only updated if the incoming message key matches one already stored in the dictionary.  Again, nothing (from a Firefly perspective) has really changed in that regard.  Perhaps something in the Grasshopper core changed, which is causing this issue.  If you have a working file that you could send... that would be helpful so I could try to diagnose the problem.

    Cheers,

    Andy

  • Steve Moody

    I'm unaware of how to link a file in one of these posts so I'll send an email with the gh file and the TouchOSC file I've been using with it to the  info@fireflyexperiments.com address for you to check out.

    Steve

  • David Stasiuk

    I'm trying to send timer-triggered strings through the quad stepper motor controller and am having some difficulty...it will work for several timer steps, and then simply stop driving the motors...so, for example, every second I'd like to pulse my 1st motor by -250 steps using a 1000 max speed and 1000 acceleration. The string list goes as follows:

    -250,0,0,0,1000,1000,1,0

    -500,0,0,0,1000,1000,1,0

    -750,0,0,0,1000,1000,1,0

    -1000,0,0,0,1000,1000,1,0

    etc.

    Using Giulio Piacentino's "theEngine" script to drive a list selection of these string instructions, one by one, results in the motor being correctly pulsed for a variable number of changes in the timer value (which is actually dependent on the timer interval itself...the longer the interval, the fewer pulses will work...in this case, if I set the interval at 1000, 8 pulses work, if I set it at 100, 42 pulses work...so strange).  But really I'm trying to feed quite a long list of changes through...we're using this to drive a wire bending machine that relies on a feeder motor, a z-rotation motor, and a bending motor.

    So the motor runs for these few pulses, then simply cuts out, although the arduino LED that indicates it's reading incoming information continues to pulse along with the timer.  Anyone have any idea what may be going on?  Something about the buffer in the arduino firmata script getting overloaded?  I have no idea!

  • Andy Payne

    Hi David,

    I haven't seen this behavior before... but I haven't used the Engine component much (since David re-wrote the GH Timer some time ago)... although I can see the benefit of using it because of the customized timing intervals.  Out of curiosity... does the number your sending to the motor fail at a given number? Say, something outside the bounds of -32,768 to 32,767.  Or does it just fail after a given number of intervals?  Do you want to share a definition?  Also, it might be helpful to start a discussion post on this topic so we can keep all of the comments in a specific thread.

    -Andy

  • Philipp

    it will be really nice not only to test colors for similarity but also find a most similar color in the list

  • lmnts

    I'm trying to get more speed on a stepper motor through the Quadstepper Driver.  The max speed I can get at the moment for a Vexta Nema 17 (http://www.interinar.com/vexta-px243m-03aa.html) is about .3 rotations per second.  If I test the quad stepper on a smaller stepper like this one ((http://robotics.reefat.com/wp-content/uploads/2008/08/PF35T-48L4.pdf), I'm able to get faster speeds.

    At first I thought this was a hardware/power supply issue, but I tested a sample sketch from this site: http://lusorobotica.com/index.php/topic,106.0.html on the Vexta NEMA 17 and was able to get the increased speeds I was looking for.

    I can't get higher speeds than .3 rotations per second using the Quadstepper Component.  Is there any way there a line in the code which is limiting the max speed?  

    Thanks for any help.

    -Erick

  • philipp hornung

    hi,

    i am new to arduino/firefly..

    and trying to build a kinetic modell, run two-axis's each by a stepper motor.

    thats the hardware i am using:

    2x stepper nema17

    http://datenblaetter.physicalcomputing.at/StepperNEMA17.pdf

    ---

    arduino mega2560 r3

    http://arduino.cc/en/Main/ArduinoBoardMega2560

    ---

    2x stepper drivers polulu

    http://www.pololu.com/catalog/product/1201

    http://www.pololu.com/file/download/a4983_DMOS_microstepping_driver...

    i tried to do the wiring like shown in this picture:

    http://www.physicalcomputing.at/.media/825136296502.png

    and here you can see the wiring in my setup:

    i tried to upload the quadstepper firmata onto my arduino board but without success. (uploading the firefly firmata seems to work on the first look.)

    i allways get the following errors shown in the screenshot.

    what i am doing wrong? is there something incompatible... what could be the problem?

    i hope someone knows the problem/a solution/hint..

    thank you in advance!

    philipp

  • Andy Payne

    Hi Phillip,

    Have you installed the Accel Stepper library?  There is a ReadMe.txt file included in the Stepper folder which explains how to do this.

  • philipp hornung

    hi andy,

    thank you for your quick reply!

    yes, i had installed the accelstepperlib..

    what else could it be.. any idea?

    thank you

  • philipp hornung

    ..thats outlined while trying to run firefly's quadstepper definition:..any clue?

    thank you!

  • Andy Payne

    Hi Phillip,

    No, I do not think it has anything to do with the Code Generator (in your last image).  The code generator is unnecessary unless you want the arduino to run autonomously (and not connected to your computer).  As long as your board is connected to the computer via a USB cable, then we can send serial information back and forth.... so we can just use Firefly natively through Grasshopper.

    I think the main issue is uploading the code onto your board.  Nothing will work properly if the Quad Stepper sketch isn't loaded onto your board.  In looking at the screenshots you've posted, it looks like all of the Firefly sketches (including the Firefly Firmata, Quad Stepper Sketch, and Wii Sketch) are located in your libraries folder.  However, these should be placed in the root Arduino folder (in MyDocuments/Arduino)... not inside the libraries folder.  You still need the libraries folder there, and in that folder should be the Accel Stepper library... but the Firefly sketches should be placed in the root sketchbook folder.  I'm not exactly sure if this is what's causing the issue... but when you open the Quad Stepper sketch, you shouldn't see the other tabs (AccelStepper and FireflyFirmata) like it does in the original screenshot you posted.  I think it's trying to load these sketches as well, and causing a conflict.  Try the suggestion above and let me know if that fixes your problem.

    HTH,

    Andy

  • philipp hornung

    hi andy,

    great.. now it seems to work!

    ..and the upload worked too! thanks mate! :)

    but unfortunately my setup is still not working.. wondering why...

    have to check the polarity of the steppers... hmm..

    but thank you so far andy!

    will post something if i manage to get it workin..

    best

    philipp

  • philipp hornung

    andy,

    btw.. do you got experience with the polulu stepper driver? ;)

  • Andy Payne

    No.  Unfortunately, I haven't tried that particular driver.  But as far as I know, it should work with the Firefly Quad Stepper sketch.  Are you still having difficulty?  BTW, it might be best to start an actual discussion thread (above) instead of on the general message board... that way we can track the entire conversation.

  • philipp hornung

    yes, as far as i read thru the documentations.. it should work as well.

    sorry.. you are rigth.. new thread.

  • Miguel Vidal

    Hello! As there is a keyPressed component, is there other one for mousePressed?

    what windows functions are you using for this tools in case I would need to use them in a script?

    thanks!

  • Andy Payne

    Hi Miguel,

    The IsKeyPressed component makes use of the built in User32.dll Microsoft library (http://en.wikipedia.org/wiki/Microsoft_Windows_library_files)  Once this library is imported into the project, you can tap into key events (and potentially other events... although I'm not sure this is entirely necessary for mouse events... Grasshopper is already doing some stuff for mouse events).  

  • Miguel Vidal

    Hi Andy!

    Thanks for your reply, I´ll try that.

    One more question: in the last version of Firefly, did you erase the functions for sound management?

  • Andy Payne

    What do you mean, erase the functions for sound management?  Are the audio components for Firefly not showing up?

  • Miguel Vidal

    Exactly!

    After installing the latest version of Firefly, the "Audio" Tab is not there.

  • Andy Payne

    Are there other tabs missing (ie. Computer Vision)?  What version of Rhino are you running?

  • Yoshi Fukumori

    hello Andy! I have the same problem, I have Rhino 5 in 32 and 64, after installing the latest version of firefly the audio tab, computer vision tab and conexion tab are missing. 

    I check the component folder and all the files are unblock.

    thanks for your help and as always thanks for sharing

    your knowledge! :)

  • Andy Payne

    Hi Yoshi and Miguel,

    Sorry to hear your having troubles.  It seems like for whatever reason it's not recognizing the Firefly_X.gha (which contains all of those components).  My hunch is that the installer is not overwriting the existing files (even though that is set in the installer settings).  Can you both try to manually delete all the existing Firefly files and dependencies (including the C_sawapan_media.dll) and try to re-install.  I think if the files are not there, then the installer will copy the new files and it should work (at least I hope).  Can you try this and report back.  Thanks.

  • Yoshi Fukumori

    Hello Andy! it works for 64, but for 32 I still have the problem. 

  • Igor

    Hi Andy!

    Is there a way to get sound from stream video (Internet video,Skype...) and from Video Player not from microphone only?

    At reading attempt from MusicXML file the error stands out. What is wrong?

    Example of MusicXML :    LVB_OP18_NO1_M1.xml

  • Andy Payne

    Hi Shahriar,

    Have you made sure you have successfully uploaded the Firefly Firmata on your board before running your GH definition?  Also, is there a reason you changed the baud rate to 9600?  The baud rate needs to be the same as what is set in the Arduino Sketch.  For the Firmata it is 115200... unless you changed this specifically, then you should probably use the default value of 115200 in the Open Port component.  This could be possibly what's causing your error.

  • Matt O'Brien

    Hi Andy,

    Having trouble with the Code Gen in the latest grasshopper 9.0056..

    getting this "controlknob" error with any definition,( no control knob component is being used) :

    Solution exception:Could not load type 'Grasshopper.Kernel.Special.GH_ControlKnob' from assembly 'Grasshopper, Version=1.0.0.20, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803'.

  • Andy Payne

    Hi Matt,

    This control knob issue is a minor issue that popped up with the latest release of Grasshopper.  It seems David changed the naming convention of the knob (it used to be called Dial).  I've fixed this in the next release... but I don't think it should cause you any issues with still using the Code Gen.  Are you still having trouble?

  • Matt O'Brien

    Hi Andy,

    Thanks for the reply, although it doesn't seem to matter what definition I use, even your "firefly_05_CodeGen" example throws the same error and no code is produced, and there is no knob/dial to be found?

  • Andy Payne

    Yes... this will happen because the Code Gen (which was compiled against a different version of GH which used to call the Control Knob a Dial).  So, even though you aren't using a knob... the code gen when it compiles itself into a component... has a definition which is trying to specify what happens when it detects a knob in the definition.  When David updated GH, he changed the name... so the SDK no longer knows what a dial is.  I've changed this in future versions of Firefly so it shouldn't be a problem once I release a new version.  Still... I think it should just be throwing you a warning.  Is it an actual error (where the Code Gen doesn't work at all)?

  • Matt O'Brien

    yeh it seems to be an actually error (red not orange) and no code gets produced..? looking forward to the next release anyhow, will it have leap motion connectivity by any chance? cheers!

  • Andy Payne

    Hmm... I didn't realize it was actually throwing an error (just a warning).  I will try to release a fix very soon.  And yes... I'd like to release the Leap component in the next version (along with some other new components).  I just have to check with the Leap license agreement and make sure I can release the accompanying .dll files that the device uses.  I will look into this.

  • Luke Gehron

    I am having the same problem as Matt with the error: 

    Solution exception:Could not load type 'Grasshopper.Kernel.Special.GH_ControlKnob' from assembly 'Grasshopper, Version=1.0.0.20, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803'.

    Any idea when the fixed version of the component will be out?

  • Andy Payne

    Hi Shahriar,

    Yes, it definitely should be possible.  In fact, the QuadStepper firmata already uses the AccelStepper library which is also a Adafruit library, so I imagine it's just a matter of using the correct methods for the library you intend to import.  Best of luck.

  • Nathan Barnes

    Hey

    Wondering if I can get some assistance. I'm trying to get the stepper and reset pin of the delta stratum printer working. I can run the stepper with the quad stepper sketch and I can run read the reset pin if I load the firmata, but I cant seem to load both at the same time.

    Any ideas how to better go about it?

  • Andy Payne

    Hi Nathan,

    If I understand correctly, what you're saying is you have some motors that you want to control via the Quad Stepper Firmata... and you have some reset buttons (sensors) that you want to read from using the standard Firefly Firmata.  Normally, I would just tell you to add a few lines of code to the Quad Stepper sketch to read data from your buttons and then use the Uno Read component to get that data... but the Quad Stepper sketch already uses some serial commands to get call-backs from the GH sketch.  The easiest solution (for the moment) is to probably just use two different arduinos... one running the Quad Stepper sketch and connected to your motors... and the other running the standard Firmata and connected to your buttons.  You'll likely have to open both ports (to each board), but this is likely the quickest solution...although it isn't very elegant.  I'll try to think of an alternative solution, but it will probably take some re-working of the stepper sketch (which needs to happen anyway).... Just need to find time :)

  • Nathan Barnes

    That is it precisely! I took Jasons workshop at Texfab 5 and I got a little understanding of how to code arduino's, so that is a route. My goal is to move 16 motors all with reset pins for zeroing. I will be tied up with Arduino boards as it is so combining the code would be great.

    Thanks for such an awesome reply Andy

  • Simon Lullin

    Feedback time (sorry for my poor english)

    Firefly is awesome, everything works just great...

    For example the UDP reciever... I stream whatever for a data from my android phone and it works brilliantly. With gHowl just took ages and still not working. Kinect function are perfect. Really, a world with made out of stuff like Friefly would be a world wher I would be happy to live!

    Arduino is working perfectely, in all ways.

    I hope one day we will get full resolution for cameras (kinect, webcam or whatever)

    Keep doing what you are doing, it's brilliant

    Simon

  • Andy Payne

    Thanks Simon!