OpenSprinkler › Forums › OpenSprinkler Unified Firmware › OpenSprinkler on Standard Arduino Hardware
Tagged: arduino, Visual Micro, Visual Studio, Wiznet 5100
- This topic has 42 replies, 9 voices, and was last updated 7 years, 3 months ago by wifi75.
-
AuthorPosts
-
August 17, 2013 at 2:12 am #22606
plainolddaveParticipant[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
August 19, 2013 at 4:30 am #25356
RayKeymasterVery 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.
August 25, 2013 at 4:03 am #25357
plainolddaveParticipantNo 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
September 3, 2013 at 7:49 pm #25358
rszimmParticipantDave, 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…
September 12, 2013 at 5:56 pm #25359
vladimirdMember@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.
September 12, 2013 at 5:57 pm #25360
vladimirdMember@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.
September 18, 2013 at 4:25 pm #25361
pericoMemberHi.
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?
September 18, 2013 at 9:14 pm #25362
rszimmParticipantI 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…
September 21, 2013 at 12:33 am #25363
plainolddaveParticipantHi 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
September 22, 2013 at 8:15 am #25364
vladimirdMember@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.September 22, 2013 at 8:17 am #25365
vladimirdMember@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!October 8, 2013 at 8:51 pm #25366
vladimirdMemberI 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.
October 15, 2013 at 9:09 pm #25367
vladimirdMember@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?October 16, 2013 at 4:32 pm #25368
vladimirdMember@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
October 17, 2013 at 7:16 pm #25369
rszimmParticipantI 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
October 18, 2013 at 5:30 am #25370
vladimirdMemberThanks for yoyr help! Looking forward for Atmel studio version.
October 24, 2013 at 11:08 pm #25371
dpackhamParticipantso I have the
Mega 2560
W5100 shield
and the LCD working and displaying info.
RTC still on its wayI 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
October 25, 2013 at 12:01 am #25372
dpackhamParticipantOK 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
October 25, 2013 at 9:20 am #25373
vladimirdMemberI 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.October 31, 2013 at 9:46 pm #25374
vladimirdMember@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
November 1, 2013 at 6:59 pm #25375
dpackhamParticipantok 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?
November 1, 2013 at 7:58 pm #25376
dpackhamParticipantI have also tried the alternate code based on the _pi code. but I don’t see any logging?
more hmm…
November 1, 2013 at 8:51 pm #25377
dpackhamParticipant@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?
November 2, 2013 at 8:00 am #25378
vladimirdMember@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.November 2, 2013 at 9:13 am #25379
vladimirdMember@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. -
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › OpenSprinkler on Standard Arduino Hardware