Maybe my question is little weird.

  1. Using rpi3, node mcu, dht11(or another sensor)
  2. get a data of dht11 on nodemcu
  3. want this data to rpi3

is it realizable??

  • 2
    yes this is possible. you should be able to find tutorials on the web using e.g. the MQTT protocol. – oh.dae.su Apr 29 '19 at 16:38


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??


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.

  1. Separately check that Rpi, Esp8266 can themselves loop back (just connecting local Tx to Rx to form a loop, no external connection)

  2. 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".

  3. 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!


NodeMcu Open Source Lua Based Firmware and Development Kit Introduction

NodMcu Official Documentation

NodeMcu Lua DHT11 Module

NodeMcu C UART Module

NodeMcu Lua Set UART Bit Rate

NodeMcu UART Write - uart.write() Write string or byte to the UART.

  • First of all, Tkank you for your relpy and answer. I have some question... I never know about lua but know about python. So I am trying to using micropython on nodemcu. Also Can I handle it?? Again really Thank you :) – 이효종 Apr 30 '19 at 2:57
  • Yes, go ahead. What are your questions? – tlfong01 Apr 30 '19 at 2:58
  • Oh my goodness. That is a big problem. Let me update my answer later, perhaps this afternoon. There is a confusion. I think micropython has nothing to do with NodeMcu. It runs REPL on itself. – tlfong01 Apr 30 '19 at 3:01
  • hmm.. I know that micropython can mount on nodemcu board.. Isn't it??? – 이효종 Apr 30 '19 at 3:03
  • Well, not exactly. The "board" should be called ESP8266 01/02 ...12/32 board. You can run Lua or microPython. If you run Lua, you must use NodeMcu firmware, not much choice. But if you run microPython, you can say use editor Mu to write your micropython program and uploaded it to the harware board. A not very good analogy is Rpi can load linux OS or Risc OS or WinIoT, ... When you run WinIoT things, it has little to do with linux/Raspbian, ... – tlfong01 Apr 30 '19 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.