So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By liderbug
#76068 Setup: 3 Lctech relays w generic 8266s, a 2A 5v supply. A 3 speed fan.
fancontrol.png
(Thanks to Ruby)
COM is 110V in
CH0 goes nowhere = off
CH1 = Low
CH2 = Med
CH3 = High
The 5v is daisy chained across all three relay boards.
Once a minute the program on my RasPi reads greenhouse temp/humd. - if (temp > 78) curl fan1 on, temp > 80 fan2 on, > 82 fan3 on [ curl http://fanrelay1/on ]

Problem: Plug in the 5v, plug in the 110v - everything works - for a while then I loose WIFi connection.

I assume the 2A supply will run all 3 8266s - the same one runs my RasPi-3B no problem.
Is there a memory leak? IE: I can only query (http://fan1/on(off)) 500 times without a reboot. Do I need to keep count of queries and ESP.restart after, say, 60?

My INO sketch (simple http-like server) has in loop:
if(!connection_state)
connect (); // reconnect - not working
ESP.restart
Although I read somewhere that that only checks to see if the chip has an IP and all 3 are static.
I thank you for any help/pointers

img2.jpg
img1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
By rudy
#76069
Is there a memory leak? IE: I can only query (http://fan1/on(off)) 500 times without a reboot. Do I need to keep count of queries and ESP.restart after, say, 60?


Maybe. There has been some problems with the latest releases. Some problems have been fixed. What version of Arduino/ESP8266 are you using?

Thanks for the pictures. I would use some kind of plastic separator between your boards.

What do you grow?
User avatar
By liderbug
#76073 If this is a dupe, sorry. I did this post earlier today and don't see it - sidetracked, my story and...

>Maybe. There has been some problems with the latest releases. Some problems have been fixed.
I've got a 12E with a temp sensor on my hottub and it would run for ?3 days? and just not respond. I'd have to open the panel up, cycle power. So along with http://hottub/temp I added http://hottub/reboot. Then in crontab added a midnight curl ... reboot. That was about 3 months ago and havent had a problem.

>What version of Arduino/ESP8266 are you using?
Ver 1.6.13

>Thanks for the pictures. I would use some kind of plastic separator between your boards.
If I had a 3D printer I could do something real purdy. Right now I've been in and out 2-3 times a day trying to get the code right. The wires are stiff enough that once in place nothing moves. I've got the following (pseudo) running:
======
turn on/off
count++
if (count > 30)
ESP.restart
======
I'll try that for a few days. I have another set (3) of chips and a jig and can reprogram in a mater of minutes, then just swap out.

What do you grow? https://lidderdale.net/hydro The RED line on the graph is the line I've been trying to control.

Thanks for the advice. :D
User avatar
By tngw1500se
#76077 I don't understand why you are using 3 esp's or worried about WiFi connectivity. One esp would do it if you connected to a 4 channel relay board and a temp sensor.

I'd use a NodeMCU. I'd also use a watchdog timer so the ESP would reboot by itself in the event of a brain fart in the ESP.

Then I'd wire the relays high voltage side so that if the ESP fried itself, (relays un-powered), the "default relay position" would be something my plants could live with. Write your "if's" based upon the default relay position.