-->
Page 3 of 5

Re: using ESP8266 with two DHT22's to switch fan on/off?

PostPosted: Mon Jul 13, 2015 2:41 pm
by mtlevine0
Yes baby steps are important. Have you tried issuing a "node.restart()" on power up? Also be careful that pin 0 isn't being held low at power up, this causes the device to enter flash mode. I doesn't look like you're using that pin from your lua script though.

Re: using ESP8266 with two DHT22's to switch fan on/off?

PostPosted: Tue Jul 14, 2015 5:25 am
by user1829
um, OK!

i added "node.restart()" at the top of the script, now it just boot loops!

i guess i should have asked how to put it into the script!

i'll just reflash firmware and see how it goes.
....
yep, back into operation again :)

so - where does the restart need to be placed?

also - when trying to flash, it won't flash unless the relays are disconnected from the NodeMCU 3.3 VCC & GND - does this mean my relay board if problematic?

Re: using ESP8266 with two DHT22's to switch fan on/off?

PostPosted: Tue Jul 14, 2015 12:46 pm
by mtlevine0
I'm thinking maybe that relay board is drawing too much current. Those relays are essentially electromagnets . Try powering the relay board from another source while ensuring you keep a ground connection between the relay board and the esp board.

Re: using ESP8266 with two DHT22's to switch fan on/off?

PostPosted: Tue Jul 14, 2015 6:56 pm
by user1829
thanks again for your help!

and well - I DID try to do that, but totally forgot to add the GND to the relay board!

it kinda worked, but the relays were not clicking, I will keep testing tonight...

also - where would I put the "node.restart()" to ensure it gets a fresh start (that's what it is for right?) in a power failure? at the start or end?