GammaTroniques / TICMeter

TICMeter is a small product to collect data from a Linky meter and send them to a home automation server via MQTT, Zigbee or HTTP
Other
39 stars 6 forks source link

Crash when trying to setup MQTT config #27

Closed ludrao closed 4 months ago

ludrao commented 4 months ago

The problem encountered

I logged on the captive portal to configure the TICmeter in MQTT mode. Note I am using mosquitto in standalone (seperated from home assistant)

Firmware version

V3.2.9

Steps for reproducing the error

No response

What I've already tested

No response

Relevant log output

I (109389) HTTP: URL: /config, len: 326
I (109389) HTTP: Received data: {"server-mode":"3","wifi-ssid":"Constantinople","wifi-password":"XXX","web-url":"","web-post":"","web-config":"","web-token":"","mqtt-host":"193.168.0.13","mqtt-port":"1883","mqtt-user":"ticmeter"I (109442) HTTP: SSID: Constantinople
I (109442) HTTP: Password: myWLdoPb6oBFQep6Mjpk3Sta
I (109443) HTTP: Server mode: 3
I (109459) Config: Config written 699 bytes
I (110526) WIFI: Connecting to Constantinople
I (111163) WIFI: GOT EVENT: event_base: WIFI_EVENT, event_id: 4
I (111163) WIFI: Connected
I (114162) WIFI: GOT EVENT: event_base: IP_EVENT, event_id: 0
I (114163) WIFI: IP:192.168.0.127
I (114263) WIFI: Connected to ap SSID:Constantinople
I (114263) HTTP: TEST WIFI_CONNECT: 0
I (114368) WIFI: Start ping to 192.168.0.254
I (114376) WIFI: Ping success: time=5ms
I (115372) WIFI: Ping success: time=2ms
I (116373) WIFI: Ping success: time=4ms
I (117372) WIFI: Ping success: time=3ms
I (118372) WIFI: Ping success: time=2ms
I (119369) WIFI: Ping statistics: 5 packets transmitted, 5 received
I (119369) WIFI: Ping success
I (119656) MQTT: init done
E (129661) esp-tls: [sock=60] select() timeout
E (129662) transport_base: Failed to open a new connection: 32774
E (129662) mqtt_client: Error transport connect
I (129663) MQTT: MQTT_EVENT_ERROR type=1, code=0, msgid=0
E (129663) MQTT: Last error reported from esp-tls: 0x8006
I (129664) MQTT: Last errno string (Success)
E (129664) HTTP: MQTT error: type: 1, return_code: 0
I (129665) MQTT: Deinit MQTT
W (129667) httpd_uri: httpd_uri: uri handler execution failed
I (131725) MQTT: init done
E (131726) HTTP: MQTT error: type: 1, return_code: 0
I (131726) MQTT: Deinit MQTT
W (131729) httpd_uri: httpd_uri: uri handler execution failed
Guru Meditation Error: Core  0 panic'ed (Load access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x40810236  RA      : 0x40810236  SP      : 0x4086f060  GP      : 0x4081e4e4  
TP      : 0x408261fc  T0      : 0x00000000  T1      : 0x00000000  T2      : 0x00000000  
S0/FP   : 0x00000001  S1      : 0x0a0d0000  A0      : 0x00000001  A1      : 0x00000001  
A2      : 0x00000000  A3      : 0x00000004  A4      : 0x00000001  A5      : 0x40839000  
A6      : 0x00000000  A7      : 0x00000000  S2      : 0x00000000  S3      : 0x00000000  
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x00000000  T4      : 0x00000000  T5      : 0x00000000  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000005  MTVAL   : 0x0a0d0000  
MHARTID : 0x00000000  

Stack memory:
4086f060: 0x4202b660 0x00000000 0x00000000 0x4081e4e4 0x408261fc 0x00000000 0x40847254 0x4202b6a0
4086f080: 0x00000000 0x00000000 0x40847254 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4086f0a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4086f0c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4086f0e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4086f100: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x0000d4fd 0x4083a5e4 0x4083a5e4 0x4086f14c 0x00000001
4086f120: 0x4086f1a0 0x007e0022 0x40010000 0x00000049 0x007e0000 0x00012049 0x00000000 0x40846bd4
4086f140: 0x00000000 0x4086f158 0x00000000 0xe02900ac 0x4086f1ac 0x00000000 0x004c3008 0x00000020
4086f160: 0x00000000 0x0000e517 0x01980000 0x00001000 0x01625995 0x40820108 0x00010001 0x00000000
4086f180: 0x00010000 0x1c010000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4086f1a0: 0x00000000 0x00000000 0x00000000 0x4086e364 0x0000073b 0x00000000 0x4086f1f0 0x4086f1f0
4086f1c0: 0x00000001 0x4086f244 0x0036001a 0x00070000 0x00000000 0x00000000 0x00000000 0x00000000
4086f1e0: 0x40846bd4 0x00000000 0x4086f1fc 0x00000000 0x002a06a4 0x4086f244 0x00000000 0x00000110
4086f200: 0x016261bb 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4086f220: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4086f240: 0x00000000 0x201b6be2 0x8e00a607 0x1e000000 0x016261bb 0x3ef7fdef 0x1dd1d19e 0x00000000
4086f260: 0x00000000 0x75500000 0x02000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4086f280: 0x00000000 0x00000000 0x00000000 0x00000200 0x016261f7 0x016261f7 0x0052004e 0x00000000
4086f2a0: 0x00300188 0x54ca4c40 0xdd962155 0xd826ef27 0x54ca4c40 0x54ca4c40 0xdd962155 0xd826ef27
4086f2c0: 0x00450008 0xd9432800 0x06400040 0x0304eeea 0x03040202 0xda2c0102 0x938e0050 0x948d5aad
4086f2e0: 0x1050ab35 0x509bffff 0x00000000 0x4c40d826 0x215554ca 0x54ca4c40 0x04202155 0xaaaa0000
4086f300: 0x00000003 0x00450008 0x43006a05 0x06400000 0x03044369 0x03040102 0x50000202 0x35ab2cda
4086f320: 0xad5a3b73 0x10508e93 0x858ba412 0x6f6d0000 0x635f6564 0x61746e6f 0x72656e69 0x656c2e73
4086f340: 0x6874676e 0x2b2b693b 0x696c7b29 0x5f796b6e 0x5f636974 0x65646f6d 0x6e6f635f 0x6e696174
4086f360: 0x5b737265 0x632e5d69 0x7373616c 0x7473694c 0x6464612e 0x69642228 0x6c626173 0x29226465
4086f380: 0x657d7d3b 0x2065736c 0x6d286669 0x3d65646f 0x7b29333d 0x28726f66 0x2074656c 0x3b303d69
4086f3a0: 0x696c3c69 0x5f796b6e 0x5f636974 0x65646f6d 0x6c61765f 0x2e736575 0x676e656c 0x693b6874
4086f3c0: 0x7b292b2b 0x6c286669 0x796b6e69 0x6369745f 0x646f6d5f 0x61765f65 0x7365756c 0x2e5d695b
4086f3e0: 0x756c6176 0x303d3d65 0x696c7b29 0x5f796b6e 0x5f636974 0x65646f6d 0x6c61765f 0x5b736575
4086f400: 0x632e5d69 0x6b636568 0x743d6465 0x3b657572 0x660a7d7d 0x6c28726f 0x69207465 0x693b303d
4086f420: 0x6e696c3c 0x4086f24c 0x0000073b 0x00000000 0x4086f468 0x4086f468 0x00000001 0x4086f4bc
4086f440: 0x0036001a 0x00070000 0x00000000 0x00000000 0x00000000 0x00000000 0x40846bd4 0x00000000

ELF file SHA256: 845fd65af16d7b54

Rebooting in  2 seconds...
Rebooting...
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0x6f (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x17d8
load:0x4086c410,len:0xe20
load:0x4086e610,len:0x3428
entry 0x4086c41a
I (22) boot: ESP-IDF v5.2.1 2nd stage bootloader
I (22) boot: compile time Jun  9 2024 11:19:00
I (24) boot: chip revision: v0.0
I (25) boot.esp32c6: SPI Speed      : 80MHz
I (30) boot.esp32c6: SPI Mode       : DIO
I (34) boot.esp32c6: SPI Flash Size : 4MB
I (39) boot: Enabling RNG early entropy source...
I (45) boot: Partition Table:
I (48) boot: ## Label            Usage          Type ST Offset   Length
I (55) boot:  0 ro_nvs           WiFi data        01 02 00009000 00002000
I (63) boot:  1 nvs              WiFi data        01 02 0000b000 00004000
I (70) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (78) boot:  3 otadata          OTA data         01 00 00010000 00002000
I (85) boot:  4 zb_storage       Unknown data     01 81 00012000 00004000
I (93) boot:  5 zb_fct           Unknown data     01 81 00016000 00000400
I (100) boot:  6 storage          Unknown data     01 82 00017000 00010000
I (108) boot:  7 nvs_key          NVS keys         01 04 00027000 00001000
I (115) boot:  8 ota_0            OTA app          00 10 00030000 001db000
I (123) boot:  9 ota_1            OTA app          00 11 00210000 001db000
I (130) boot: End of partition table
I (135) esp_image: segment 0: paddr=00030020 vaddr=42150020 size=49a20h (301600) map
I (247) esp_image: segment 1: paddr=00079a48 vaddr=40800000 size=065d0h ( 26064) load
I (259) esp_image: segment 2: paddr=00080020 vaddr=42000020 size=14f49ch (1373340) map
I (733) esp_image: segment 3: paddr=001cf4c4 vaddr=408065d0 size=1ba50h (113232) load
I (777) esp_image: segment 4: paddr=001eaf1c vaddr=50000000 size=00048h (    72) load
I (791) boot: Loaded app from partition at offset 0x30000
I (792) boot: Disabling RNG early entropy source...
I (794) cpu_start: Unicore app
W (804) clk: esp_perip_clk_init() has not been implemented yet
I (805) cpu_start: Pro cpu start user code
I (806) cpu_start: cpu freq: 80000000 Hz
I (811) cpu_start: Application information:
I (816) cpu_start: Project name:     TICMeter
I (821) cpu_start: App version:      V3.2.9
I (825) cpu_start: Compile time:     Jul  2 2024 21:01:58
I (832) cpu_start: ELF file SHA256:  845fd65af16d7b54...
I (838) cpu_start: ESP-IDF:          v5.2.1
I (842) cpu_start: Min chip rev:     v0.0
I (847) cpu_start: Max chip rev:     v0.99 
I (852) cpu_start: Chip rev:         v0.0
I (857) heap_init: Initializing. RAM available for dynamic allocation:
I (864) heap_init: At 4083A5D0 len 00042040 (264 KiB): RAM
I (870) heap_init: At 4087C610 len 00002F54 (11 KiB): RAM
I (876) heap_init: At 50000048 len 00003FA0 (15 KiB): RTCRAM
I (883) spi_flash: detected chip: generic
I (887) spi_flash: flash io: dio
ludrao commented 4 months ago

Ok my bad I had a typo in the IP address of the MQTT server. It works better when the IP is correct. I suppose TICmeter should not crash when there is a miss config, but that is secondary priority I guess. You can close the issue if you prefer, no prb with me :)

xmow49 commented 4 months ago

ah, yes itsn't normal... What was the IP mistake ? Thanks

ludrao commented 4 months ago

I had configured 193.168.0.13 instead of 192.168.0.13, so it was not able to reach the mqtt server (and then crashed as we can see in the logs above)

xmow49 commented 4 months ago

Fixed in V3.2.10