Maybe my question is little weird.
- Using rpi3, node mcu, dht11(or another sensor)
- get a data of dht11 on nodemcu
- want this data to rpi3
is it realizable??
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.
Sign up to join this communityMaybe my question is little weird.
is it realizable??
Question
Maybe my question is little weird
Using rpi3, node mcu, dht11 (or another sensor)
get a data of dht11 on nodemcu
want this data to rpi3
is it realizable??
Answer
Ah, your question is not weird all, just a very common Rpi (python) NodeMcu (Lua) newbie programming exercise.
I would recommend to use the very simple UART method (not so complicated as MQTT, which of course you should try later). With real physical wires TX, Rx human can touch (and can use LED to display status, if no scope available), newbies should not find things so scary and easy to troubleshoot. Furthermore you can complete the complicated thing in three steps.
Separately check that Rpi, Esp8266 can themselves loop back (just connecting local Tx to Rx to form a loop, no external connection)
Use a terminal emulator such Win10 puTTY/Superterm, or Rpi puTTY to talk to separately talk to Rpi or Esp8266 (eg, puTTY say "AT/r/n", Rpi or Esp should reply "OK/r/n".
Of course if you have arduino/Rpi UART experience, you can skip Step 2, and just use a Lua snippet with command uart.write() to write a string to UART and Rpi to read the string on the other side.
NodeMcu has good documention for this basic things, but there are many traps, each of which would waste hours. So it is a good idea to carefully a couple of times. For example, NodeMcu UART0 can read and write, but UART1 can read only. The other trouble maker is baud rate. Some modules default to 115,200bps, but some starts with 9,600 baud. This kind of inconsistency across vendors and version also waste much newbies' time.
I have summarized the essential documentation in the reference section below for your easy reference, in case you miss something basic.
Good luck and have a nice project!
References
NodeMcu Open Source Lua Based Firmware and Development Kit Introduction
NodeMcu UART Write - uart.write() Write string or byte to the UART.