A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By user1829
#23416 yeah, just tried a SSR - no problems at all.

must be an RFI issue with the relays and ESP?

i have read a few things to solve this, but not going to try it tonight...
...
wow, I just tried a different 2-ch relay board, works fine! Ican drop power to the NodeMCU board, reapply power and refresh my html page and it's fine....

arrrghhh!!!! frustration!

this new 2-ch relay board i just used has a "AMTEL 817C" IC on it - but the 'malfunctioning' 4ch one does not - does its mean anything?

gonna leave it for tonight, and try to integrate some DHT22 scripting & logic over the weekend...
User avatar
By user1829
#23464 OK,s o I have another basic question.

as I want to use two DHT22 sensors to read temperature and do a calculation using the 2 readings (if DHT22a temp > DHT22b temp then GPIO2 HIGH, GPIO3 LOW, GPIO4 HIGH or if DHT22a temp < DHT22b temp then GPIO2 LOW, GPIO3 HIGH, GPIO4 LOW)

do I put it all in one init.lua script, along with the HTML code and server stuff? or do I write a few different .LUA files for each thing?

I am trying to conceptualize how it put the things I want on the ESP8266 module?

does anyone know the LUA code to compare the inputs from the DHT22's so I can change the GPIO s to high/low?
User avatar
By Speshal
#24634 I am very much a coding n00b also (read, I just mangle other's code to my uses.....) I know just enough to be dangerous ;)

I'll probably get shouted at for suggesting this but I have a solution I use for a problem a little similar to yours but it involves a paid app and a static android device.

I have 2 x ESP8266 connected to DHT22 sensors that upload temp and humidity data to thingspeak, I then use Tasker on an old Android phone to parse and display the data from thingspeak, once the temperature and humidity are written to variables in Tasker you can do pretty much whatever you wish with them, e.g. If temp A = z degrees then "turn fan on" if Temp B < temp A then "turn fan off"

It's not an elegantly coded solution but allows some degree of flexibility as opposed to hard coding, but, if like me, your coding level is somewhat lacking (nil) then it works.

Here's the code I used - http://www.arduinesp.com/thingspeak - just change the sensor type in line 19 to DHT22

an example of what the sensors send to taker - https://thingspeak.com/channels/38948

I know this probably doesn't help very much but it's a solution that works for me :)

*edit, you can also use a "thing react" on thingspeak to trigger an action should a condition be met from from your DHT22