Pages: 1 ... 5 6 [7]   Go Down
Author Topic: Automated Reptile Control System(webserver, Data Logging, RTC and much more)  (Read 36663 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great project. I have my own version of this that I created to monitor/control my coastal carpet python enclosure. If anyone is thinking or recreating your work I just wanted to throw a few ideas in the mix for people to play with. I am in the middle of a redesign where I will be off loading the heavy lifting of the web page and all decision making to a raspberry pi. So basically you write the web page and serve it from the pi. You have a program running on the pi that communicates with the arduino over i2c. The pi program reads its settings from a mysql database and requests sensor readings and ask the arduino to open or close relays storing any data collected and state changes in the database. The web page then displays sensor readings it reads from the mysql database and updates the pi program settings via the database.

The advantage, as I see it, to this approach is that you can use a cheaper arduino or even an attiny85 depending on how inputs you need. Your raspberry pi can easily have additional storage attached and can even control multiple arduinos. I wrote my code such that my pi can ask for individual bytes of data over I2C. That way it can verify that its getting good data from the sensor via the arduino. I like this approach as it makes it very easy for me to add sensors to an arduino and to add arduinos to the I2C bus. Right now I have one arduino for my carpet's enclosure and one to read switches from my houses ADT security system (registers doors opening and closing, motion detection, and garage door state).
Logged

Sydney, Australia
Offline Offline
Sr. Member
****
Karma: 6
Posts: 397
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great project. I have my own version of this that I created to monitor/control my coastal carpet python enclosure. If anyone is thinking or recreating your work I just wanted to throw a few ideas in the mix for people to play with. I am in the middle of a redesign where I will be off loading the heavy lifting of the web page and all decision making to a raspberry pi. So basically you write the web page and serve it from the pi. You have a program running on the pi that communicates with the arduino over i2c. The pi program reads its settings from a mysql database and requests sensor readings and ask the arduino to open or close relays storing any data collected and state changes in the database. The web page then displays sensor readings it reads from the mysql database and updates the pi program settings via the database.

The advantage, as I see it, to this approach is that you can use a cheaper arduino or even an attiny85 depending on how inputs you need. Your raspberry pi can easily have additional storage attached and can even control multiple arduinos. I wrote my code such that my pi can ask for individual bytes of data over I2C. That way it can verify that its getting good data from the sensor via the arduino. I like this approach as it makes it very easy for me to add sensors to an arduino and to add arduinos to the I2C bus. Right now I have one arduino for my carpet's enclosure and one to read switches from my houses ADT security system (registers doors opening and closing, motion detection, and garage door state).

I would love to see this code if at all possible please ? Particularly the interaction over i2c between the Arduino and the Pi.

I have a home automation project that i am migrating from a picaxe to the Arduino environment and am using i2c to pass values between the  Arduino and the picaxe. The logical extension of this would be move to the Rpi for the web serving etc.

Craig
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, please post your code or perhaps post a link to thread you have for your project?  smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
I'd appreciate getting your code as well.thanks!
Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 830
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am in the middle of a redesign where I will be off loading the heavy lifting of the web page and all decision making to a raspberry pi. So basically you write the web page and serve it from the pi. You have a program running on the pi that communicates with the arduino over i2c.

I've got a write-up of a demo project with example code that does a similar thing distributing the "heavy lifting" part of the web-serving to a Pi, except the Arduinos connect to the Pi via a wireless link using nRF24L01+ radios instead of a wired link.

The demo project was actually inspired by wallaceb's reptile program, and although the demo application doesn't control a vivarium, the web page design will immediately trigger recognition! (Thanks again wallaceb! :-)

Anyway, here's the link to the project pages: http://embeddedcoolness.com/rfxduino-demo-projects/

Note that you can't really compile and run the code in the later stages of the sketch development without the RFXduino gateway system, but even without it the general design principles and structure of the program may be of interest.
Logged

WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Really it's great project. I'm not expert in arduino. I saw this post before and this gave me idea to do something similar at home. so, i bought a an Arduino mega 2560 with ethernet shield to test this code. I got the boards this morning. I downloaded Arduino IDE 1.0.5 and your code. but when compiling, i got some errors :
Code:
I:\Users\drupalmavie\Documents\Arduino\libraries\EthernetDNS\EthernetDNS.cpp:25:23: error: wiring.h: No such file or directory
I:\Users\drupalmavie\Documents\Arduino\libraries\EthernetDNS\EthernetDNS.cpp: In member function 'DNSError_t EthernetDNSClass::_sendDNSQueryPacket(const char*)':
I:\Users\drupalmavie\Documents\Arduino\libraries\EthernetDNS\EthernetDNS.cpp:247: error: 'millis' was not declared in this scope
I:\Users\drupalmavie\Documents\Arduino\libraries\EthernetDNS\EthernetDNS.cpp: In member function 'DNSError_t EthernetDNSClass::pollDNSReply(byte*)':
I:\Users\drupalmavie\Documents\Arduino\libraries\EthernetDNS\EthernetDNS.cpp:375: error: 'millis' was not declared in this scope
I:\Users\drupalmavie\Documents\Arduino\libraries\EthernetDNS\EthernetDNS.cpp: In member function 'DNSError_t EthernetDNSClass::resolveHostName(const char*, byte*)':
I:\Users\drupalmavie\Documents\Arduino\libraries\EthernetDNS\EthernetDNS.cpp:402: error: 'delay' was not declared in this scope

As you can see, it's related to wiring.h (this file i can't find it in arduinos core folders) ans i have no idea. how can i solve this?

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I resolved the error. it was an outdate library that I used. now, I tested the project and i have to congratulate you for this work.
Good job Man and many thanks for the sharing.
I will learn a lot from this.
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I resolved the error. it was an outdate library that I used. now, I tested the project and i have to congratulate you for this work.
Good job Man and many thanks for the sharing.
I will learn a lot from this.


i am glad to hear you resolved the issue on your own. and i also want to thank you for your compliments.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!!

I've been taking a look at your project and in my opinion is the best arduino project I've ever seen.

Currently I've been doing another project for controlling an irrigation system and I would like to control it with an SD webserver.

The HTML is done, and the most of the webserver works correctly but I've still got a couple of problems. Once of them is that I'm using the get method to send the orders to the arduino board from the SD (I've got an arduino mega) but when I click on differents options quickly it takes time to send the orders and there's a delay. My webserver is much smaller than yours so I guess you have found the correct way to do it.

I would like to ask you, how do you do to send all those orders from the HTML webserver without any delay??

Thanks!!!
« Last Edit: July 29, 2014, 09:34:27 am by gcp900 » Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!!

I've been taking a look at your project and in my opinion is the best arduino project I've ever seen.

Currently I've been doing another project for controlling an irrigation system and I would like to control it with an SD webserver.

The HTML is done, and the most of the webserver works correctly but I've still got a couple of problems. Once of them is that I'm using the get method to send the orders to the arduino board from the SD (I've got an arduino mega) but when I click on differents options quickly it takes time to send the orders and there's a delay. My webserver is much smaller than yours so I guess you have found the correct way to do it.

I would like to ask you, how do you do to send all those orders from the HTML webserver without any delay??

Thanks!!!

thank you very much for the compliment, and as always please feel free to take my code and do as you wish with it  smiley-mr-green smiley-cool

now on to the issue at hand, i would like to get a better clarification on what you are trying to do. when you refer to "sending orders from the HTML" are you referring to individual instances of hitting the "submit" button to cause the HTML form to be processed, or are you referring to all of the individual data entry boxes within the HTML form?

if you are referring to the first idea, then yes, there is a delay of (what i would guess to be a second or so) where the data is sent to the arduino (i am also using a mega), the arduino processes the data, and the web-page is subsequently updated. 

if you are referring to the latter, then i am not sure what your issue is. if you follow the standard HTML format

<form action=POST>
<form inputs (I.E. buttons, text boxes, select boxes etc..)
submit button
<end form>

refer here
Code:
<form action=page3 method=POST>"
  "<p>&nbsp;</p>"
  "<div style=\"margin-left: 250px; margin-right: 10px;\"><table width=\"67%\" height=\"28%\" border=\"1\">" 
    "<tr>"
      "<td colspan=\"2\"><center>Minimum humidity level is 10% maximum hmidity level is 90%<br>All settings will be saved to memory and will persist between power outage</center></td>"
    "</tr>"
    "<tr>"
  "<td height=\"10%\" nowrap=\"nowrap\" class=\"style42\"><strong>Day Time Humidity %</strong></td>"
  "<td><div align=\"center\" class=\"style44\" id=\"ts1\">"
                  "<table>"
                    "\002"
                    "<tr>"
                      "<td>ON:</td>"
                        "<td><input type=\"text\"  align = \"MIDDLE\"  maxlength = \"3\" name=\"1\" value=\"\002\"></td>"
                    "</tr>"
                    "\002"
                    "<tr>"
                        "<td>OFF:</td><td><input type=\"text\"  align = \"MIDDLE\"  maxlength = \"3\" name=\"2\" value = \"\002\"></td>"
                    "</tr>"
                  "</table></div>"
                 "</td>"
    "</tr>"
    "<tr>"
  "<td height=\"10%\" nowrap=\"nowrap\" class=\"style42\"><strong>Night Time Humidity %</strong></td>"
  "<td><div align=\"center\" id=\"tstat1\">"
                  "<table>"
                  "\002"
                    "<tr>"
                      "<td>ON:</td>"
                      "<td><input type=\"text\"  align = \"MIDDLE\"  maxlength = \"3\" name=\"3\" value=\"\002\"></td>"
                    "</tr>"
                    "\002"
                    "<tr>"
                      "<td>OFF:</td>"
                      "<td><input type=\"text\"  align = \"MIDDLE\"  maxlength = \"3\" name=\"4\" value = \"\002\"></td>"
                    "</tr>"
                  "</table></div>"
                "</td>"
    "</tr>"
  "</table>"
  "<br>"
  "<center><input type=submit value=Submit></center>"
  "</div>"
  "</div>"
  "<input type=hidden name=\"99\" value=\"%\">"
  "</form>"
  "</center>"
  "</body>";

/**

all of the HTML data inputs within the <form></form> all get submitted as a single data stream when the submit button is pressed.

i am assuming the first issue is what you are referring to, and if it is, it is a phenomenon inherent in the way the code works.
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i figured i would update that the system has been running with zero operational issues for 8 months now. glad to see all of the stability issues in the beginning have been solved.  smiley-mr-green
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

last code https://www.dropbox.com/s/0twzm2aztgg8o22/webserver-1.3%2012-22-2013%20-%20Copy.zip not work for me
but "1.1 - 6-6-2013" version runs.
why?
Many thanks!
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can you better explain what you mean by not working? are there compilation errors? does it malfunction when you try download the code? please be as specific as possible.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Compilation and uploading are ok, problems occur when trying to access the webserver. http://www.youtube.com/watch?v=j-hMHYPpOUA&feature=youtu.be
If I connect  first  the USB cable and after 5 second eth cable the  webserver it works.
Not connected sensors and RTC module not work (time and date are 45: 165: 85 165/165/20165)
Thanks and sorry for my english!
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So to confirm, if you connect the usb cable to power the system and then connect the Ethernet cable, the system works, and that if you do not have the sensors attached it works?

What are you using to power the arduino? Are you using the usb connection, or are you using a external power supply?
At the moment, I do not have enough information from you to know what might be wrong.
Logged

Pages: 1 ... 5 6 [7]   Go Up
Jump to: