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.
philipp hornung
..thats outlined while trying to run firefly's quadstepper definition:
..any clue?
thank you!
Nov 22, 2012
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
Nov 22, 2012
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
Nov 22, 2012
philipp hornung
andy,
btw.. do you got experience with the polulu stepper driver? ;)
Nov 22, 2012
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.
Nov 22, 2012
philipp hornung
yes, as far as i read thru the documentations.. it should work as well.
sorry.. you are rigth.. new thread.
Nov 22, 2012
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!
Jan 23, 2013
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).
Jan 23, 2013
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?
Jan 24, 2013
Andy Payne
What do you mean, erase the functions for sound management? Are the audio components for Firefly not showing up?
Jan 24, 2013
Miguel Vidal
Exactly!
After installing the latest version of Firefly, the "Audio" Tab is not there.
Jan 24, 2013
Andy Payne
Are there other tabs missing (ie. Computer Vision)? What version of Rhino are you running?
Jan 24, 2013
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! :)
Feb 9, 2013
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.
Feb 9, 2013
Yoshi Fukumori
Hello Andy! it works for 64, but for 32 I still have the problem.
Feb 9, 2013
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
Feb 17, 2013
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.
Mar 18, 2013
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'.
Jun 9, 2013
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?
Jun 15, 2013
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?
Jun 15, 2013
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)?
Jun 15, 2013
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!
Jun 15, 2013
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.
Jun 16, 2013
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?
Jun 19, 2013
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.
Jan 11, 2014
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?
Mar 25, 2014
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 :)
Mar 25, 2014
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
Mar 25, 2014
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
Mar 27, 2014
Andy Payne
Thanks Simon!
Mar 27, 2014
jorge sainz de aja
is firefly Compatible with SparkFun RedBoard???????????????????
Apr 2, 2014
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
Apr 2, 2014
jorge sainz de aja
thanks andy, finally I bought a Arduino starter Kit with UNO, if everithing goes fine, then level up ;)
Apr 3, 2014
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
May 4, 2014
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!
May 5, 2014
jorge sainz de aja
http://youtu.be/MmgDgJQkxSA
Origami - grasshopper + arduino
Jul 14, 2014
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
Jul 23, 2014
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?
Sep 25, 2014
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.
Sep 25, 2014
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?
Sep 26, 2014
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!
Sep 26, 2014
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
Sep 26, 2014
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?
Sep 26, 2014
Emanuele Calabrò
Sep 26, 2014
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
Sep 26, 2014
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?
Sep 26, 2014
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.
Sep 26, 2014
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.
Sep 26, 2014
Emanuele Calabrò
it's an old screenshot, sorry
Sep 26, 2014
Amaraa
Hello? I am trying rotating objects using firefly. The thing is It's my first time using arduino and firefly plugin.
More interestingly Arduino Uno shows the Uno is on COM10 port.
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.
I installed WinAVR and followed all the instruction from Firefly-Primer_1006.
Please help me.
Thank you
Nov 11, 2014