Every time that I reboot the raspberry PI 2, I need to re-upload the StandardFirmata sketch (open the Examples > Firmata > StandardFirmata sketch, and upload it to the Arduberry board). Do you know any way to automatically upload the StandardFirmata sketch. I am thinking that it might be a way to upload the sketch using a command in the terminal or maybe using a shell script that runs when the raspberry PI 2 is rebooting.
I am controlling the Arduberry with a racket script [1] using the StandardFirmata. However, everytime that I restart the PI, the StandardFirmata should be uploaded to work with the racket script. Can you elabore more about how to upload the code to the Arduberry using SPI?
What I want to do is to run a command in the terminal to upload any script to the Arduberry.
Hi miguel,
I don’t know much about racket or StandardFirmata, however, if all you want to do is to upload that firmware from the terminal, i can help with that.
First go to the ArduinoIDE on the Pi, open the StandardFirmata example. The goto File->Preferences and make sure that Show verbose output during: compilation is selected.
The compile the standard firmata (Do not upload). You’ll get a message with the path to the hex file in the black screen below the editor (in the screenshot it is : /tmp/build79…44.tmp/StandardFirmwata.cpp.hex).
Next, goto that /tmp location and copy this file to a place where you can easily access it (/tmp folder gets erased during reboot, so it better to keep a copy). To upload this firmware which is the binary file for the StandardFirmwata, use this on the command line: avrdude -c gpio1 -p m328p -U flash:w:StandardFirmata.cpp.hex from the folder where the StandardFirmata.cpp.hex is present. This will upload the firmware to the Arduberry. You can automate this to run at boot too.
Do let us know if you need any more help and also let us know more about the project that you are doing with this.
I really appreciate your time and help. I am building a robot, once I will have an updated version I will happily share with the comunitiy? Should I create a new ticket in the forum regarding my project?
Following your suggestions, I have created the hex file and when running the avrdude command I get an error with the gpio1. Any suggestions?