OpenSprinkler Forums OpenSprinkler Unified Firmware How to compile the unified firmware

  • This topic has 6 replies, 3 voices, and was last updated 6 years ago by pb.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42911

    pb
    Participant

    Hi,

    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?

    #42914

    ShawnHarte
    Participant

    I 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.

    #42937

    Ray
    Keymaster

    We have a support article that explains how to compile the firmware:
    https://opensprinkler.freshdesk.com/solution/articles/5000165132-how-to-compile-opensprinkler-firmware

    You 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…)

    #43022

    pb
    Participant

    I 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
    – Copy aopensprinkler into $HOME\Arduino\hardware\
    – Checkout OS-Fimrware from GitHub OS-Firmware into $HOME\Arduino\
    – Change directory name of firmware to mainArduino
    – Open Arduino and change board target to HW2.3
    – Open .ino file $HOME\Arduino\mainArduino\mainArduino.ino
    – Hit Verify

    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?

    #43040

    ShawnHarte
    Participant

    If 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.

    #43079

    Ray
    Keymaster

    You 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.ino

    Assuming you set it up correctly, start Arduino, and go to File -> Examples -> OpenSprinkler, click on mainArduino. Then compile.

    #43142

    pb
    Participant

    Thanks @Ray. I assumed it could be checked out into the sketchbook directory rather than the libraries folder. Once it is in the library folder it compiles as expected. Now to see if I can integrate MQTT…

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware How to compile the unified firmware