esphome-p1mini icon indicating copy to clipboard operation
esphome-p1mini copied to clipboard

Aidon 6534 discarding

Open vBrolin opened this issue 2 years ago • 30 comments

Just set up a reader for a Aidon 6534 with a RJ12 connector, which seems to be tested before. Getting messages of discarded reading. Tried the same reader at home on a Sagemcom yesterday and that worked, but here it wont read.

15:00:59 | [W] | [p1reader:258] | Unknown data format (0x7C). Resetting. 15:01:00 | [D] | [switch:016] | 'p1_cts' Turning OFF. 15:01:00 | [D] | [switch:055] | 'p1_cts': Sending state OFF 15:01:00 | [W] | [p1reader:229] | Discarding: fff8fffefefe8efcfffcfcfe7ffc7ffc7ffcfebefcfffefcfefcfcfc7ffcfefe

Any thought why this could be?

vBrolin avatar Oct 06 '23 13:10 vBrolin

That mostly looks like random noise to me. It seem like the Aidon comes with different modules to output data, so your module probably doesn't output the correct thing. See if you can find out what kind of module you have and what it is supposed to output.

If you feel like it you could test different baud rates and/or not inverting the signal etc. But I wouldn't be too hopeful about that working. (This would be done in the yaml file)

Beaky2000 avatar Oct 06 '23 13:10 Beaky2000

I just realized that the Aidon is the one with the binary output (unless they have changed that). Since I don't have a binary meter I can't verify that code whenever I do any updates, so it might be worth going back to an earlier version, when the binary support was added to see if that works.

Beaky2000 avatar Oct 06 '23 13:10 Beaky2000

Tried the 0.3.0 version instead. Didn't get any debug output, but the behavior is the same. The module is branded Aidon 6442SE, RF500.

vBrolin avatar Oct 06 '23 14:10 vBrolin

Seems I'm not the only one with issues with this version. https://community.home-assistant.io/t/using-slimmelezer-to-read-data-from-energy-meter-aidon-6534-with-communication-module-6442se-swedish-branschrekommendation/414522/2 Here's someone who has fixed it for p1reader.

vBrolin avatar Oct 06 '23 14:10 vBrolin

0.3.0 is before the binary support required for the Aidon, so that is not going to work.

This version is verified with an Aidon: https://github.com/Beaky2000/esphome-p1mini/tree/0950a8f734198b2f7ebaddabac2f133c19aacb40

Beaky2000 avatar Oct 06 '23 15:10 Beaky2000

Same result with that version.

vBrolin avatar Oct 06 '23 15:10 vBrolin

Ok, good to know. That also means that I haven't broken anything that used to work, but it does not solve your problem.

I found the following quote when reading some threads:

Supporten har nu meddelat att enheten inte är kompatibel med min elmätare :( Orsaken som jag tolkar det är att min enhet (Aidon 6534 + 6442S) är uppsatt med att köra EFS profilen (HAN protokollet) som normalt används för RJ45 portar. Detta verkar vara ett problem som fler har identifierat. Således om ni har denna mätare, kontrollera med ert elbolag om de kör EFS profilen, då kommer det troligen inte att fungera med Homewizard P1 meter (om jag nu fattat allt rätt...). Det är möjligt att vissa bolag kan aktivera EFS2 profilen för denna utrustning och då borde det fungera bättre. Mitt nätbolag kunde det inte.

So it sounds like the meter might be outputting the "NVE" format usually used with en RJ45 port, even if you have the RJ12 port and in that case the p1mini is never going to work.

I don't think I can help you fix this, but if you do find a solution, please let me know!

Beaky2000 avatar Oct 06 '23 15:10 Beaky2000

Thank you! I'll contact the my grid owner and check if they can verify that, and perhaps change.

vBrolin avatar Oct 06 '23 15:10 vBrolin

Got hold of them and they claim they use EFS2. At this point I'll just assume there's something wrong with the soldering or something. I'll replace the device next time I'm on site, hopefully that will resolve this issue.

vBrolin avatar Oct 09 '23 08:10 vBrolin

Replaced the ESP with another, verified working unit and it's still the same. It should be the correct module, it should use the right protocol, but yeah, for some reason it just wont work.

vBrolin avatar Oct 13 '23 09:10 vBrolin

Sorry that I can't help. FWIW, the incorrect format identifier followed by the discarded data is the entire message, so 7Cfff8fffefefe8efcfffcfcfe7ffc7ffc7ffcfebefcfffefcfefcfcfc7ffcfefe is the complete data being received (according to your debug message in this thread). This is definitely not Ascii, but the Aidon does use binary format. This might just be noise, but if you can get an example of a correct binary message, it might be possible to analyze the difference.

Beaky2000 avatar Oct 13 '23 10:10 Beaky2000

No worries, just wanted it to be documentet in case someone else had the same issue.

Enabling debugging, I'll post it all here.

[12:35:13][I][app:102]: ESPHome version 2023.9.3 compiled on Oct 13 2023, 12:33:18 [12:35:13][C][wifi:546]: WiFi: [12:35:13][C][wifi:382]: Local MAC: CC:50:E3:1F:C0:CA [12:35:13][C][wifi:383]: SSID: [redacted] [12:35:13][C][wifi:384]: IP Address: 192.168.103.149 [12:35:13][C][wifi:385]: BSSID: [redacted] [12:35:13][C][wifi:387]: Hostname: 'p1mini' [12:35:13][C][wifi:389]: Signal strength: -79 dB ▂▄▆█ [12:35:13][C][wifi:393]: Channel: 11 [12:35:13][C][wifi:394]: Subnet: 255.255.255.0 [12:35:13][C][wifi:395]: Gateway: 192.168.103.1 [12:35:13][C][wifi:396]: DNS1: 192.168.103.2 [12:35:13][C][wifi:397]: DNS2: 192.168.103.2 [12:35:13][C][logger:357]: Logger: [12:35:13][C][logger:358]: Level: DEBUG [12:35:13][C][logger:359]: Log Baud Rate: 115200 [12:35:13][C][logger:361]: Hardware UART: UART0 [12:35:13][C][uart.arduino_esp8266:102]: UART Bus: [12:35:13][C][uart.arduino_esp8266:103]: TX Pin: GPIO1 [12:35:13][C][uart.arduino_esp8266:104]: RX Pin: GPIO3 [12:35:13][C][uart.arduino_esp8266:106]: RX Buffer Size: 256 [12:35:13][C][uart.arduino_esp8266:108]: Baud Rate: 115200 baud [12:35:13][C][uart.arduino_esp8266:109]: Data Bits: 8 [12:35:13][C][uart.arduino_esp8266:110]: Parity: NONE [12:35:13][C][uart.arduino_esp8266:111]: Stop bits: 1 [12:35:13][C][uart.arduino_esp8266:113]: Using hardware serial interface. [12:35:13][W][uart.arduino_esp8266:127]: You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0. [12:35:13][C][switch.gpio:068]: GPIO Switch 'p1_cts' [12:35:13][C][switch.gpio:090]: Restore Mode: always OFF [12:35:13][C][switch.gpio:031]: Pin: GPIO4 [12:35:13][C][switch.gpio:068]: GPIO Switch 'status_led' [12:35:13][C][switch.gpio:090]: Restore Mode: always OFF [12:35:13][C][switch.gpio:031]: Pin: GPIO2 [12:35:13][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'secondary_p1_rts' [12:35:13][C][gpio.binary_sensor:016]: Pin: GPIO16 [12:35:13][C][template.number:050]: Template Number 'p1mini update period' [12:35:13][C][template.number:050]: Icon: 'mdi:timer' [12:35:13][C][template.number:050]: Unit of Measurement: 's' [12:35:13][C][template.number:051]: Optimistic: YES [12:35:13][C][template.number:052]: Update Interval: 60.0s [12:35:13][C][version.text_sensor:021]: Version Text Sensor 'p1mini ESPHome Version' [12:35:13][C][version.text_sensor:021]: Icon: 'mdi:new-box' [12:35:13][C][captive_portal:088]: Captive Portal: [12:35:13][C][web_server:161]: Web Server: [12:35:13][C][web_server:162]: Address: p1mini.local:80 [12:35:13][C][mdns:115]: mDNS: [12:35:13][C][mdns:116]: Hostname: p1mini [12:35:13][C][ota:097]: Over-The-Air Updates: [12:35:13][C][ota:098]: Address: p1mini.local:8266 [12:35:13][C][ota:101]: Using Password. [12:35:13][C][api:138]: API Server: [12:35:13][C][api:139]: Address: p1mini.local:6053 [12:35:13][C][api:141]: Using noise encryption: YES [12:35:13][C][wifi_signal.sensor:009]: WiFi Signal 'p1mini WiFi Signal' [12:35:13][C][wifi_signal.sensor:009]: Device Class: 'signal_strength' [12:35:13][C][wifi_signal.sensor:009]: State Class: 'measurement' [12:35:13][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm' [12:35:13][C][wifi_signal.sensor:009]: Accuracy Decimals: 0 [12:35:13][C][debug:064]: Debug component: [12:35:13][D][debug:076]: ESPHome version 2023.9.3 [12:35:13][D][debug:080]: Free Heap Size: 18464 bytes [12:35:13][D][debug:108]: Flash Chip: Size=4096kB Speed=40MHz Mode=DOUT [12:35:13][D][debug:323]: Chip ID: 0x001FC0CA [12:35:13][D][debug:324]: SDK Version: 2.2.2-dev(38a443e) [12:35:13][D][debug:325]: Core Version: 3.0.2 [12:35:13][D][debug:326]: Boot Version=31 Mode=1 [12:35:13][D][debug:327]: CPU Frequency: 80 [12:35:13][D][debug:328]: Flash Chip ID=0x0016405E [12:35:13][D][debug:329]: Reset Reason: Software/System restart [12:35:13][D][debug:330]: Reset Info: Software/System restart [12:35:20][D][sensor:093]: 'p1mini WiFi Signal': Sending state -82.00000 dBm with 0 decimals of accuracy [12:35:20][W][p1reader:249]: Unknown data format (0x7C). Resetting. [12:35:20][D][switch:016]: 'p1_cts' Turning OFF. [12:35:20][D][switch:055]: 'p1_cts': Sending state OFF [12:35:20][W][p1reader:218]: Discarding: fff8fffefefe8efcfffcfcfe7ffffffffcfebefcfffefcfefcfcfcfffffcfefc [12:35:20][W][p1reader:218]: Discarding: fefebefcfefcfefcfcfcfcfcfcfcfcfcfcfcfefebefcfefcfefcfcfcfcfcfcfe [12:35:20][W][p1reader:218]: Discarding: fcfefebefcfffefcfefcfcfcfcfcfcfefebefcfffcfefcfcfcfcfebefcfcfefc [12:35:20][W][p1reader:218]: Discarding: fcfcfcfcfcfcfebefcfcfefcfcfcfcfcfcfcfcfebefcfffcfefcfcfcfcfefcfe [12:35:20][W][p1reader:218]: Discarding: befcfffcfefcfcfcfcfffffffebefcfcfefcfcfcfcfcfcfcfebefcfffffcfefc [12:35:20][W][p1reader:218]: Discarding: fcfcfcfffffebefcfffcfefcfcfcfcfcfcfcfebefcfffcfefcfcfcfcfcfffebe [12:35:20][W][p1reader:218]: Discarding: fcfcfefcfcfcfcfcfcfcfebefcfcfefcfcfcfcfcfcfcfcfebefcfffcfefcfcfc [12:35:20][W][p1reader:218]: Discarding: fcfffcfebefcfffcfefcfcfcfcfcfcfcfcfebefcfffffcfefcfcfcfcfcfcfebe [12:35:20][W][p1reader:218]: Discarding: fcfcfefcfcfcfcfcfcfcfcfebefcfffcfefcfcfcfcfcfcfebefcfcfefffcfebe [12:35:20][W][p1reader:218]: Discarding: fcfcfefffcfebefcfcfefebefcfffcfefcfcfcfefcfebefcfffcfefcfcfcfcfe [12:35:20][D][switch:016]: 'status_led' Turning OFF. [12:35:21][D][switch:055]: 'status_led': Sending state OFF [12:35:21][W][p1reader:218]: Discarding: befcfffcfefcfcfcfcfe3efcfefefefe [12:35:21][D][switch:012]: 'p1_cts' Turning ON. [12:35:21][D][switch:055]: 'p1_cts': Sending state ON [12:35:21][D][switch:012]: 'status_led' Turning ON. [12:35:21][D][switch:055]: 'status_led': Sending state ON [12:35:30][D][sensor:093]: 'p1mini WiFi Signal': Sending state -83.00000 dBm with 0 decimals of accuracy [12:35:30][W][p1reader:249]: Unknown data format (0x7C). Resetting. [12:35:30][D][switch:016]: 'p1_cts' Turning OFF. [12:35:30][D][switch:055]: 'p1_cts': Sending state OFF [12:35:30][W][p1reader:218]: Discarding: fff8fffefefe8efcfffcfcfe7ffffffffcfebefcfffefcfefcfcfcfffffcfefc [12:35:30][W][p1reader:218]: Discarding: fefebefcfefcfefcfcfcfcfcfcfcfcfcfcfcfefebefcfefcfefcfcfcfcfcfcfe [12:35:30][W][p1reader:218]: Discarding: fcfefebefcfffefcfefcfcfcfcfcfcfefebefcfffcfefcfcfcfcfefebefcfcfe [12:35:30][W][p1reader:218]: Discarding: fcfcfcfcfcfcfcfebefcfcfefcfcfcfcfcfcfcfcfebefcfffcfefcfcfcfcfffc [12:35:30][W][p1reader:218]: Discarding: febefcfffcfefcfcfcfcfffebefcfcfefcfcfcfcfcfcfcfebefcfffffcfefcfc [12:35:30][W][p1reader:218]: Discarding: fcfcfffffebefcfffcfefcfcfcfcfcfcfcfebefcfffcfefcfcfcfcfcfffebefc [12:35:30][W][p1reader:218]: Discarding: fcfefcfcfcfcfcfcfcfebefcfcfefcfcfcfcfcfcfcfcfebefcfffcfefcfcfcfc [12:35:30][W][p1reader:218]: Discarding: fffcfebefcfffcfefcfcfcfcfcfcfcfcfebefcfffffcfefcfcfcfcfcfcfebefc [12:35:30][W][p1reader:218]: Discarding: fcfefcfcfcfcfcfcfcfcfebefcfffcfefcfcfcfcfcfefcfebefcfcfefffcfebe [12:35:30][W][p1reader:218]: Discarding: fcfcfefffcfefebefcfcfefebefcfffcfefcfcfcfcfebefcfffcfefcfcfcfcfe [12:35:30][D][switch:016]: 'status_led' Turning OFF. [12:35:31][D][switch:055]: 'status_led': Sending state OFF [12:35:31][W][p1reader:218]: Discarding: befcfffcfefcfcfcfcfe3ef7fffcfefe [12:35:31][D][switch:012]: 'p1_cts' Turning ON. [12:35:31][D][switch:055]: 'p1_cts': Sending state ON [12:35:31][D][switch:012]: 'status_led' Turning ON. [12:35:31][D][switch:055]: 'status_led': Sending state ON [12:35:40][D][sensor:093]: 'p1mini WiFi Signal': Sending state -83.00000 dBm with 0 decimals of accuracy [12:35:40][W][p1reader:249]: Unknown data format (0x7C). Resetting.

vBrolin avatar Oct 13 '23 10:10 vBrolin

Um, I just noted this message in your last log:

You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.

Using the same UART for logging and communication with the meter could definitely cause errors like these! Serial logging is disabled in the yaml for this reason!

Beaky2000 avatar Oct 19 '23 08:10 Beaky2000

I guess it got in there while changing out the codes multiply times. I've removed it now but it still showing the same messages.

vBrolin avatar Oct 19 '23 08:10 vBrolin

Messages after the change.

10:19:31 | [D] | [switch:012] | 'p1_cts' Turning ON. 10:19:31 | [D] | [switch:055] | 'p1_cts': Sending state ON 10:19:31 | [D] | [switch:012] | 'status_led' Turning ON. 10:19:31 | [D] | [switch:055] | 'status_led': Sending state ON 10:19:34 | [D] | [sensor:093] | 'p1mini WiFi Signal': Sending state -87.00000 dBm with 0 decimals of accuracy 10:19:39 | [W] | [p1reader:249] | Unknown data format (0x0F). Resetting. 10:19:39 | [D] | [switch:016] | 'p1_cts' Turning OFF. 10:19:39 | [D] | [switch:055] | 'p1_cts': Sending state OFF 10:19:39 | [W] | [p1reader:218] | Discarding: fbc3e3c3c3c3c3c3c3dfdffbe3c3fbfbffff783f7f8feeb8bfbebfbcbfb8bcb8 10:19:39 | [W] | [p1reader:218] | Discarding: b8b8b8bbbbbfbf6ecfbfff78fcefec3cc3fb6ebfb8bcb8b8b8b8bff7efec3cff 10:19:39 | [W] | [p1reader:218] | Discarding: 7f8feec3fbf3fbfffbc3e3c3c3c3c3fbdfe3bcbfff78ff7f8feec3fbdbcffbff 10:19:40 | [W] | [p1reader:218] | Discarding: bbbffbc3e3c3c3c3c3fbc3c3c3fbffefec3cffc3fbfbcffbfffbc3e3c3c3c3c3 10:19:40 | [W] | [p1reader:218] | Discarding: fbc3cffbfbff7f8feec3fbfbdbfbffbfb8bcb8b8b8b8bfb8b8b8bfefec3cffc3 10:19:40 | [W] | [p1reader:218] | Discarding: fbdbdffbfffbc3e3c3c3c3c3fbfcb8b8bf78ff7f8feeb8befffbc3bcb8b8b8b8 10:19:40 | [W] | [p1reader:218] | Discarding: bf6efb78ff7f3cc3bfbeb7bfb8bcb8b8b8b8bfb8b8b8bfff78ff7f8feeb8bfbe 10:19:40 | [W] | [p1reader:218] | Discarding: bebfbfb8bcb8b8b8b8bfbbbbb8bfff78ff7f8feec3fbfbdffbfffbc3e3b8b8b8 10:19:40 | [W] | [p1reader:218] | Discarding: b8bfb8b8b8bfff78ff7f8feec3bfbfbebffbc3e3c3c3c3c3fbc3fbcfbfff787f 10:19:40 | [W] | [p1reader:218] | Discarding: 8feeb8dfdbfbfffbc3e3dbf3dbfbeffbfbefec3cffc3fbffdbfbfffbc3e3dbf3 10:19:40 | [W] | [p1reader:218] | Discarding: dffbcffbfbefec3cffc3fbdbfffbc3bcbbbefffbefec3cffc3fbf7fbffb8bcb8 10:19:40 | [W] | [p1reader:218] | Discarding: b8b8bfbff8efec3cffb8bf6efbb8bcb8b86ebef8efec3cb8bfcffbfffbb8bcb8 10:19:40 | [D] | [switch:016] | 'status_led' Turning OFF. 10:19:40 | [D] | [switch:055] | 'status_led': Sending state OFF 10:19:40 | [W] | [p1reader:218] | Discarding: b8b8bfbbbff8efec3cf3e31b7f8f 10:19:41 | [D] | [switch:012] | 'p1_cts' Turning ON. 10:19:41 | [D] | [switch:055] | 'p1_cts': Sending state ON 10:19:41 | [D] | [switch:012] | 'status_led' Turning ON. 10:19:41 | [D] | [switch:055] | 'status_led': Sending state ON 10:19:44 | [D] | [sensor:093] | 'p1mini WiFi Signal': Sending state -89.00000 dBm with 0 decimals of accuracy 10:19:49 | [W] | [p1reader:249] | Unknown data format (0x0F). Resetting. 10:19:49 | [D] | [switch:016] | 'p1_cts' Turning OFF. 10:19:49 | [D] | [switch:055] | 'p1_cts': Sending state OFF 10:19:49 | [W] | [p1reader:218] | Discarding: c3fbc3e3dbdfcfc3cfefc3efcfefffc3ffefec3cffc3fbcffbe3fbc3e3c3c3c3 10:19:49 | [W] | [p1reader:218] | Discarding: bbbcbfb8bcb8b8b8b8b8b8b8b8bfb8b8b8fffc7f8feec3fbdffbe3fbc3e3c3c3 10:19:49 | [W] | [p1reader:218] | Discarding: b8bfbebfbcbfb8bcb8b8b8b8bbdbbfbf7fcffbffff783fefec3cc3fbcffbfffb 10:19:50 | [W] | [p1reader:218] | Discarding: f3c3cffbffff78ff7f8feec3fbdbcffbfffbc3e3c3c3c3c3fbefdffbfbffefec 10:19:50 | [W] | [p1reader:218] | Discarding: b8bfefec3cffc3fb6efffbb8bcb8b8b8b8bfb86ebfefec3cc3fbfbbbbffbb8bc 10:19:50 | [W] | [p1reader:218] | Discarding: b8b8b8b8bfb8b8b8ffefec3cffc3fbdbdfbfc3e3c3c3c3c3fbc3b8b878ffec3c 10:19:50 | [W] | [p1reader:218] | Discarding: ffc3fbdbf3fbfffbc3e3c3c3b8b8bf6efbfbffff78efecbeffc3fbf3bffbc3e3 10:19:50 | [W] | [p1reader:218] | Discarding: c3c3c3b8bfb8b8b8ff78ff7f8feec3fbf3f3fbfbc3e3c3c3b8b8bfbb37bfff78 10:19:50 | [W] | [p1reader:218] | Discarding: ffec3cffb8bfbfb7fffbc3e3c3c3b8b8bfb8b8b8bfff78ff7f8feec3fbfbf3fb 10:19:50 | [W] | [p1reader:218] | Discarding: fffbb8bcb8b8b8b8bfb8bfb8bfff78ff7f8feeb8bfb7b7fbb8bcbbbebbbfb8bf 10:19:50 | [W] | [p1reader:218] | Discarding: ffefec3cffc3fbdbfffbc3e3dbf3b7fffbfb7f8feec3fbffdbfbfffbc3e3dbf3 10:19:50 | [W] | [p1reader:218] | Discarding: bebfb8bfffefec3cffc3bfcffbffb8bcb8b8fbe3bff8efec3cc3fb6efffbc3bc 10:19:50 | [W] | [p1reader:218] | Discarding: b8b86efffb0f7f3cffc3fbffcffbbfb8bcb8b8b8bfbbbff8efec3c3fbf3cecfc 10:19:50 | [D] | [switch:016] | 'status_led' Turning OFF. 10:19:50 | [D] | [switch:055] | 'status_led': Sending state OFF 10:19:51 | [D] | [switch:012] | 'p1_cts' Turning ON. 10:19:51 | [D] | [switch:055] | 'p1_cts': Sending state ON 10:19:51 | [D] | [switch:012] | 'status_led' Turning ON. 10:19:51 | [D] | [switch:055] | 'status_led': Sending state ON

vBrolin avatar Oct 19 '23 08:10 vBrolin

It looks like it might have made a difference since the data format identifier went from being 0x7C to 0x0F, although that could be a coincidence.

I wish we had a dump of a correct binary message to compare with so we could tell if this is close to that or just random noise!

Beaky2000 avatar Oct 19 '23 08:10 Beaky2000

Could this be useful? https://www.skekraft.se/wp-content/uploads/2021/03/Aidon_Feature_Description_RJ12_HAN_Interface_EN.pdf It has example data at the last page.

In this project, which I guess share a lot with this project. https://github.com/psvanstrom/esphome-p1reader This is in the documentation: "If your electricity supplier is using Aidon 6442SE or Aidon 653X, you might also need to change the instantiation of the meter_sensor. As these meters are sometimes using the HDLC-protocol instead of ASCII. Open p1reader.yaml

// Change auto meter_sensor = new P1Reader(id(uart_bus)); // To auto meter_sensor = new P1ReaderHDLC(id(uart_bus));"

Seems HDLC support was added 6 months ago, perhaps it's possible to borrow code from that project?

vBrolin avatar Oct 19 '23 11:10 vBrolin

Yes, that was the kind of example I was looking for! Unfortunately your data is not even close to this. The length of the message is different and more importantly, your data has a lot of "weird" patterns (b8b8b8b8, etc) that do not exist in the real message. My feeling is that the port is not outputting serial data (at the correct bit rate). The only thing I can think of now is to measure the signal with an oscilloscope to see what is actually being sent...

I believe the HDLC is equivalent to the support in this project. It just isn't autodetected, so you need to make some manual changes for it to be used. That said, it wouldn't hurt to try running that project with your reader and see what happens. You never know what you might learn!

Beaky2000 avatar Oct 19 '23 13:10 Beaky2000

This reader is 3 hours away from home in a cabin, so it's a bad project for testing. I might just buy something off the shelf, or just skip measuring in this case.

vBrolin avatar Oct 19 '23 13:10 vBrolin

Back at the cabin where the reader is. Talked to the power company, and they claim the reader is an upgraded Aidon running the newest software, configured to use: EFS2: Branschrekommendation för lokalt kundgränssnitt för elmätare v. 2.0

Tried configuring the reader again, but it still wont work. Discarding messages, and then it resets.

23:24:59 [W] [p1reader:229] Discarding: deb0beecfcec0cb8cfb8b8bc6e6edbb8b8ec3cb86ebcb8bcb8b8b8dfbebcbfbe 23:24:59 [W] [p1reader:229] Discarding: b8fcec3cb8bcb8bcb8b8b8b8b8b8b8b8b8b8b8fcec3cb8bcb8bcb8b8b8b8b8b8 23:24:59 [W] [p1reader:229] Discarding: be78feee3eb8bfbcb8beb8b8b8bcbcbcbcb87cfeee3cbc6eb8beb8bcb8b8bcec 23:24:59 [W] [p1reader:229] Discarding: 3cb8bcfeb8fcb8fcc3c3c37f3cfffcfffbc3e3fcfcfcb8bfb8b8fcfcfe3eb8f3 23:24:59 [W] [p1reader:229] Discarding: fffbb8bcb8b8b8b8bfbcbb78ff7f3eb8bb6ebfb8bcb8b8b8b8bfbeb8ec3cb8b7 23:24:59 [W] [p1reader:229] Discarding: bfbfb8bcb8b8b8b8b8b8b8bfefec3cb8be6eb8bcb8b8b8b86eec3cb8beb8bcb8 23:24:59 [W] [p1reader:229] Discarding: b8b8b8b8b8b8bfec3cb8bf6ebfb8bcb8b8b8b8bfb8ee3cb8fcfeb8fcb8b8b8b8 23:24:59 [W] [p1reader:229] Discarding: b8ec3cbcb8beb8fcbcbcbcbcbc78ec3cbcbfbcbeb8bcbcb8befb7cee3cb8beb8 23:24:59 [W] [p1reader:229] Discarding: bcb8b8b8b8b8b8b878ec3cb8bebeb8bcb8b8b8b8bbbc78ec3eb8fbfbc3e3b8b8 23:24:59 [W] [p1reader:229] Discarding: b8b8bfb8b8b878efee3eb8beb8bcb8b8b8b8b86e787f3eb8b8bcf3b8fe3eb8ff 23:24:59 [W] [p1reader:229] Discarding: dbbcbebf6fec3eb8bcbcbf6eee3cb87fb8beb8b87ff8ec3cb86ebcbcb8b86ebc 23:28:40 [W] [p1reader:229] Discarding: fcfffcfebefcfffcfefcfcfcfcfe3efc7cfffefe 23:28:40 [D] [switch:012] 'p1_cts' Turning ON. 23:28:40 [D] [switch:055] 'p1_cts': Sending state ON 23:28:40 [D] [switch:012] 'status_led' Turning ON. 23:28:40 [D] [switch:055] 'status_led': Sending state ON 23:28:44 [D] [sensor:093] 'p1mini WiFi Signal': Sending state -76.00000 dBm with 0 decimals of accuracy 23:28:49 [W] [p1reader:265] Unknown data format (0x7C). Resetting.

Aidon seems to claim they follow the standard. https://aidon.com/wp-content/uploads/2023/06/AIDONFD_RJ12_HAN_Interface_SV.pdf Not really sure what's up here...

vBrolin avatar Dec 16 '23 22:12 vBrolin

At this point I would want to verify that the meter is actually outputting correct data (since my theory is that is is not). One way would be to hook up a computer via an appropriate UART board and capture the output. Even better would be to measure it using an oscilloscope. But I realize that both these approaches require quite a lot of work and may not be worth the effort.

If the meter is not outputting correct data, the next step would be to convince the company that they need to fix it.

If it is outputting correct data, the oscilloscope is probably needed in order to figure out why it is not read correctly.

Beaky2000 avatar Dec 17 '23 19:12 Beaky2000

I just remembered something that could possibly be relevant.

When I was trying to get a D1mini to communicate with the module in an Ikea Vindriktning over the UART, I could not get it to work. The baud rate was much lower, so I could use soft serial on other pins, but the hardware UART would not work.

I eventually figured out that since the UART is connected to the USB communication chip (via two resistors) and even though the USB chip was not active, that caused enough interference to disrupt the serial communication. By removing the resistors (which disables USB completely) I was able to get it to work.

This could be similar to what is happening in your case. The signal from the meter could be correct, but not "strong" enough to share the connection with the USB chip.

Beaky2000 avatar Dec 17 '23 19:12 Beaky2000

I think I'll go the simple route and just buy a HomeWizard P1 reader and see if that works.

sön 17 dec. 2023 kl. 20:25 skrev Johnny Johansson @.***

:

At this point I would want to verify that the meter is actually outputting correct data (since my theory is that is is not). One way would be to hook up a computer via an appropriate UART board and capture the output. Even better would be to measure it using an oscilloscope. But I realize that both these approaches require quite a lot of work and may not be worth the effort.

If the meter is not outputting correct data, the next step would be to convince the company that they need to fix it.

If it is outputting correct data, the oscilloscope is probably needed in order to figure out why it is not read correctly.

— Reply to this email directly, view it on GitHub https://github.com/Beaky2000/esphome-p1mini/issues/15#issuecomment-1859257777, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCISI7SNR36JHRHRIUDDY3YJ5BJXAVCNFSM6AAAAAA5VZM3ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGI2TONZXG4 . You are receiving this because you authored the thread.Message ID: @.***>

vBrolin avatar Dec 17 '23 19:12 vBrolin

Interesting, could try having a look at this to see if your guess is right.

sön 17 dec. 2023 kl. 20:36 skrev Johnny Johansson @.***

:

I just remembered something that could possibly be relevant.

When I was trying to get a D1mini to communicate with the module in an Ikea Vindriktning over the UART, I could not get it to work. The baud rate was much lower, so I could use soft serial on other pins, but the hardware UART would not work.

I eventually figured out that since the UART is connected to the USB communication chip (via two resistors) and even though the USB chip was not active, that caused enough interference to disrupt the serial communication. By removing the resistors (which disables USB completely) I was able to get it to work.

This could be similar to what is happening in your case. The signal from the meter could be correct, but not "strong" enough to share the connection with the USB chip.

— Reply to this email directly, view it on GitHub https://github.com/Beaky2000/esphome-p1mini/issues/15#issuecomment-1859260346, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCISI7SW6RS36WNEVTCEBLYJ5CTZAVCNFSM6AAAAAA5VZM3ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGI3DAMZUGY . You are receiving this because you authored the thread.Message ID: @.***>

vBrolin avatar Dec 17 '23 19:12 vBrolin

I have the same issue with a Aidon 6534, I may be able to connect a RS232 reader. How should I connect it

  • signal GND, Tx and RTS ?
  • which communication parameters to use?

=== My log == INFO ESPHome 2023.11.6 INFO Reading configuration /config/esphome/han-a.yaml... INFO Starting log output from han-a.local using esphome API INFO Successfully connected to han-a in 0.514s INFO Successful handshake with han-a in 2.457s [19:57:43][I][app:102]: ESPHome version 2023.11.6 compiled on Dec 29 2023, 19:20:22 [19:57:49][W][p1reader:265]: Unknown data format (0x0F). Resetting. [19:57:49][W][p1reader:229]: Discarding: e6ef6ffbffdff37f8fec0cffc3fbcffbc3fbc3e3dbdfcfdbdbefcfefffffffc3

kattenekis avatar Dec 29 '23 19:12 kattenekis

I had this problem (unknown data format, discarding...) when my RJ12 cable was too long. Works fine with 15 cm, but 2-3 meters didn't work.

lijon avatar Dec 29 '23 20:12 lijon

I have the same issue with a Aidon 6534, I may be able to connect a RS232 reader. How should I connect it

  • signal GND, Tx and RTS ?
  • which communication parameters to use?

There are two different things that would be interesting to test. One is to connect only the separate reader and see if you get "better" data in that case. The other one is to connect both the reader and the p1mini at the same time and see what you get.

Easiest is probably connecting both, but if the problem is with the cable length or with the load on the connection, this is only going to make it worse... Also, I am not sure the internal pullup in the ESP will affect the external pin, but I am guessing that it will, which is required for this to work.

For this case, you would leave the p1mini connected and also connect the TX on the meter to RX on your reader (in addition to RX on the p1mini). Ground to ground everywhere, and that is it. See if the data you receive on your reader is correct.

Slightly more complicated is connecting your reader directly to the meter without the p1mini. Ground to ground as usual, but you probably need an external pullup resistor between 3.3V and RX on your reader. TX on the meter to RX on your reader. Also connect RTS on the meter to 5V (or 3.3V) to enable data. Again, see if you receive a correct data package on your reader.

Use 115200 baud and 8 bits, no parity and 1 stop bit.

Beaky2000 avatar Dec 29 '23 20:12 Beaky2000

I have the same module as vBrolin, just as an FYI it works for me. Used latest Esphome, latest code from here and about 15cm cable. If there's anything I can do to help troubleshoot for you other guys let me know.

darexa avatar Mar 05 '24 20:03 darexa

I experience the same issue with my Aidon 6534 (2023) with module Aidon 6442S. Sent email to grid owner asking which EFS version it is configured with.

Have anyone else made any progress on this issue?

[22:08:09][I][app:100]: ESPHome version 2024.7.3 compiled on Aug 3 2024, 13:14:20 [22:08:09][C][logger:185]: Logger: [22:08:09][C][logger:186]: Level: DEBUG [22:08:09][C][logger:188]: Log Baud Rate: 0 [22:08:09][C][logger:189]: Hardware UART: UART0 [22:08:09][C][uart.arduino_esp8266:118]: UART Bus: [22:08:09][C][uart.arduino_esp8266:119]: TX Pin: GPIO1 [22:08:09][C][uart.arduino_esp8266:120]: RX Pin: GPIO3 [22:08:09][C][uart.arduino_esp8266:122]: RX Buffer Size: 512 [22:08:09][C][uart.arduino_esp8266:124]: Baud Rate: 115200 baud [22:08:09][C][uart.arduino_esp8266:125]: Data Bits: 8 [22:08:09][C][uart.arduino_esp8266:126]: Parity: NONE [22:08:09][C][uart.arduino_esp8266:127]: Stop bits: 1 [22:08:09][C][uart.arduino_esp8266:129]: Using hardware serial interface. [22:08:09][C][switch.gpio:068]: GPIO Switch 'p1_rts' [22:08:09][C][switch.gpio:090]: Restore Mode: always OFF [22:08:09][C][switch.gpio:031]: Pin: GPIO4 [22:08:09][C][switch.gpio:068]: GPIO Switch 'status_led' [22:08:09][C][switch.gpio:090]: Restore Mode: always OFF [22:08:09][C][switch.gpio:031]: Pin: GPIO2 [22:08:09][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'secondary_p1_rts' [22:08:09][C][gpio.binary_sensor:016]: Pin: GPIO16 [22:08:09][C][P1Mini:456]: P1 Mini component [22:08:09][C][captive_portal:088]: Captive Portal: [22:08:09][C][web_server:173]: Web Server: [22:08:09][C][web_server:174]: Address: p1mini.local:80 [22:08:09][C][mdns:116]: mDNS: [22:08:09][C][mdns:117]: Hostname: p1mini [22:08:09][C][esphome.ota:073]: Over-The-Air updates: [22:08:09][C][esphome.ota:074]: Address: p1mini.local:8266 [22:08:09][C][esphome.ota:075]: Version: 2 [22:08:09][C][esphome.ota:078]: Password configured [22:08:09][C][safe_mode:018]: Safe Mode: [22:08:09][C][safe_mode:019]: Boot considered successful after 60 seconds [22:08:09][C][safe_mode:021]: Invoke after 10 boot attempts [22:08:09][C][safe_mode:022]: Remain in safe mode for 300 seconds [22:08:09][C][api:139]: API Server: [22:08:09][C][api:140]: Address: p1mini.local:6053 [22:08:09][C][api:142]: Using noise encryption: YES [22:08:09][C][wifi_signal.sensor:009]: WiFi Signal 'p1mini WiFi Signal' [22:08:09][C][wifi_signal.sensor:009]: Device Class: 'signal_strength' [22:08:09][C][wifi_signal.sensor:009]: State Class: 'measurement' [22:08:09][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm' [22:08:09][C][wifi_signal.sensor:009]: Accuracy Decimals: 0 [22:08:10][W][P1Mini:139]: Unknown data format (0x0F). Resetting. [22:08:10][D][switch:016]: 'p1_rts' Turning OFF. [22:08:10][D][switch:055]: 'p1_rts': Sending state OFF [22:08:10][D][switch:016]: 'status_led' Turning OFF. [22:08:10][D][switch:055]: 'status_led': Sending state OFF [22:08:10][W][P1Mini:448]: Discarding: e6ef6ffbffdff37f8fec0cffc3fbcffbc3fbc3e3dbf3c3e3c3dfdbcfc3e3cfc3 [22:08:10][W][P1Mini:448]: Discarding: ffefec3cffc3fbcffbe3fbc3e3c3c3c3c3c3f3dbfbfbcfe3dffbfffcefec3cff [22:08:10][W][P1Mini:448]: Discarding: c3fbdbfbe3fbc3e3c3c3c3c3c3c3c3c3fbc3c3c3fbfffcefec3cffc3fbdffbe3 [22:08:10][W][P1Mini:448]: Discarding: fbc3e3c3c3c3c3c3c3c3c3fbcfdfcffbffff783fefec3cffc3fbf3fbe3fbc3e3 [22:08:10][W][P1Mini:448]: Discarding: c3c3c3c3c3cffbe3fbe3dffffbffff783fefec3cffc3fbcffbfffbc3e3c3c3c3 [22:08:10][W][P1Mini:448]: Discarding: b8bfee6ffbffefec3cffc3fbdbfbfffbc3e3c3c3c3c3fbc3c3c3fbffefec3cff [22:08:10][W][P1Mini:448]: Discarding: c3fbdffbfffbc3e3c3c3c3c3fbc3c3c3fbffff78ff7f8feec3fbf3fbfffbc3e3 [22:08:10][W][P1Mini:448]: Discarding: c3c3c3c3fbdffffffbffff78ff7f8feec3fbdbcffbfffbc3e3c3c3c3c3fbc3fb [22:08:10][W][P1Mini:448]: Discarding: effbffefec3cffc3fbdbdbfbfffbc3e3c3c3c3c3fbc3c3c3fbffefec3cffc3fb [22:08:10][W][P1Mini:448]: Discarding: f3cffbfffbc3e3c3c3c3c3fbc3e3f3fbffefec3cffc3fbf3dbfbfffbc3e3c3c3 [22:08:10][W][P1Mini:448]: Discarding: c3c3fbc3c3c3fbffefec3cffc3fbfbcffbfffbc3e3c3c3c3c3fbc3dfeffbffef [22:08:10][W][P1Mini:448]: Discarding: ec3cffc3fbfbdbfbfffbc3e3c3c3c3c3fbc3c3c3fbffefec3cffc3fbdbdffbff [22:08:10][W][P1Mini:448]: Discarding: fbc3e3c3c3c3c3fbc3c3c3fbffff78ff7f8feec3fbdbf3fbfffbc3e3c3c3c3c3 [22:08:10][W][P1Mini:448]: Discarding: fbcfcfdffbffff78ff7f8feec3fbf3dffbfffbc3e3c3c3c3c3fbc3c3c3fbffff [22:08:10][W][P1Mini:448]: Discarding: 78ff7f3cffc3fbf3f3fbfffbc3e3c3c3c3c3fbcfdbdbfbffff78ff7f8feec3fb [22:08:10][W][P1Mini:448]: Discarding: fbdffbfffbc3e3c3c3c3c3fbc3c3c3fbffff78ff7f8feec3fbfbf3fbfffbc3e3 [22:08:10][W][P1Mini:448]: Discarding: c3c3c3c3fbcfdbc3fbffff78ff7f8feec3fbdfdbfbfffbc3e3dbdff3fbc3fbfb [22:08:10][W][P1Mini:448]: Discarding: efec3cffc3fbffdbfbfffbc3e3dbdff3fbdffbfbefec3cffc3fbffdbfbfffbc3 [22:08:10][W][P1Mini:448]: Discarding: e3dbdff3fbcffbfbefec3cffc3fbdfcffbfffbc3e3c3c3c3fbfffb0fefec3cff [22:08:10][W][P1Mini:448]: Discarding: c3fbffcffbfffbc3e3c3c3c3fbfbfb0fefec3cffc3fbffcffbfffbc3e3c3c3c3 [22:08:10][W][P1Mini:448]: Discarding: fbfffb0fefec3c1fb8befcecfcfbfb0fefec3cffc3fbffcffbfffbc3e3c3c3c3

rallanand avatar Aug 04 '24 19:08 rallanand

The grid owner said the system was configured for EFS2.

rallanand avatar Sep 02 '24 18:09 rallanand