That's an interesting idea but not that practical in this application. There is also no internet access at the location. I might go this way down the road though depending on what we think it may need.
It's actually working fine and has been doing it's job perfectly for the last week.
I have made some improvements and added some features. I was able to get rid of my DHTpro class which I never really liked. It felt like I reinvented the wheel and just stuck it to another wheel. What I did was modify the DHT library to my needs. Not sure why I didn't think of that before but it only took 15 minutes to adapt.
I was also able to add a feature to the relay library that allows me to protect a relay from bumping. I noticed that the vent fan was switching on and off as it went below it's temperature threshold. Now through a public variable a delay time can be set that will keep a relay from turning on too soon after turning off. To me, this was the real advantage of writing a class for my relays.
I was also able to include the utility to dump the data from the SD card using serial commands. I can delete the file as well.
For a guy complaining about running out of program space I managed to add quite a bit. XD
I added an overheat procedure that if it detects a certain threshold will turn off the light, run the fan and check for the temp dropping. If it isn't cooling after a certain time it throws an error message on the LCD and stops running.
One of the things that was troubling me and I was struggling with a solution was to protect against a hot start. If the power went out for several hours this is a non-issue but if it goes out for a few second or minutes it might try to hot start the light. The light doesn't really like that. I kept approaching from the angle of detecting if a power failure had occurred. Then I realized that "hot start" was the answer. I just had to read the temperature near the light during setup. If it's hot the power probably bumped. It then calls a procedure that cools it down or waits a certain time then continues on.
I would never avoid Linux, it's the other ones I avoid. XD
sketchbook.rar (20 KB)