Closed Dhruv3872 closed 3 years ago
Hi @Dhruv3872, I have the library running on an ESP32 with hardware serial no problem. Have you tried any of the common issue solutions:
@mandulaj I have the same problem.. "Error reading ..." I use &Serial2 and connect Tx/Rx to 16,17 pin of esp32. I'm quite sure I connect to Tx-Rx correctly but result is the same.. Btw, what i can see is only Rx led is blinking.
@mandulaj I have the same problem.. "Error reading ..." I use &Serial2 and connect Tx/Rx to 16,17 pin of esp32. I'm quite sure I connect to Tx-Rx correctly but result is the same.. Btw, what i can see is only Rx led is blinking.
I'm getting exactly the same results with my pzem-004t from ali and esp32. RX on Pzem flashes during poll, but TX does not. Thus "error reading voltage/current/etc." goes from esp32 to usb-serial. I tried different serial connection, hardware on pins GPIO1+GPIO3, GPIO16+GPIO17 and serial on different other pins. Still no luck. By any chance, didn't you manage to solve it somehow?
upd: I've just fixed it. It wasn't working because i hadn't connected AC power. Now works fine.
Yeah this is a very common problem. It is already in the Readme however if you have any ideas how to make it more clear, let me know. I am closing this issue for now.
Hi, my pzem004t datasheet tells me that the command format for reading the sensor values is different from the sendcmd8 in your library. is it the explanation why i get nan values in my serial monitor?
@Jemeeeeer This library is for the PZEM004T v3.0. If you have the PZEM004T, this library will not work and you should use https://github.com/olehs/PZEM004T instead.
Im using PZEM004t-100A(V3). Im using RX (3) and TX (1). Connected to an AC load and all wires are connected properly. Even the readAddress() is not functioning. I saw in the data sheet that the command format of the master in measuring is Slave Address + 0x04 + Register Address High Byte + Register Address Low Byte + Number of Registers High Byte + Number of Registers Low Byte + CRC Check High Byte + CRC Check Low Byte. However in the library, I saw that the CRC low byte came first and CRC high byte second. does this have anything to do with it I cant read and set the address of my pzem from 0xF8 to 0xF7? It also says that the PZEM has a range of 0x00 to 0xF7 only.
Could you share the datasheet you have?
Yep thats interesting, I can't find the datasheet I used to implement this anymore. I will have to have a closer look at this. But strange that something like that hasn't been observed earlier. Besides on my PZEMs it worked fine. Have you tried swapping the byte order?
i have tried changing the crc byte order in your library by modifying it. it can transmit a command format however, there is no available bytes to read in the response buffer. what seems to be the problem?
Do both LEDs flash on the board?
only the TX LED is blinking,
do u have any idea why my pzem004tv30 rxx pin not blinking? both of the rx and tx pins are connected to a voltage divider so to make it 3.3 V. pzem004tv30 is powered with a 5v external dc supply, while esp32 is powered with microusb connected to pc. im using pins 3, 1 for rxtx serial 0. i still dont know why it isnt receiving data.
up
Do you have the 240V AC line attached? That is where the PZEM chip actually gets the power form. The 5V is only to power the opto-couplers.
I have used the library to work with Arduino UNO and it works fine. With my Nodemcu-32S board, I am not able to get anything on the serial monitor when I run "PZEMHardSerial" example with "&Serial" instead of "&Serial3". Is your library compatible with Nodemcu-32S module? If not, is there a way to make it compatible?
Thanks.