OpenSprinkler Forums OpenSprinkler Unified Firmware OpenSprinkler on Standard Arduino Hardware

Viewing 25 posts - 1 through 25 (of 43 total)
  • Author
    Posts
  • #22606

    plainolddave
    Participant

    [EDITED 28 February 2016]

    Updated code for Opensprinkler Unified Firmware V2.1.6 is here -> https://github.com/Dave1001/OpenSprinkler-Arduino

    Also added a couple of additional functions:
    + one version for WizNet5100 ethernet, and another version for ENC28J60 ethernet
    + ability to reboot daily to ensure stable operation
    + ability to display free memory on the LCD for debugging
    + heartbeat function to say ‘alls well’ – flashes an LED and the ‘:’ on the LCD time at 1Hz
    + ability to turn the watchdog timer on or off (refer to your reference documentation as to whether WDT is supported by the bootloader on your Arduino)

    [/EDIT]

    Hi everyone

    About a year ago I modded OpenSprinklerGen2 to run on standard hardware (“standard” meaning “what I had laying around in the shed” – an Arduino Mega 2560, Wiznet 5100 Ethernet and SD Shield, Freetronics LCD, DS1307RTC)

    In general terms I’ve tried to make as few changes as possible to Rays code – just enough to swap hardware however otherwise leaving opensprinkler functionality unchanged.

    The original version of this code was extremely stable and has been working flawlessly for almost a year now – this update to 2.0.7 adds SD card logging as of the github release from Ray on July 5th 2014.

    The code, libraries and release notes are up on Github here -> https://github.com/Dave1001/OpenSprinkler-Arduino

    A HUGE thank you to Ray for all your hard work!

    Cheers

    Dave

    #25356

    Ray
    Keymaster

    Very nice. Thanks for making the code work with Mega2560 and the Ethernet shield. I just recently ordered a Mega2560. Haven’t received it yet, but will give it a try soon.

    #25357

    plainolddave
    Participant

    No worries – thanks Ray

    After testing for a week or so it seems to hang at odd intervals every two to three days. Working hypothesis for whats causing the issue is either:
    1) buffer overrun – I’d opened port 8080 to the internet so wondering if the input was being flooded occasionally? (i.e. port scanners, malware etc) – have closed it now to see if makes any difference
    2) slow memory leak (sigh)

    Will look at some diagnostics when I get a chance , however in the meantime a watchdog will do the trick to keep it running

    In fairness – porting to the W5100 ethernet is just a bit of fun to reuse what I had…. wouldn’t be recommending to do it this way if you were staring from scratch (just order an opensprinkler! 😀 )

    Cheers

    Dave

    #25358

    rszimm
    Participant

    Dave, my release (which I’ve been calling sprinklers_pi) was originally built on a 2560 with the W5100 ethernet interface. You should be able to get it running. It’s essentially the exact same code as here: viewtopic.php?f=28&t=244 except it doesn’t support the graphing logging stuff. Besides that however, you wouldn’t really know you were running the raspberry pi version or the version on the 2560. If you’re at all interested, (or anyone else is), I could polish that code up and ship it over…

    #25359

    vladimird
    Member

    @plainolddave wrote:

    No worries – thanks Ray

    After testing for a week or so it seems to hang at odd intervals every two to three days. Working hypothesis for whats causing the issue is either:
    1) buffer overrun – I’d opened port 8080 to the internet so wondering if the input was being flooded occasionally? (i.e. port scanners, malware etc) – have closed it now to see if makes any difference
    2) slow memory leak (sigh)

    Will look at some diagnostics when I get a chance , however in the meantime a watchdog will do the trick to keep it running

    In fairness – porting to the W5100 ethernet is just a bit of fun to reuse what I had…. wouldn’t be recommending to do it this way if you were staring from scratch (just order an opensprinkler! 😀 )

    Cheers

    Dave

    Hi Dave I am very interested for using your code . I have the same hardware but have problem copmiling the code.

    I get error in line 243 of EtherCard_W5100.cpp:

    EtherCard_W5100.cpp: In static member function ‘static byte EtherCard::packetLoopIcmpCheckReply(const byte*)’:
    EtherCard_W5100.cpp:243: error: no matching function for call to ‘ICMPPing::ICMPPing(SOCKET&)’
    C:Program FilesArduinolibrariesicmp_ping/ICMPPing.h:125: note: candidates are: ICMPPing::ICMPPing(SOCKET, uint8_t)
    C:Program FilesArduinolibrariesicmp_ping/ICMPPing.h:113: note: ICMPPing::ICMPPing(const ICMPPing&)
    EtherCard_W5100.cpp:244: error: no match for call to ‘(ICMPPing) (int, byte [4], char [])’
    C:Program FilesArduinolibrariesicmp_ping/ICMPPing.h:136: note: candidates are: ICMPEchoReply ICMPPing::operator()(const IPAddress&, int)
    C:Program FilesArduinolibrariesicmp_ping/ICMPPing.h:147: note: void ICMPPing::operator()(const IPAddress&, int, ICMPEchoReply&)

    Do you know why it could be. I downloaded the librairies listed and iported to arduino 1.0.5 version.

    Thanks for help.

    #25360

    vladimird
    Member

    @rszimm wrote:

    Dave, my release (which I’ve been calling sprinklers_pi) was originally built on a 2560 with the W5100 ethernet interface. You should be able to get it running. It’s essentially the exact same code as here: viewtopic.php?f=28&t=244 except it doesn’t support the graphing logging stuff. Besides that however, you wouldn’t really know you were running the raspberry pi version or the version on the 2560. If you’re at all interested, (or anyone else is), I could polish that code up and ship it over…

    Could you post your code for Mega2560. I am doing some interval timers for Heating and home automation and this would help me learn from exampoles.

    #25361

    perico
    Member

    Hi.

    I made my opensprinkler also on a Mega 2560. I have a post here: http://unpuntilloalambre.blogspot.com.es/2013/01/opensprinkler.html (sorry it’s in spanish). It is not actualized, but I added a 8 relay board from ebay.

    Usually I take the code from firmware 1.x and it works perfectly, but I am not able to upgrade to 1.8.3, even when I flash the new code the displayed firmware is always is 1.8.2 . Any idea?

    #25362

    rszimm
    Participant

    I just uploaded the latest build. You can get it here : http://stuff.intelligent-isi.com/sprinklers_pi/sprinklers_avr-1.0.0.tar.gz

    It’s built with either the Visual Micro plugin for Visual Studio, or else the version 2012-05-23 Arduino.mk makefile on a linux platform (what a pain in the ass that thing is..)

    When you start it up, it currently binds to IP address 192.168.10.20 and port 8080. You can change that via the web page, or you can edit the code to make it something that works on your network.

    There’s a tftp server built in to upload the web pages to the SD card. There’s a little bash shell script called xfer that you can use to ease the upload. OR, simply use your desktop to copy the files in the web directory to a /web folder on the SD card.

    Good luck!

    I apologize that there’s not a whole lot of step-by-step here. If there’s interest I can go into more depth…

    #25363

    plainolddave
    Participant

    Hi again everyone

    Looks like we’ve all had the same idea to run on whatever hardware was lying around – thanks for your postings

    Have posted a new version above that seems to fix the stability issues( or get from here -> https://www.dropbox.com/sh/nkhbt81kyvycyzy/LUWh8It6Ph)

    For vladimird – can’t quite see what the issue was from the error messages so have zipped up a copy of the libraries I’ve been using that compile fine – maybe have another try and let me know how you go?

    Cheers

    Dave

    #25364

    vladimird
    Member

    @rszimm wrote:

    I just uploaded the latest build. You can get it here : http://stuff.intelligent-isi.com/sprinklers_pi/sprinklers_avr-1.0.0.tar.gz

    It’s built with either the Visual Micro plugin for Visual Studio, or else the version 2012-05-23 Arduino.mk makefile on a linux platform (what a pain in the ass that thing is..)

    When you start it up, it currently binds to IP address 192.168.10.20 and port 8080. You can change that via the web page, or you can edit the code to make it something that works on your network.

    There’s a tftp server built in to upload the web pages to the SD card. There’s a little bash shell script called xfer that you can use to ease the upload. OR, simply use your desktop to copy the files in the web directory to a /web folder on the SD card.

    Good luck!

    I apologize that there’s not a whole lot of step-by-step here. If there’s interest I can go into more depth…

    Hi Rszimm,
    Thanks, for uploading your code.
    I havet used atmel studio till now.
    I will try to download install and test your code on hardware.
    Hope it is not to much complex comparing to arduino.
    Will post here the experiance.

    #25365

    vladimird
    Member

    @plainolddave wrote:

    Hi again everyone

    Looks like we’ve all had the same idea to run on whatever hardware was lying around – thanks for your postings

    Have posted a new version above that seems to fix the stability issues( or get from here -> https://www.dropbox.com/sh/nkhbt81kyvycyzy/LUWh8It6Ph)

    For vladimird – can’t quite see what the issue was from the error messages so have zipped up a copy of the libraries I’ve been using that compile fine – maybe have another try and let me know how you go?

    Cheers

    Dave

    I have removed libraries downlaoded from internet and used yours posted here. Now it compiles without errors.
    Thanks!

    #25366

    vladimird
    Member

    I have it working partialy. it was blocking at boot but i found out that NTP ocption was blocking it. after disabling ntp it started to work. Stil have it sometimes blocke but removing lcd and keypad helps.

    #25367

    vladimird
    Member

    @vladimird wrote:

    I have it working partialy. it was blocking at boot but i found out that NTP ocption was blocking it. after disabling ntp it started to work. Stil have it sometimes blocke but removing lcd and keypad helps.

    I cant mangae to get NPT clock work and now also have some problem with hardware rtc1307. When I disconect RTc module web server works. the best would be to make NTP work as anyway it is connectet to internet all the time.
    Did anyone alse tried opensprikler on MEGA 2560 + LCD-Keypad + RTC DS1307?
    Dave did you had NTP working or it was only RTC?

    #25368

    vladimird
    Member

    @rszimm wrote:

    I just uploaded the latest build. You can get it here : http://stuff.intelligent-isi.com/sprinklers_pi/sprinklers_avr-1.0.0.tar.gz

    It’s built with either the Visual Micro plugin for Visual Studio, or else the version 2012-05-23 Arduino.mk makefile on a linux platform (what a pain in the ass that thing is..)

    When you start it up, it currently binds to IP address 192.168.10.20 and port 8080. You can change that via the web page, or you can edit the code to make it something that works on your network.

    There’s a tftp server built in to upload the web pages to the SD card. There’s a little bash shell script called xfer that you can use to ease the upload. OR, simply use your desktop to copy the files in the web directory to a /web folder on the SD card.

    Good luck!

    I apologize that there’s not a whole lot of step-by-step here. If there’s interest I can go into more depth…

    Hi Riszimm.I tought I could do it on my own but it seams i went the wrong waz bz downloading atmel studio 6.1 instead of Visal studio. Which version ov Visual studio I should use. Is express edition enaugh and which one?
    Mybe I dont need step by step but at least some guidance.

    Thanks Vladimir

    #25369

    rszimm
    Participant

    I looked at the Visual Micro site (http://www.visualmicro.com/) and apparently the Express Editions don’t work. Ugh. Only VS 2008-2013.

    If only Arduino had made their stuff build with a normal makefile. OK, maybe I’ll spend a bit of time here trying to get this to compile with the Atmel Studio (which is free). In the mean time, if you happen to have one of the full versions of Visual Studio, have at it!

    -Rich

    #25370

    vladimird
    Member

    Thanks for yoyr help! Looking forward for Atmel studio version.

    #25371

    dpackham
    Participant

    so I have the

    Mega 2560
    W5100 shield
    and the LCD working and displaying info.
    RTC still on its way

    I dont think i am getting an DHCP IP address and I cannot connect to the 192 one in the code.

    its hanging on the NTP update so i think net is messed up
    and no time due to no NTP or RTC.

    any ideas? do i need to chill and get the RTC hooked up? BTW what pins do the RTC hook up to..

    Dave P

    #25372

    dpackham
    Participant

    OK after some RTFC i believe that I do indeed need the RTC to function and get time that moves 🙂

    ill post back when it arrives from far away

    🙂

    Dave P

    #25373

    vladimird
    Member

    I have RTC and it is working but with some bags. I dont now if this is hardware problem.
    RTC is connectet to I2c interface SLC SDA GND and +5v.
    I would still prefer to get NTP working as it is more acurate and anyway it is allways connected to net., but dont have knowledge how to debug network.

    #25374

    vladimird
    Member

    @rszimm wrote:

    I looked at the Visual Micro site (http://www.visualmicro.com/) and apparently the Express Editions don’t work. Ugh. Only VS 2008-2013.

    If only Arduino had made their stuff build with a normal makefile. OK, maybe I’ll spend a bit of time here trying to get this to compile with the Atmel Studio (which is free). In the mean time, if you happen to have one of the full versions of Visual Studio, have at it!

    I have managed to have it compiled on VS 2010.
    And web server works pretty well.
    I have to check now for output and how to modify the code for my needs. It seams much harder to read then standard arduino. At least here NTP works ok.
    Thank again Rszimm.

    -Rich

    #25375

    dpackham
    Participant

    ok I got the RTC. works well. now I think i am seeing the same problem with the LCD shield. if its on I get LCD txt and messages. but network fails. if i remove it network works but NTP fails..

    its the 5100 board so cant we use the original arduino libs?

    do you have to mod the LCD to work? I have the Sainsmart lcd/keypad that uses A0 for the keys.

    thoughts?

    #25376

    dpackham
    Participant

    I have also tried the alternate code based on the _pi code. but I don’t see any logging?

    more hmm…

    #25377

    dpackham
    Participant

    @rszimm wrote:

    Dave, my release (which I’ve been calling sprinklers_pi) was originally built on a 2560 with the W5100 ethernet interface. You should be able to get it running. It’s essentially the exact same code as here: viewtopic.php?f=28&t=244 except it doesn’t support the graphing logging stuff. Besides that however, you wouldn’t really know you were running the raspberry pi version or the version on the 2560. If you’re at all interested, (or anyone else is), I could polish that code up and ship it over…

    can you enable logging with the microsd card?

    #25378

    vladimird
    Member

    @dpackham wrote:

    ok I got the RTC. works well. now I think i am seeing the same problem with the LCD shield. if its on I get LCD txt and messages. but network fails. if i remove it network works but NTP fails..

    its the 5100 board so cant we use the original arduino libs?

    do you have to mod the LCD to work? I have the Sainsmart lcd/keypad that uses A0 for the keys.

    thoughts?

    U have the same hardware and same problems.
    I use keypad and lcd to disable NTP and setup ip and rest.
    For normal usage I use just RTC and no display and keypad.
    Than it works.
    To me Rizmm code semas more promising although I am worried about ram issue if I add more libraries. And also I have never used VS before and at first look seams much more complicated then Arduino.

    #25379

    vladimird
    Member

    @dpackham wrote:

    @rszimm wrote:

    Dave, my release (which I’ve been calling sprinklers_pi) was originally built on a 2560 with the W5100 ethernet interface. You should be able to get it running. It’s essentially the exact same code as here: viewtopic.php?f=28&t=244 except it doesn’t support the graphing logging stuff. Besides that however, you wouldn’t really know you were running the raspberry pi version or the version on the 2560. If you’re at all interested, (or anyone else is), I could polish that code up and ship it over…

    can you enable logging with the microsd card?

    i think Riszimm didnt put loging on mega version because of lack of resources- Ram
    Let see what he will reply when he comes back to forum.

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

OpenSprinkler Forums OpenSprinkler Unified Firmware OpenSprinkler on Standard Arduino Hardware