Xinyuan-LilyGO / LilyGo-T-Call-SIM800

https://www.aliexpress.com/item/33045221960.html
461 stars 240 forks source link

Use Serial2 to connect Modbus PZEM-0004T energy device #186

Closed brunosso closed 2 years ago

brunosso commented 2 years ago

Hi!

I'm trying to use this board with 2 (two) energy device monitor (PZEM-004T). This is my code https://pastebin.com/bShTmA2m

I can't read values from the PZEM. Is correct to use a library made for Arduino?

Thanks

brunosso commented 2 years ago

I fix the problem! Sure the mistake is in the HWSerial declaration.

With this code i have successfull do the job! https://pastebin.com/jZResW0x

Thanks anyway