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
  • 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!  

  • jorge sainz de aja

    is firefly Compatible with SparkFun RedBoard???????????????????

  • Andy Payne

    Hi Jorge,

    As far as I know, it should be compatible with Firefly... but I haven't run specific tests on it.  However, my understanding of the RedBoard is that it is almost identical to the Uno (and/or Duemilanove) both of which work just fine with Grasshopper.

    HTH,
    Andy

  • jorge sainz de aja

    thanks andy, finally I bought a Arduino starter Kit with UNO, if everithing goes fine, then level up ;)

  • Guido Maciocci

    Hi Andy, 

    I have a particular question related to the Leap Motion controller and its intergration with Rhino Python rather than a question specific to Firefly (sorry, but i don't know where else to post this). 

    I am writing some python scripts based on the leap API to certain things in Rhino using the controller. As proof of concept scripts they are currently working outside of Rhino and I would like to begin integrating them via Rhino Python and Rhinocommon. 

    My problem is that I am unable to get Rhino Python to speak to the controller, in that i keep receiving the following error:

    "The type initializer for 'Leap.LeapPINVOKE' threw an exception"

    Now, as far as I have managed to research, this error is usually related to the referencing of the wrong type of Leap libraries (x86 or x64). 

    I have copied the Leap SDK .dll's into the same folder as the script I am trying to run. I have also included LeapCSharp.NET4.0.DLL, Leap.py and Leap.pyc. 


    The only way i can get the Leap module to load is by adding a clr.AddReferenceToFileAndPath pointing to LeapCSharp.NET4.0.dll assembly and appending the leap\lib forlder to sys.path. 


    The Leap module imports but I get the PINVOKE error regardless of the x86 or x64 libraries I include in the folder. 

    I managed ONCE to import the module and run the leap Sample.py script but I can't remember how I did this. Also, when it ran, it did not print any Leap data to the console and Rhino tended to crash on running the script. 

    Would you or anyone else have any advice to point me in the right direction?

    Thank you so much for your help, 

    Guido

  • Guido Maciocci

    Andy, some progress... 

    I found your question on the Leap dev forums which pretty much outlined the same problem. 

    So now, i moved the relevant .dll's to the same folder as the python script i'm running in Rhino Python. 

    I use clr.addreference to add the LeapCSharp.NET3.5.dll and append the \\leap\\lib folder to sys.path to reference the libraries. 

    Now i can add a controller, and a listener no problem. As soon as I try to poll a frame....rhino crashes!

  • jorge sainz de aja

    http://youtu.be/MmgDgJQkxSA

    Origami - grasshopper + arduino

  • mal

    hello 
    I am currently new in firefly and I am tring to connect an azteeg board (creat for 3d printer) to firefly but I have some trouble to find the way to find and conect the good pin the firefly plug in seems to be design to work with arduino uno board or mega how can I conect my azteeg x1 board to firefly and send some information to the sevro motor, activate the fan or controle the power of the heat of the hot end with the sensor. if you have somes clue or you now some other works feel free to respond.

    thanks for this great plug-in 

  • Emanuele Calabrò

    Hello everyone,
    I am a neophyte arduino and firefly. I'm using a simple sensor for measuring the temperature and its associated script, so not a script Firmata, I use FF for reading data, but when I use the Serial Read I can not see the data, I get the message "Data failed conversion from TEXT to NUMBER "

    Can you help?

  • Andy Payne

    Hi Emanuele,

    It's difficult to debug without actually seeing the script your working with (ps... why not use the firmata?)  Anyway, my assumption is that you're arduino sketch is sending data over the serial port as string (possibly with a label, etc.).  The Uno Read component is setup specifically to work with the Firefly firmata which formats the string in a specific way.  If you're using your own custom script, you should use the Generic Serial Read component, instead of the Uno Read.

  • Emanuele Calabrò

    Hi Andy,

    I am using just the component Serial Read, not UNO Read.
    I do not understand how to use Firmata. I do the upload at board of the first sketch from the site and after? How should I / can I use other scripts?

     

  • sean.mckeever

    Hi Emanuele,

    From my brief work with firefly + various arduino sensors, you NEED to be using the Firefly Firmata for those components to read your Arduino inputs.  

    It was confusing at first for me too.  Before you even engage the Grasshopper environment, you need to use the Arduino software to upload the Firefly Sketch (Firmata) to the Arduino board.  Read "Getting Started" here:

    http://www.fireflyexperiments.com/resources/

    THEN launch Grasshopper and try your Firefly Read components again.

    Good luck, and keep at it!

  • Emanuele Calabrò

    Ok, 

    I did as you said but the sensors shoot numbers, when and where it is time to put the script of the sensor? 'Cause if I do not put it, sensor does not go

  • sean.mckeever

    Emanuele,

    Can you perhaps upload an image screen capture of your issue?  And perhaps a link to the sensor you're trying to use.  Some sensors are more basic and some more complex than others.  

    Are are you using the "Uno Read" component and getting numbers out?  

  • Emanuele Calabrò

  • Emanuele Calabrò

    YES, i'm using "Uno Read" component and getting numbers out?

    I'm using a DHT11, a DHT22 and a DS18B20

    From 20 to 30 should give me values ​​and instead gives me about 1000

  • Andy Payne

    Emanuele, it appears you're getting an error in the Arduino IDE... which may mean the firmata never actually got uploaded to your board.  Can you close Grasshopper, and try uploading the Firmata, and then restart Grasshopper?

  • Andy Payne

    PS, the 1023 value you're getting is not actually correct.  Either you have a hardware circuit error, which is causing your voltage to saturate around 5V (and thus the pin is returning it's maximum value of 1023) or you never actually got the firmata installed and it's returning some other number.

  • Andy Payne

    Lastly, could you start a discussion topic about this issue instead of just posting to the wall.  That will help us track any issues and keep the comment wall more clean.  Thanks.

  • Emanuele Calabrò

    it's an old screenshot, sorry

  • Amaraa

    Hello?  I am trying rotating objects using firefly. The thing is It's my first time using arduino and firefly plugin.
    I am starting with the sample files that come with the firefly installation. which is Firefly_01_Actuation.
    But I am facing problem relating to the serial port. 
    It works fine connected and suddenly after uploading the Firmata to the board, shows error on the grasshopper. 
    The Uno Write says no connection to the device. And i checked the Arduino program, surprisingly Serial port is not active. 
    More interestingly Arduino Uno shows the Uno is on COM10 port. 
    I installed WinAVR and followed all the instruction from Firefly-Primer_1006. 
    Please help me. 
    Thank you

  • Andy Payne

    Hi Amartuvshin.  Thanks for posting the images... they're really helpful.  I think what's going on is a hardware issue.  Looking at your circuit, I think you have the 5V and GND lines coming from your servo connected to the wrong wires.  If you look at the servo and the three wires coming from it, you'll notice a brown, red, and yellow.  The brown wire needs to be connected to GND, but it looks like you've connected it to the 5V line.  The red wire on the servo need to be conencted to the 5V line, but it's connected to GND.  I think because these are reversed, it's causing the connection to your serial port to drop which is why you aren't seeing it show up under the Serial Ports in the IDE.  

    My suggestion would be to first close Grasshopper/Rhino.  You don't necessarily need to do this, but it will ensure that you don't have the COM port open.  Then, switch the hardware wires and see if the COM port shows back up in the IDE.  If it does, then try to re-upload the Firefly Firmata to make sure it's properly loaded.  If it gets uploaded properly, then go ahead and re-open Grasshopper/Rhino and see if the example file works properly.

  • Amaraa

    Thank you Mr.Andy. It really helps a lot!
    I switched the cables, and now servo works fine. However still some problem with the LEDs. The reason is my resisters are not 220 in my opinion. I've checked resister calulator and i installed on my bread. 
    I have one more question. what if i want to control more servo motors individually. Do i need more arduinos or some other device to connect with my arduino uno?
    This picture is showing what I am testing right now.Thank you. Have a great day!

  • Andy Payne

    Amartuvshin, please see this thread about controlling multiple servos http://www.grasshopper3d.com/group/fireflyplugin/forum/topics/servo...

  • Amaraa

    Thank you for advice Mr.Andy. I am almost finished my project, however I have another question that is eliminating my pc from the entire work. Which means uploading these grasshopper codes to Arduino. I have seen the CodeGene component but quite not sure whether Ardiuno itself could handle the computing process of Leap motion data. Should i use arduino with usb connection? or other device that would be connection between leapmotion and Arduino board?
    Here is my multiple Servo motor connection video.
    https://vimeo.com/112353424

  • Justin Hare

    Help! Switched to using Parallels and now Kinect doesn't work. I know there is an issue with Kinect not properly connecting in other programs. I haven't had any luck finding a solution. Any suggestions?

  • Andy Payne

    Justin, was this working before on a different system configuration?

  • Justin Hare

    Andy, I was previously running Windows via Bootcamp and it worked fine. I had an issue after updating to Yosemite that lost the partition so I reinstalled everything and decided to go the Parallels route. Might not have been the best idea. 

  • kwanphil cho

    Hi. thank you for letting me in the group. Just quick question. is there any way to bring mp3 file and play in firefly? I would like to extract data from specific mp3 file if it is possible. Any advice will be greatly appreciated. Thank in advance.

  • Andy Payne

    Hi Kwanphil.  Unfortunately, at this moment it is not possible to load in an mp3 file directly.  You could play it over the speakers and use the other audio components to read in the microphone data... but reading in an mp3 file isn't currently supported.

  • Juan Sepulveda

    Hello everybody,

    I share the video from the Adaptive Facade Workshop that European Facade Network organized in Lucerne in November 2014, all the students used Firefly for the mock-ups...

  • xiao-g

    Hello All,

    I just installed Firefly 64bit for Rhino5. But when I have trouble to launch grasshopper when it loads Firefly.X. It pops a warning as the image attached. 

    Could anyone kindly suggest how to solve it? Many many thanks!

  • Christian Schmidts

    Is there a way to merge the the Firefly firmata with the quadstepper in order to drive one stepper motor and other devices at the same time with one Arduino? Is it generally possible? Cheers!

  • Rafael

    Hi everyone. I just recently created a group about a project based on the use of arduino + grasshopper and Firefly. It is called The Mini Airflow Tunnel Project: http://www.grasshopper3d.com/group/mini-airflow-tunnel-project. The idea is to use grasshopper and firefly to operate a low-cost wind tunnel with arduino and wind sensors.

  • Ali-Haung

  • Ali-Haung