-
-
Notifications
You must be signed in to change notification settings - Fork 32
SMA.ino with a SMA inverter - getting error e4 for each register read #10
Comments
I'm sure I have had this error. Could you capture the rest of the dump? (and do a stack trace decode?) The crash is probably related to an invalid pointer. Do the errors come immediately or only after some time (seconds). Unfortunately, I don't have any modbus devices anymore so I cannot test. (unless I setup a simulator but it seems like a chore and I'm postponing it untill eternity, sorry) |
Hi Bert, thanks for the quick feedback! Here is the complete stack dump: _Connecting to WiFi... Backtrace: 0x4013b7ab:0x3ffcff00 0x400d2c81:0x3ffcff20 0x4013b8c5:0x3ffcff60 0x400d3469:0x3ffcff80 0x400d34c1:0x3ffcffc0 0x400d391e:0x3ffcffe0 0x400883d1:0x3ffd0010 Rebooting... rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)_ I'm having trouble to getting the stack decoder tool to work. The errors happens after each of the 6 register reading (as per trace). It's an immediate problem. I tried connecting to the Inverter with PC or android-based client as a control test, it works. If you have any idea of what causes error "4", let me know. I would have thought it might be a modbus-TCP protocol variant issue, but since your code was written and tested on the same SMA inverter family, I doubt this is it. Thanks. |
Is there an update to the problem? I am receiving the same error :-( |
Try to reboot the sunny boy o reboot the TCP and UDP modbus on configuration sunny boy. |
I'm sorry to have you guys waiting. But now I'm stuck at home I'll try to find some time to look into this entire lib (in between supporting home school). |
Having the same error, I decoded the stacktrace from above as PC: 0x4013b7ab: esp_ota_get_running_partition at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/app_update/esp_ota_ops.c line 510 Decoding stack results |
Could you try again with the v1 branch? |
Wow, thank you for looking into this that quickly :-) With v1 branch the crashes have gone for me. It does read some values now, so it is working in principle! Connecting to WiFi... |
Maybe it's some timing issue. I modified the registers to only three entries. I am always getting 2 values. For me, that's OK (because the 3rd could be calculated). _reading registers: requested currentpower, requested currentdc2power, requested currentdc1power, reading registers: requested currentpower, requested currentdc2power, requested currentdc1power, reading registers: requested currentpower, requested currentdc2power, requested currentdc1power, reading registers: requested currentpower, requested currentdc2power, requested currentdc1power, reading registers: requested currentpower, requested currentdc2power, requested currentdc1power, |
The v1 version sends all requests without waiting for the previous to complete. It could be the SMA is not capable of handling all the requests. I (temporarily) moved so I cannot test myself anymore. A workaround could be to only send your next request when the previous completes. Do this by raising a flag and request outside of the callback. (my computer is occupied by home schooling kids, I can't check code for race issues or deadlocks) |
Hey Bert,
First, thank you so much for this project! This is exactly what I was trying to achieve. I'm running exactly this same setup as you ESP32 board + SMA inverter on a LAN.
I have succes to access the registers of the SunnyBoy SMA inverter manually from a PC-based modbus client on the same LAN, but I systematically get errors while using SMA.ino.
Connecting to WiFi...
WiFi connected. IP: 192.168.10.151
reading registers
Error packet 1: e4
Error packet 2: e4
Error packet 3: e4
Error packet 4: e4
Error packet 5: e0
Error packet 6: e0
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4013b7ab PS : 0x00060f30 A0 : 0x800d2c84 A1 : 0x3ffcf5d0
A2 : 0x3ffcf5f8 A3 : 0x0000000c A4 : 0x0000000c A5 : 0x00000000
I tries to change and explore a few different register addresses with the same result. But they all work ok with a PC-client.
Have you ever experienced this?
Thanks Again,
Pascal
The text was updated successfully, but these errors were encountered: