I am excited to announce the release of Firefly 1.006! This is a major release and includes many new components and bug fixes, along with a number of new tutorials and example files. Here are a few notable features:
Firefly 1.006 unveils a new Arduino Code Generator component which attempts to convert any Grasshopper definition into Arduino compatible code (C++) on the fly. It works by detecting components that are 'upstream' from the Uno/Mega Write component. The Code Generator checks the component ID against a library of custom C++ functions which then get added to the code if there is a match. The code can be simultaneously saved as a .pde (Arduino Sketch) file to be opened in the Arduino IDE.
In addition, there is also a new Upload to I/O Board component which allows you to upload any sketch (see above) directly to your Arduino board from within the Grasshopper environment. A lot of stuff happens behind the scenes with this component. Essentially it creates a dynamic MakeFile and calls a shell application to convert the .pde file into a .cpp (C++) file and then into .hex code (machine readable code) to be uploaded to the microcontroller. Now, you can automatically convert your Grasshopper definition into Arduino code and upload it directly to your board! Note: WinAVR is required to be installed on your machine in order to properly upload sketches to your board. You can download the latest version here.
We didn't stop there. The communication process has between Grasshopper and your Arduino board has been overhauled. Thanks to the newly rewritten GH_Timer (by David Rutten), the Uno/Mega Read components are now roughly 10x faster than previous versions. The Firefly Firmata has been re-written to be more flexible and efficient. The Uno/Mega Write component have changed how it sends data out to the board as well. Simply right-click on any input and set the data type to Digital, PWM, or Servo... That's right, you can dynamically attach a Servo to any pin now!
If that weren't enough, I've also added several components to handle network communication, namely UDP (User Datagram Protocol) and OSC (Open Sound Control). The UDP Listener and Sender components allow you to send/receive messages over a wireless or LAN network using asynchonous transmission. OSC messages are essentially specially formatted UDP messages and the OSC Listener and Sender components add functionality in handling this type of information.
There is much much more too (I didn't even mention the new XML Search or State Detection components)! For a full list of modifications and feature enhancements, check out the change log included in the download link.
To download the latest version of Firefly, please visit: http://www.fireflyexperiments.com/download/
If you are using Firefly and would like to share your projects, comments or ideas please e-mail us (info@fireflyexperiments.com) or post to the discussion forum. Updates will be posted to the Firefly website.
Firefly Developers:
Andy Payne [LIFT Architects; Harvard GSD - Cambridge, MA]
Jason Kelly Johnson [Future-Cities-Lab; CCA - San Francisco, CA]
Ángel Linares
Jul 4, 2011
David Merlin
Andy -
I'm having some trouble getting all of the components to load in Rhino 5. I unblocked each file in the special components folder as stated in the install instructions, but the only components that are showing up are Code Generator, Upload to I/O Board, OSC Listener, OSC Sender, UDP Listener, UDP Sender, XML Search, and State Detection.
What makes the issue a little more interesting is that all of the components load correctly in Rhino 4. I'm running windows xp. Any ideas?
The code generator is an amazing addition!!
Jul 4, 2011
Andy Payne
The reason that only a certain number of components load and others don't is because for some reason Rhino 5 doesn't have a problem loading the Firefly-X.gha file, but gets held up on the Firefly.gha file. I had to split the new components up into a new build for various reasons. Can you double-check that the Firefly.gha file is unblocked. In our testing, this seemed to fix the problem. If not, you may need to install the full version of .NET 4.0 Framework... Although I'm not completely sure if that is the problem or not. I've noticed other 3rd party developers have had similar problems with their builds in Rhino 5, but usually unblocking the file seems to do the trick. Let me know if any of that resolves the issue and I'll keep digging around for a better solution.
Cheers,
Andy
Have you run into any other problems?
Jul 4, 2011
Gia Djahaia
Jul 5, 2011
Andy Payne
Hi Gi,
I'm a little confused on your last comment. I did test the tri-color switch example and everything worked as expected. Of course, it depends on your circuit setup (ie. which legs of the tri-color LED have to be connected to certain Digital pins). But, yes... it should work. You have to upload the Firefly Firmata to your board. Then, open the port. Then double-click the toggle connected to the Start input of the Uno Write component to begin sending data out to the board. Then go back up and double-click on the GH_Timer component to start the fader values. This should work if your circuit looks like the image included in the tutorial. How is your definition failing?
-Andy
Jul 5, 2011
Gia Djahaia
Not definition is failing, but my attempt to plug this definition to the CodeGen component. I mean when im pluggin it, the CodeGen turns orange and i see warnings: function not found: C#_component, and function not found: stream gate.
So the question was have u succeed in translating this definition to the arduino code, and then uploading it to the board to work autonomous?
Jul 5, 2011
Andy Payne
Ah... ok. I see now. You've stumbled on one of the current limitations of the Code Generator component :) I haven't created functions for every GH component... and certain ones wont need to be translated (an Arduino doesn't really need to know what a Line or Mesh Intersection is). Most of the Math tab has function definitions in place... One thing I could see a problem are the Script components (C# or VB.NET). It's not impossible... but I have to think about how to implement this. The Code Gen and Upload to Board components are still very much in their infancy and I have more that I ultimately want to do for both of these... but at the moment, it could be difficult to directly translate the tri-color switch definition for that reason.
Now, that said... this example would not be that difficult to code directly in the Arduino IDE. I could try to work up something for your (if needed)... but you should be able to run it with the Firefly firmata at least for testing purposes. Do you need this to run off an external power supply (ie. autonomous)?
Jul 5, 2011
Gia Djahaia
Jul 5, 2011
Andy Payne
Instead of a list of non-supported components (which would likely be a lot)... I should probably create a list of supported components. I could do that fairly easily. See below:
List of supported components for Code Generator (ver 1.006):
Jul 5, 2011
David Merlin
Andy-
Firefly.gha file is unblocked and I tried installing the full version of .NET 4.0 Framework, but the Firefly.gha components still don't load in Rhino 5. Are there any log files I could send you?
I'm just starting to get into the release with Rhino 4 and will let you know if I run into any problems.
david
Jul 5, 2011