I'm stumped. I'm hoping someone here as some insight into why I'm experiencing what I'm experiencing.
The heck am I trying to do?Part one:
I have an array of sensors that I'm reading. Temp, light, and various other analog sensors. I'm taking those values and serving up a webpage to display them. You can see it live here:
http://garden.dagobah-system.com/ tadaa! it's works see. Happy webpage. Refresh manually and you can see the data update. For the record, that is being served up directly from my Arduino. That webpage lives on the arduino. I'm not copying txt files to an Apache or IIS server or anything. That's all Arduino right there.
Part two:
Part two of this little gizmo, goes out to a "real" webserver (IIS, server in my house, on the network, etc..) and looks at a page that looks like this.
Yup. It's a webpage that displays the number zero. It's literally a txt file with 1 character in it, saved as a .html file. This file lives on a local IIS server.
OH, sometimes it looks like this:
The number 1. Same file, just the content changes. It changes from a 1 to a 0. Right now I'm changing it manually for testing. eventually it's state will be changed by a.....blah blah blah. I'll share when I'm done and it works.
The code on the arduino has 4 functions.
1. read the sensors: - Check! Works great.
2. Serve up that webpage: - Check! works great.
3. READ that 1 or 0 from that other page. -Check! Works great
4. Turn on an LED (place holder for a 12V water valve) if function 3 =1, turn it off if function 3 = 0. Check. Works great!
I can let this run, and change that 1 to a 0 for days and it just continues to work. LED turns on and off, the sensors are all read properly and verified through the webpage and the serial monitor debug function I added.
The problem:
If I view that first webpage (the one with all the temps on it-served up from the Arduino directly) from a PC inside my network, the Arduino freaks the HECK out. For some reason, it locks up and will no longer READ the 1 or 0 webpage. It continues to read and display the temps, but it stops properly reading the 1 or 0 site served up on my local IIS server. If I reset the ethernet shield connected to the arduino, it starts working again....untill I view and refresh the data page served up by the arduino directly.
The kicker, is if I view the page from outside my network (RDP'd to a server at my office or on my cellphone for example) the Arduino is fine. It's ONLY if I view/refresh the data page from inside my network. Crazy.
Anyway, I've been chasing this problem for months. I'm happy to post code, in follow-up posts once I've properly commented it, but this seems like something characteristic of the Ethernet Shield. I want SOOO badly to blame this on IIS, but I don't think it's the issue. I think it's something related to the Ethernet shield getting a request while it's trying to READ a page... but why only on the local network is this an issue? Anyway, I'm completely stumped.
Anyone have any ideas? I REALLY don't want to use 2 arduinos with 2 Ethernet shields.
Thanks,
Brian