mholgatem / ThermOS

Another Raspberry Pi Thermostat
https://mholgatem.github.io/ThermOS/
MIT License
77 stars 17 forks source link

Fan Mode & Fail Safe #3

Closed ianriggle closed 8 years ago

ianriggle commented 8 years ago

Good evening. Great project and I'm looking forward to using it!

I have everything set up but not yet hooked to my heater. I have two items to mention.

First, the fan mode doesn't seem to toggle between auto and on. With the system in off mode, and the fan to auto, it stays off, as expected. But when I toggle it to on, my relay never changes state, which is reflected in the "gpio readall" output too. Yet, the ThermOS system thinks it's on.

Second, it seems the system is built without a failsafe mode. Since it's set with pins 11, 13, 15 in output mode, they need power to stay in that state. My concern is that if I have a power outage, and the Pi doesn't recover after the outage my heater will be on. It would be safer if the unit left the pins in an off state until needing to be activated to turn the heater on. That way even if the Pi failed for some reason, it wouldn't leave the heater or AC on.

Please let me know if I'm missing something. Again, looking forward to getting this going!

mholgatem commented 8 years ago

yeah, I know about the fan toggle. somewhere along the lines the daemon reload got removed from the toggle command. it's an easy fix, I just need to find the time.

I'm not quite sure what you are getting at with your second part. As you point out, if you lose power, they will shut off (and so will your heater). When your pi reboots, those pins will automatically be pulled low by the BCM internal resistors (as detailed on page 102). After that, the Linux Kernel can reconfigure them based on the device tree (just don't add a device to your tree that uses those pins and they will stay low). So it should be good.

If you are really worried about the pins 'sticking on' during a reboot, you could add a relay between the raspberry pi and the 5v logic line of your main solid state relay. Then you can write a script that will only turn on the 5v logic relay if the thermostat daemon is up and running.

mholgatem commented 8 years ago

btw, the fan toggle is now fixed. Just run the update script: ~/ThermOS/update.sh