nodeMCU dimmer/switch/temp.sensor without arduino

9 years 7 months ago #1067 by cdj
Thanks Dennis, i will try the conversion next week, (I'm in holiday now). I suppose that number arrive correctly because all time that check value it looks good. It seems that sometimes system write value in db before /10 and other times after... I've asked to mr.easyiot exactly when db is written but unanswered.

For pcb i'm desperate, all the continuity test has been done as first without success... I've also reprinted a new pcb.... And esp is not faulty because with usb ttl converter it works... Pheraps level shifting is not good. Other pcb used for relay node with nano is working.... And never used a transistor on tx, really strange believe me :-)

Thanks for answer Dennis

Please Log in or Create an account to join the conversation.

9 years 7 months ago - 9 years 7 months ago #1083 by Dennis
Hello,

I've just created a nodeMCU example for DS18B20 temperature sensor (big thanks to Mr. easyIoT for his guidance in creating authenticated http request in lua!), sensor data is sent every 10 seconds, all happens inside the ESP8266 module, no automation code in easyIoT server is needed - just add virtual node of type "temperature output" (directly setting *input* sensor types is not possible yet, but will in next release i am told), and adjust node address and easyIoT server parameters in "iot.lua", and update wifi credentials in "init.lua".

github.com/DennisSc/easyIoT-nodeMCU/tree.../nodeMCU-LUA/ds18b20

One thing to note, I had many problems with "not enough memory" when calling dofile(xy), until I compiled everything to bytecode: run "node.compile("xy.lua")" on the lua script, then call "dofile("xy.lc")" from init.lua... maybe this also helps with BMP180 sensor reading?

regards

Please Log in or Create an account to join the conversation.

9 years 7 months ago - 9 years 7 months ago #1086 by EasyIoT

Dennis wrote: Hello,

I've just created a nodeMCU example for DS18B20 temperature sensor (big thanks to Mr. easyIoT for his guidance in creating authenticated http request in lua!), sensor data is sent every 10 seconds, all happens inside the ESP8266 module, no automation code in easyIoT server is needed - just add virtual node of type "temperature output" (directly setting *input* sensor types is not possible yet, but will in next release i am told), and adjust node address and easyIoT server parameters in "iot.lua", and update wifi credentials in "init.lua".

github.com/DennisSc/easyIoT-nodeMCU/tree.../nodeMCU-LUA/ds18b20

One thing to note, I had many problems with "not enough memory" when calling dofile(xy), until I compiled everything to bytecode: run "node.compile("xy.lua")" on the lua script, then call "dofile("xy.lc")" from init.lua... maybe this also helps with BMP180 sensor reading?

regards


Thank you for your example. Maybe you can move your post under My Project - that way more people will find your example.
Beta release with AI virtual temperature node will be available soon.

Please Log in or Create an account to join the conversation.

9 years 6 months ago #1263 by cdj

Dennis wrote: I've no idea why your pcb does not work, you should use a multimeter with continuity test to find possible shots or missing connections. But regarding strange sensor values after doing calculation in automation; what about using

float calculatednumber = (Single.Parse(stringvalue) / 10);
( msdn.microsoft.com/en-us/library/2thct5cb(v=vs.110).aspx )

instead of "Convert.toSingle(string)", in your automation code? Also, are you sure that the numbers arrive in good format at your server, i.e. the node is not making the error? Maybe do a serial.print on the received value before starting to calculate with it, then you can see if you receive faulty number...

regards


Dear Dennis, after reprinting pcb finally it works!
I've done conversion in your way but don't really understand why graphics are always the same.... If temp is 24 it wrote 240 and then 24 in database ????
Numbers seems that arrive in good format.

Pheraps we can convert our nodes in new arduino ide for esp format? Is it always LUA or there is a new kind of "firmware" code? I've seen that to program esp you must put it in flash mode....

Don't really know.But i have too much things that aren't working perfectly.

Thanks
Dario

Please Log in or Create an account to join the conversation.

9 years 6 months ago #1433 by lesjaw
Can you help me..

when i send
> =dofile("dht22.lua").read(4,false,false)

it always
> nil 2

i'm using lastest nodemcu firmware.. nodemcu_float_0.9.6-dev_20150406

any suggetion of firmware should i use?

thanks

Please Log in or Create an account to join the conversation.

9 years 6 months ago #1434 by cdj
I use 0.9.5 and not the last. Are you using gpio2?

Please Log in or Create an account to join the conversation.

Time to create page: 0.377 seconds

Forum latest

  • No posts to display.