I am trying to read some stuff from a power meter through the UART of a Wemos D1 mini (https://www.wemos.cc/en/latest/d1/d1_mini.html)
I have wired it up as suggested here: https://github.com/psvanstrom/esphome-p1reader/#readme
(I realize that that link points to a NodeMCU device while I am using a D1 mini...)
Anyway, I am accessing the d1 mini through webrepl/wifi (not connected through USB) and I am trying to use machine.UART to read the input from my power meter, which is supposed to be the MBUS protocol.
Code: Select all
myuart = UART(0,115200)
myuart.read()
I have also tried the trick mentioned in the section "UART (serial bus)" here: https://docs.micropython.org/en/latest/ ... ckref.html
Like this:
Code: Select all
uos.dupterm(None,1);mb=uart(0,115200,timeout=10000);value=mb.read();uos.dupterm(UART(0,115200),1)
Am I doing something fundamentally wrong here? Where to start looking for the error?