OpenSprinkler › Forums › OpenSprinkler Unified Firmware › How to compile the unified firmware
Tagged: firmware unifed compile make
- This topic has 6 replies, 3 voices, and was last updated 8 years, 5 months ago by pb.
-
AuthorPosts
-
June 9, 2016 at 6:26 pm #42911
pbParticipantHi,
I have been attempting to compile the firmware for OpenSprinkler, specifically for the os2.3 DC hardware. There seems to be a few different variants of documentation, but most seem to be out of data and for the non-unified firmware. I presume the most up to date instructions are the ones included in the github repo: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/README.txt
These instructions indicate the firmware can be built using the command line via make. However, running this doesn’t work, it seems to not be setting the cpu type correctly. This isn’t really surprising since there is no board.txt file installed to lookup ‘os20’ etc. Presumably the OS library needs to be installed into Arduino first? But where from? I assume for my hardware this should be set to os23 also, is it the same for AC vs DC?
Is there a more complete and up to date version of instructions for compiling somewhere?
June 9, 2016 at 11:28 pm #42914
ShawnHarteParticipantI just downloaded arduino 1.0.6, pulled everything from github, added the sdfat library, opened mainArduino in arduino, and hit compile. If you use a usbAsp cable, you can upload it using that straight from arduino.
If you want to use the updater and a USB cable, not sure if it works on 2.3HW it doesn’t on 2.1, you can find the temporary hex file it creates and move it to the correct location, and update away. If you are having trouble finding the hex file, turn on verbose mode for “verify” and one of the last lines will have the file name and location.June 11, 2016 at 9:10 am #42937
RayKeymasterWe have a support article that explains how to compile the firmware:
https://opensprinkler.freshdesk.com/solution/articles/5000165132-how-to-compile-opensprinkler-firmwareYou can launch Arduino IDE and click on compile as Shawn said. More recently I’ve been using Arduino Make (arduino-mk) to compile in command line, which is faster as you don’t have to launch Arduino IDE any more (and I use an external editor anyways since Arduino IDE is not really my thing…)
June 16, 2016 at 4:30 pm #43022
pbParticipantI am still struggling to get the unified firmware to compile. The instructions linked by Ray appear to be out of date and apply to the pre-unified firmware.
Steps I am performing using Windows 10:
– Install Arduino 1.0.6
– Install SdFat library from GitHub into$HOME\Arduino\libraries\SdFat
– Checkout OS hardware definitions from GitHub OS
– Copyaopensprinkler
into$HOME\Arduino\hardware\
– Checkout OS-Fimrware from GitHub OS-Firmware into$HOME\Arduino\
– Change directory name of firmware tomainArduino
– Open Arduino and change board target to HW2.3
– Open .ino file$HOME\Arduino\mainArduino\mainArduino.ino
– HitVerify
This fails with:
DS1307RTC.cpp:28:18: warning: Wire.h: No such file or directory
DS1307RTC.cpp: In constructor 'DS1307RTC::DS1307RTC()':
DS1307RTC.cpp:37: error: 'Wire' was not declared in this scope
DS1307RTC.cpp: In static member function 'static uint8_t DS1307RTC::detect()':
DS1307RTC.cpp:44: error: 'Wire' was not declared in this scope
DS1307RTC.cpp: In static member function 'static void DS1307RTC::read(tmElements_t&)':
DS1307RTC.cpp:81: error: 'Wire' was not declared in this scope
DS1307RTC.cpp: In static member function 'static void DS1307RTC::write(tmElements_t&)':
DS1307RTC.cpp:101: error: 'Wire' was not declared in this scope
DS1307RTC.cpp:112: error: 'Wire' was not declared in this scope
DS1307RTC.cpp: In static member function 'static void DS1307RTC::read(tmElements_t&)':
DS1307RTC.cpp:81: error: 'Wire' was not declared in this scope
DS1307RTC.cpp: In static member function 'static void DS1307RTC::write(tmElements_t&)':
DS1307RTC.cpp:101: error: 'Wire' was not declared in this scope
DS1307RTC.cpp:112: error: 'Wire' was not declared in this scope
Any ideas?
June 18, 2016 at 11:53 pm #43040
ShawnHarteParticipantIf you see errors like that it means arduino is looking for a file and can not find it. In your case the wire library is not being found. You can check to see if it is in your libraries directory, if not download it as well. If it is you can try copying it to the same directory as mainArduino.
After you correct that error you may see other errors of the same type. Just keep working on getting the right libraries in the right location and it will compile correctly. I had the same issue you are having and it was simply a matter of downloading Wire.
By the way always start at the top with error messages, typically the errors after that are directly related to the first error. If you want to dig into the issue, open the file in the first line DS…(whatever it is) and go to line 28 (first number after the colon) and look for where it is looking for the file in question.
June 20, 2016 at 3:02 pm #43079
RayKeymasterYou said “Change directory name of firmware to mainArduino” — this shouldn’t be necessary. When you check out the OpenSprinkler firmware code, it should exist in a folder, for example, called OpenSprinkler, and this should be placed inside the Arduino\libraries folder. Basically the firmware code folder structure should look like this:
Arduino\libraries\OpenSprinkler\a bunch of .h and .cpp files
Arduino\libraries\OpenSprinkler\examples\mainArduino\mainArduino.inoAssuming you set it up correctly, start Arduino, and go to File -> Examples -> OpenSprinkler, click on mainArduino. Then compile.
June 23, 2016 at 9:19 pm #43142 -
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › How to compile the unified firmware