Closed jonathanpalomino closed 11 months ago
You appear to have something wired wrong because it looks like you're getting loopback.
Also, remove all the parameters from under the uart debug:
. The default settings are better for this.
Parece que tienes algo mal conectado porque parece que estás recibiendo un bucle invertido. Además, elimine todos los parámetros de debajo del uart . La configuración predeterminada es mejor para esto.
debug:
Hice lo mencionado pero ahora devuelve lo siguiente si pongo RX del PZEM con el RX0 del esp32 [23:58:23][VV][scheduler:226]: Running interval '' with interval=10000 last_execution=443162 (now=453163) [23:58:33][VV][scheduler:226]: Running interval '' with interval=10000 last_execution=453162 (now=463163) [23:58:34][VV][api.service:540]: on_ping_request: PingRequest {} [23:58:34][VV][api.service:043]: send_ping_response: PingResponse {} [23:58:41][VV][scheduler:226]: Running interval 'update' with interval=20000 last_execution=451085 (now=471086)
[23:58:41][V][modbus:199]: Modbus write: 01.04.00.00.00.0A.70.0D (8)
Si lo hago al revez, sigue saliendo el mensaje de CRC
Duplicate of #3912 ?
Duplicate of #3912 ?
No, el sensor PZEM no genera información aparentemente ya que en esphome sale NA, estoy sospechando que tal vez tenga que ver con la dirección (podria tener una aleatoria entre 0x01 a 0xf0 segun el fabricante)
Ah right sorry for the spam
I'm also having CRC errors with ESP32 devkit v1, TTL to RS485 (with built-in flow control) and PZEM-016. Previously, I used the PZEM-016 with the supplied USB-RS485 converter using modbus and this worked. I don't have logic analyser but i suspect it's a timing issue with the flow control as found similarly with other ESPhome\modbus related posts. With ESP32 iv tried all sorts with timing and ignoring CRC but still get errors. Hope this can be fixed soon. My alternative is to bypass the whole RS485 and interface directly with TTL like PZEM-004Tv3 update So I completely bypassed the RS485 physical layer (remove MAX485 at both ends so ESP32 Tx/Tx are interfacing directly with PZEM-016 Tx/Rx and it worked with same configuration file. This problem is obviously a timing issue to hardware flow control built around the MAX485 Rx enable. Although im getting data, I do get the following timing errors: [W][component:204]: Component modbus took a long time for an operation (0.07 s). [W][component:205]: Components should block for at most 20-30ms. I also changed from using modbus_controller to pzemac (both using modbus.h) components and both worked with same timing error. Any tips on solving errors? Have tried modbus: send_wait_time: 100ms. But still there.
He logrado resolver el problema. Se trataba de 2 cosas que estaba haciendo mal según lo que encontré por internet: 1.- Había utilizado una fuente independiente de 5v, según el foro de implementación nativa en arduino para el pzem-004t v3 lo debo conectar al RX2 y TX2 así como GND y 3.3v. 2.- Me funciono ponerlo en un protoboard ya que al parecer los cables de puente utilizados estaban haciendo falso contacto.
Al codigo que use solo le cambie : rx_pin: GPIO16 tx_pin: GPIO17
Y el resultado es el siguiente:
220V Energy Reset | OFF | Off On Current | 0.15 A | Energy | 1.0 Wh | Frequency | 60.00 Hz | Power | 23.90 W | Power Factor | 0.68 | Voltage | 229.40 V
The problem
He conectado a los pines RX0 y TX0 sus correspondientes al PZEM-004T V3 (TX y RX) de 100A respectivamente. Sin embargo recibo los siguientes mensajes de error:
22:49:17 | [V] | [modbus:199] | Modbus write: 01.04.00.00.00.0A.70.0D (8) -- | -- | -- | -- 22:49:17 | [D] | [uart_debug:158] | >>> "p\r" 22:49:17 | [V] | [modbus:042] | Modbus received Byte 1 (0X1) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 4 (0X4) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 0 (0X0) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 0 (0X0) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 0 (0X0) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 0 (0X0) 22:49:17 | [W] | [modbus:108] | Modbus CRC Check failed! C022!=00 22:49:17 | [W] | [modbus:108] | Modbus CRC Check failed! C022!=00 22:49:17 | [D] | [uart_debug:158] | <<< "\x01\x04\x00\x00\x00\n" 22:49:17 | [V] | [modbus:042] | Modbus received Byte 10 (0Xa) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 112 (0X70) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 13 (0Xd) 22:49:17 | [V] | [modbus:042] | Modbus received Byte 13 (0Xd)Which version of ESPHome has the issue?
2023.7.0
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2023.7.0
What platform are you using?
ESP32
Board
ESP32-WROOM32
Component causing the issue
pzemac
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
He hecho la prueba con 3 PZEM-004T V3 de 100A sin éxito. Se hizo alimentación del modulo PZEM-004T V3 con transformador HI-LINK de 220V a 5v