xoseperez / espurna

Home automation firmware for ESP8266-based devices
http://tinkerman.cat
GNU General Public License v3.0
2.98k stars 635 forks source link

PZEM004T not working with SoftwareSerial #940

Open xoseperez opened 6 years ago

xoseperez commented 6 years ago

Using PZEM004T with SoftwareSerial is not working. Actually, using an oscilloscope shows that the PZEM is not answering back when using software serial... not sure the reason, but it does when using hardware serial...

Reported in #837 .

xcusso commented 5 years ago

Hi Xose, Sorry for my poor english (I'm catalan but I wrote in english for all community). There is a new version of hardware of PZEM-004T labeled with V3. Has a some variant (the pcb design is very diferent,the optocouplers are white - not black,..), but the main change is in the protocol to communicate with it. Now uses a TTL modbus protocol and the the actual espurna version for this sensor is not working. Is possible to prepare a new integration for this new version of sensor for espurna? I have 2 boards if you need some documentation about.

While I wait for an integration in espurna I made some test with tasmota. For my surprise using the hardserial pins (TX and RX) and the driver of PZEM-016 it works!!!! Pzem-016 uses modbus and maybe compatible (the codes to read parameters) so I think may be easy to transport to espurna. Peacefaire will not produce anymore PZEM-004 old version (black optocouplers), the new version V3 is the only that can we now buy.

If I can bring my (limited experience) with that, I will be very happy to contribute in the amazing espurna project!