0

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

asked Apr 29, 2019 at 14:23
1
  • 2
    yes this is possible. you should be able to find tutorials on the web using e.g. the MQTT protocol. Commented Apr 29, 2019 at 16:38

1 Answer 1

0

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.

  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!

References

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.

answered Apr 30, 2019 at 2:52
14
  • 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 :) Commented Apr 30, 2019 at 2:57
  • Yes, go ahead. What are your questions? Commented Apr 30, 2019 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. Commented Apr 30, 2019 at 3:01
  • hmm.. I know that micropython can mount on nodemcu board.. Isn't it??? Commented Apr 30, 2019 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, ... Commented Apr 30, 2019 at 3:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.