Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device does not re-appear in Home Assisant after reconnect on reboot of HA+MQTT-server #2190

Closed
FastFrank opened this issue Mar 15, 2023 · 13 comments

Comments

@FastFrank
Copy link

The Problem

Since i upgraded to Development-Branch: fix-timezone-config-parser (Commit: d9cb0e1+) my devices do reconnect and report to Home-Assistant but it does not show. After the HA-server and MQTT have restarted (they do it every night in my case). Before i used version v15.0.3 (Commit: f42e9c7+) and with that version it works fine.
It looks like there is a slight difference in the MQTT reconnect procedure...

Version

Development-Branch: fix-timezone-config-parser (Commit: d9cb0e1+)

Logfile

Will be supplied if neccesary

Expected Behavior

No response

Screenshots

No response

Additional Context

No response

@FastFrank FastFrank added the bug Something isn't working label Mar 15, 2023
@caco3
Copy link
Collaborator

caco3 commented Mar 15, 2023

Please provide the debug log file.

Also Screenshot of the HA MQTT device.

Also you should check using another MQTT client if the topics get sent. I usually use http://mqtt-explorer.com/

@FastFrank
Copy link
Author

FastFrank commented Mar 15, 2023

Debug log v15.0.3: ( i removed soms [CNN] lines)
[0d00h01m33s] 2023-03-15T08:09:23 <DBG> [MQTT IF] Published topic: AHstroom/status, content: Flow finished (msg_id=46)
[0d00h01m34s] 2023-03-15T08:09:23 <DBG> [TFLITE SERVER] CPU Temperature: 53°C
[0d00h01m34s] 2023-03-15T08:09:23 <DBG> [TFLITE SERVER] WIFI Signal (RSSI): -37dBm
[0d00h01m34s] 2023-03-15T08:09:23 <INF> [TFLITE SERVER] Round #1 completed (70 seconds)
[0d00h04m24s] 2023-03-15T08:12:13 <DBG> [MQTT IF] Disconnected from broker
[0d00h04m39s] 2023-03-15T08:12:28 <DBG> [MQTT IF] Disconnected from broker
[0d00h04m54s] 2023-03-15T08:12:43 <DBG> [MQTT IF] Disconnected from broker
[0d00h05m09s] 2023-03-15T08:12:58 <DBG> [MQTT IF] Disconnected from broker
[0d00h05m24s] 2023-03-15T08:13:13 <DBG> [MQTT IF] Disconnected from broker
[0d00h05m24s] 2023-03-15T08:13:13 <DBG> [TFLITE SERVER] ----------------------------------------------------------------
[0d00h05m24s] 2023-03-15T08:13:13 <INF> [TFLITE SERVER] Round #2 started
[0d00h05m24s] 2023-03-15T08:13:13 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h05m31s] 2023-03-15T08:13:20 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h05m39s] 2023-03-15T08:13:28 <DBG> [MQTT IF] Disconnected from broker
[0d00h05m40s] 2023-03-15T08:13:29 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h05m40s] 2023-03-15T08:13:29 <DBG> [CNN] doFlow after alignment
[0d00h05m54s] 2023-03-15T08:13:43 <DBG> [MQTT IF] Disconnected from broker
[0d00h06m21s] 2023-03-15T08:14:11 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[CNN] ...
[0d00h06m22s] 2023-03-15T08:14:11 <INF> [POSTPROC] main: Raw: 158400.9, Value: 158400.9, Status: no error
[0d00h06m22s] 2023-03-15T08:14:11 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h06m22s] 2023-03-15T08:14:11 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h06m22s] 2023-03-15T08:14:11 <INF> [TFLITE SERVER] Round #2 completed (58 seconds)
[0d00h06m27s] 2023-03-15T08:14:16 <DBG> [MQTT IF] Disconnected from broker
[0d00h07m01s] 2023-03-15T08:14:50 <DBG> [MQTT IF] Disconnected from broker
[0d00h07m34s] 2023-03-15T08:15:23 <DBG> [MQTT IF] Disconnected from broker
[0d00h08m08s] 2023-03-15T08:15:57 <DBG> [MQTT IF] Disconnected from broker
[0d00h08m41s] 2023-03-15T08:16:31 <DBG> [MQTT IF] Disconnected from broker
[0d00h09m15s] 2023-03-15T08:17:04 <DBG> [MQTT IF] Disconnected from broker
[0d00h09m48s] 2023-03-15T08:17:38 <DBG> [MQTT IF] Disconnected from broker
[0d00h10m22s] 2023-03-15T08:18:11 <DBG> [MQTT IF] Disconnected from broker
[0d00h10m24s] 2023-03-15T08:18:13 <DBG> [TFLITE SERVER] ----------------------------------------------------------------
[0d00h10m24s] 2023-03-15T08:18:14 <INF> [TFLITE SERVER] Round #3 started
[0d00h10m24s] 2023-03-15T08:18:14 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h10m31s] 2023-03-15T08:18:20 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h10m40s] 2023-03-15T08:18:29 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h10m55s] 2023-03-15T08:18:45 <DBG> [MQTT IF] Disconnected from broker
[0d00h11m10s] 2023-03-15T08:19:00 <DBG> [MQTT IF] Disconnected from broker
[0d00h11m21s] 2023-03-15T08:19:11 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h11m22s] 2023-03-15T08:19:11 <INF> [POSTPROC] main: Raw: 158400.9, Value: 158400.9, Status: no error
[0d00h11m22s] 2023-03-15T08:19:11 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h11m22s] 2023-03-15T08:19:11 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHstroom/status)
[0d00h11m25s] 2023-03-15T08:19:15 <DBG> [MQTT IF] Disconnected from broker
[0d00h11m40s] 2023-03-15T08:19:30 <DBG> [MQTT IF] Disconnected from broker
[0d00h11m55s] 2023-03-15T08:19:45 <DBG> [MQTT IF] Disconnected from broker
[0d00h12m10s] 2023-03-15T08:20:00 <DBG> [MQTT IF] Disconnected from broker
[0d00h12m25s] 2023-03-15T08:20:15 <DBG> [MQTT IF] Disconnected from broker
[0d00h12m41s] 2023-03-15T08:20:30 <DBG> [MQTT IF] Disconnected from broker
[0d00h12m56s] 2023-03-15T08:20:45 <DBG> [MQTT IF] Disconnected from broker
[0d00h13m11s] 2023-03-15T08:21:00 <DBG> [MQTT IF] Disconnected from broker
[0d00h13m26s] 2023-03-15T08:21:15 <DBG> [MQTT IF] Disconnected from broker
[0d00h13m41s] 2023-03-15T08:21:30 <DBG> [MQTT IF] Disconnected from broker
[0d00h13m56s] 2023-03-15T08:21:45 <DBG> [MQTT IF] Disconnected from broker
[0d00h14m11s] 2023-03-15T08:22:00 <DBG> [MQTT IF] Disconnected from broker
[0d00h14m26s] 2023-03-15T08:22:15 <DBG> [MQTT IF] Disconnected from broker
[0d00h14m41s] 2023-03-15T08:22:30 <DBG> [MQTT IF] Disconnected from broker
[0d00h14m56s] 2023-03-15T08:22:45 <DBG> [MQTT IF] Disconnected from broker
[0d00h15m11s] 2023-03-15T08:23:00 <INF> [MQTT IF] Connected to broker
[0d00h15m11s] 2023-03-15T08:23:00 <DBG> [MQTT IF] Published topic: AHstroom/connection, content: connected (msg_id=47)
[0d00h15m11s] 2023-03-15T08:23:00 <DBG> [MQTT IF] topic AHstroom/ctrl/flow_start subscribe successful, msg_id=48
[0d00h15m21s] 2023-03-15T08:23:10 <INF> [MQTT SERVER] MQTT - Sending Homeassistant Discovery Topics (Meter Type: energy, Value Unit: kWh , Rate Unit: kW)...
[0d00h15m21s] 2023-03-15T08:23:10 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/uptime/config, content: {"~": "AHstroom","unique_id": "AHstroom-uptime","object_id": "AHstroom_uptime",".. (msg_id=49)
[0d00h15m21s] 2023-03-15T08:23:10 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/MAC/config, content: {"~": "AHstroom","unique_id": "AHstroom-MAC","object_id": "AHstroom_MAC","name":.. (msg_id=50)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/hostname/config, content: {"~": "AHstroom","unique_id": "AHstroom-hostname","object_id": "AHstroom_hostnam.. (msg_id=51)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/freeMem/config, content: {"~": "AHstroom","unique_id": "AHstroom-freeMem","object_id": "AHstroom_freeMem".. (msg_id=52)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/wifiRSSI/config, content: {"~": "AHstroom","unique_id": "AHstroom-wifiRSSI","object_id": "AHstroom_wifiRSS.. (msg_id=53)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/CPUtemp/config, content: {"~": "AHstroom","unique_id": "AHstroom-CPUtemp","object_id": "AHstroom_CPUtemp".. (msg_id=54)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/interval/config, content: {"~": "AHstroom","unique_id": "AHstroom-interval","object_id": "AHstroom_interva.. (msg_id=55)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/IP/config, content: {"~": "AHstroom","unique_id": "AHstroom-IP","object_id": "AHstroom_IP","name": ".. (msg_id=56)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/status/config, content: {"~": "AHstroom","unique_id": "AHstroom-status","object_id": "AHstroom_status",".. (msg_id=57)
[0d00h15m21s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/value/config, content: {"~": "AHstroom","unique_id": "AHstroom-value","object_id": "AHstroom_value","na.. (msg_id=58)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/raw/config, content: {"~": "AHstroom","unique_id": "AHstroom-raw","object_id": "AHstroom_raw","name":.. (msg_id=59)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/error/config, content: {"~": "AHstroom","unique_id": "AHstroom-error","object_id": "AHstroom_error","na.. (msg_id=60)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/rate_per_time_unit/config, content: {"~": "AHstroom","unique_id": "AHstroom-rate_per_time_unit","object_id": "AHstro.. (msg_id=61)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/rate_per_digitalization_round/config, content: {"~": "AHstroom","unique_id": "AHstroom-rate_per_digitalization_round","object_i.. (msg_id=62)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/timestamp/config, content: {"~": "AHstroom","unique_id": "AHstroom-timestamp","object_id": "AHstroom_timest.. (msg_id=63)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/sensor/AHstroom/json/config, content: {"~": "AHstroom","unique_id": "AHstroom-json","object_id": "AHstroom_json","name.. (msg_id=64)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: homeassistant/binary_sensor/AHstroom/problem/config, content: {"~": "AHstroom","unique_id": "AHstroom-problem","object_id": "AHstroom_problem".. (msg_id=65)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT SERVER] Publishing static MQTT topics...
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/MAC, content: E0:5A:1B:6C:EE:68 (msg_id=66)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/IP, content: 192.168.179.91 (msg_id=67)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/hostname, content: AH_Stroom (msg_id=68)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/interval, content: 5.0 (msg_id=69)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT SERVER] Publishing system MQTT topics...
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/uptime, content: 922 (msg_id=70)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/freeMem, content: 3020118 (msg_id=71)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/wifiRSSI, content: -38 (msg_id=72)
[0d00h15m22s] 2023-03-15T08:23:11 <DBG> [MQTT IF] Published topic: AHstroom/CPUtemp, content: 42 (msg_id=73)
[0d00h15m24s] 2023-03-15T08:23:14 <DBG> [TFLITE SERVER] ----------------------------------------------------------------
[0d00h15m24s] 2023-03-15T08:23:14 <INF> [TFLITE SERVER] Round #4 started

@FastFrank
Copy link
Author

FastFrank commented Mar 15, 2023

Debug log Development-Branch: fix-timezone-config-parser (Commit: d9cb0e1d66af170c1175dd7fdc2531fb2ee71260+):

[0d00h01m51s] 2023-03-15T08:10:21 <INF> [TFLITE SERVER] Round #1 completed (85 seconds)
[0d00h01m51s] 2023-03-15T08:10:21 <DBG> [TFLITE SERVER] CPU Temperature: 53°C
[0d00h01m51s] 2023-03-15T08:10:21 <DBG> [TFLITE SERVER] WIFI Signal (RSSI): -53dBm
[0d00h03m43s] 2023-03-15T08:12:13 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h03m44s] 2023-03-15T08:12:13 <DBG> [OTA FILE] log_get_last_part_handler
[0d00h03m58s] 2023-03-15T08:12:28 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h04m10s] 2023-03-15T08:12:40 <DBG> [OTA FILE] log_get_last_part_handler
[0d00h04m13s] 2023-03-15T08:12:43 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h04m28s] 2023-03-15T08:12:58 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h04m43s] 2023-03-15T08:13:13 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h04m43s] 2023-03-15T08:13:13 <ERR> [MQTT IF] Disconnected, multiple reconnect attempts failed, still retrying...
[0d00h04m58s] 2023-03-15T08:13:28 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h05m13s] 2023-03-15T08:13:43 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h05m26s] 2023-03-15T08:13:56 <DBG> [TFLITE SERVER] ----------------------------------------------------------------
[0d00h05m26s] 2023-03-15T08:13:56 <INF> [TFLITE SERVER] Round #2 started
[0d00h05m26s] 2023-03-15T08:13:56 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h05m33s] 2023-03-15T08:14:03 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h05m47s] 2023-03-15T08:14:16 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h05m58s] 2023-03-15T08:14:28 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h05m58s] 2023-03-15T08:14:28 <DBG> [CNN] doFlow after alignment
[0d00h05m58s] 2023-03-15T08:14:28 <DBG> [TFLITE] CTfLiteClass::LoadModel
[0d00h05m58s] 2023-03-15T08:14:28 <DBG> [TFLITE] CTfLiteClass::ReadFileToModel: /sdcard/config/dig-cont_0600_s3.tflite
[0d00h06m10s] 2023-03-15T08:14:40 <DBG> [TFLITE] CTfLiteClass::MakeAllocate
[0d00h06m10s] 2023-03-15T08:14:40 <DBG> [CNN] Processing Number 'main'
[0d00h06m10s] 2023-03-15T08:14:40 <DBG> [CNN] ROI #0 - TfLite
[0d00h06m10s] 2023-03-15T08:14:40 <DBG> [CNN] CNN Type: DoubleHyprid10
[0d00h06m15s] 2023-03-15T08:14:45 <DBG> [CNN] After Invoke
[0d00h06m15s] 2023-03-15T08:14:45 <DBG> [CNN] _num (p, m): 0 1 9 _val (p, m): 0.990999 0.001240 0.007757 result: 9.992233 _fit: 0.998755
[0d00h06m15s] 2023-03-15T08:14:45 <DBG> [CNN] ROI #1 - TfLite
[0d00h06m15s] 2023-03-15T08:14:45 <DBG> [CNN] CNN Type: DoubleHyprid10
[0d00h06m20s] 2023-03-15T08:14:50 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h06m20s] 2023-03-15T08:14:50 <DBG> [CNN] After Invoke
[0d00h06m20s] 2023-03-15T08:14:50 <DBG> [CNN] _num (p, m): 1 2 0 _val (p, m): 0.934967 0.019202 0.043746 result: 0.955302 _fit: 0.978713
[0d00h06m20s] 2023-03-15T08:14:50 <DBG> [CNN] ROI #2 - TfLite
[0d00h06m20s] 2023-03-15T08:14:50 <DBG> [CNN] CNN Type: DoubleHyprid10
[0d00h06m25s] 2023-03-15T08:14:55 <DBG> [CNN] After Invoke
[0d00h06m26s] 2023-03-15T08:14:55 <DBG> [CNN] _num (p, m): 5 6 4 _val (p, m): 0.999765 0.000231 0.000003 result: 5.000231 _fit: 0.999995
[0d00h06m26s] 2023-03-15T08:14:55 <DBG> [CNN] ROI #3 - TfLite
[0d00h06m26s] 2023-03-15T08:14:55 <DBG> [CNN] CNN Type: DoubleHyprid10
[0d00h06m31s] 2023-03-15T08:15:01 <DBG> [CNN] After Invoke
[0d00h06m31s] 2023-03-15T08:15:01 <DBG> [CNN] _num (p, m): 8 9 7 _val (p, m): 0.886246 0.113450 0.000003 result: 8.113484 _fit: 0.999696
[0d00h06m31s] 2023-03-15T08:15:01 <DBG> [CNN] ROI #4 - TfLite
[0d00h06m31s] 2023-03-15T08:15:01 <DBG> [CNN] CNN Type: DoubleHyprid10
[0d00h06m36s] 2023-03-15T08:15:06 <DBG> [CNN] After Invoke
[0d00h06m36s] 2023-03-15T08:15:06 <DBG> [CNN] _num (p, m): 9 0 8 _val (p, m): 0.998669 0.001302 0.000020 result: 9.001302 _fit: 0.999971
[0d00h06m36s] 2023-03-15T08:15:06 <DBG> [CNN] ROI #5 - TfLite
[0d00h06m36s] 2023-03-15T08:15:06 <DBG> [CNN] CNN Type: DoubleHyprid10
[0d00h06m41s] 2023-03-15T08:15:11 <DBG> [CNN] After Invoke
[0d00h06m41s] 2023-03-15T08:15:11 <DBG> [CNN] _num (p, m): 2 3 1 _val (p, m): 0.966471 0.033445 0.000025 result: 2.033448 _fit: 0.999916
[0d00h06m41s] 2023-03-15T08:15:11 <DBG> [CNN] ROI #6 - TfLite
[0d00h06m41s] 2023-03-15T08:15:11 <DBG> [CNN] CNN Type: DoubleHyprid10
[0d00h06m46s] 2023-03-15T08:15:16 <DBG> [CNN] After Invoke
[0d00h06m46s] 2023-03-15T08:15:16 <DBG> [CNN] _num (p, m): 2 3 1 _val (p, m): 0.639398 0.000003 0.360597 result: 1.639401 _fit: 0.999995
[0d00h06m46s] 2023-03-15T08:15:16 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h06m47s] 2023-03-15T08:15:16 <DBG> [CNN] doFlow after alignment
[0d00h06m47s] 2023-03-15T08:15:16 <DBG> [TFLITE] CTfLiteClass::LoadModel
[0d00h06m47s] 2023-03-15T08:15:16 <DBG> [TFLITE] CTfLiteClass::ReadFileToModel: /sdcard/config/ana-cont_11.3.1_s2.tflite
[0d00h06m48s] 2023-03-15T08:15:18 <DBG> [TFLITE] CTfLiteClass::MakeAllocate
[0d00h06m48s] 2023-03-15T08:15:18 <DBG> [CNN] Processing Number 'main'
[0d00h06m48s] 2023-03-15T08:15:18 <DBG> [CNN] ROI #0 - TfLite
[0d00h06m48s] 2023-03-15T08:15:18 <DBG> [CNN] CNN Type: Analogue
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] After Invoke
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout _analog=0, _extendedResolution=1, prev=-1
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalAnalogNew - No predecessor - Result = 5 number: 5.099059 numeral_preceder = -1 Analog_error = 3
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout _analog=0, _extendedResolution=0, prev=5
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalAnalogToDigitNew - NO digital Uncertainty - Result = 1 number: 1.639401 numeral_preceder = 5.099059
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalHybridNew - Analog predecessor, evaluation over PointerEvalAnalogNew = 1 number: 1.639401 number_of_predecessors = 5.099059 eval_predecessors = 5 Digital_Uncertainty = 0.200000
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout(dig100) prev=1
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalHybridNew - NO analogue predecessor, no change of digits, as pre-decimal point far enough away = 2 number: 2.033448 number_of_predecessors = 1.639401 eval_predecessors = 1 Digital_Uncertainty = 0.200000
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#PointerEvalHybridNew()= 2
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#result= 21
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalHybridNew - NO analogue predecessor, no change of digits, as pre-decimal point far enough away = 9 number: 9.001302 number_of_predecessors = 2.033448 eval_predecessors = 2 Digital_Uncertainty = 0.200000
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#PointerEvalHybridNew()= 9
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#result= 921
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalHybridNew - NO analogue predecessor, no change of digits, as pre-decimal point far enough away = 8 number: 8.113484 number_of_predecessors = 9.001302 eval_predecessors = 9 Digital_Uncertainty = 0.200000
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#PointerEvalHybridNew()= 8
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#result= 8921
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalHybridNew - NO analogue predecessor, no change of digits, as pre-decimal point far enough away = 5 number: 5.000231 number_of_predecessors = 8.113484 eval_predecessors = 8 Digital_Uncertainty = 0.200000
[0d00h06m49s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#PointerEvalHybridNew()= 5
[0d00h06m50s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#result= 58921
[0d00h06m50s] 2023-03-15T08:15:19 <DBG> [CNN] PointerEvalHybridNew - NO analogue predecessor, no change of digits, as pre-decimal point far enough away = 1 number: 0.955302 number_of_predecessors = 5.000231 eval_predecessors = 5 Digital_Uncertainty = 0.200000
[0d00h06m50s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#PointerEvalHybridNew()= 1
[0d00h06m50s] 2023-03-15T08:15:19 <DBG> [CNN] getReadout#result= 158921
[0d00h06m50s] 2023-03-15T08:15:20 <DBG> [CNN] PointerEvalHybridNew - NO analogue predecessor, no change of digits, as pre-decimal point far enough away = 0 number: 9.992233 number_of_predecessors = 0.955302 eval_predecessors = 1 Digital_Uncertainty = 0.200000
[0d00h06m50s] 2023-03-15T08:15:20 <DBG> [CNN] getReadout#PointerEvalHybridNew()= 0
[0d00h06m50s] 2023-03-15T08:15:20 <DBG> [CNN] getReadout#result= 0158921
[0d00h06m50s] 2023-03-15T08:15:20 <INF> [POSTPROC] main: Raw: 01589215.0, Value: 1589215.0, Status: no error
[0d00h06m50s] 2023-03-15T08:15:20 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h06m50s] 2023-03-15T08:15:20 <WRN> [MQTT SERVER] Unable to send System Topics, we are not connected to the MQTT broker!
[0d00h06m50s] 2023-03-15T08:15:20 <WRN> [MQTT] One or more MQTT topics failed to be published!
[0d00h06m50s] 2023-03-15T08:15:20 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h06m50s] 2023-03-15T08:15:20 <INF> [TFLITE SERVER] Round #2 completed (84 seconds)
[0d00h06m50s] 2023-03-15T08:15:20 <DBG> [TFLITE SERVER] CPU Temperature: 53°C
[0d00h06m50s] 2023-03-15T08:15:20 <DBG> [TFLITE SERVER] WIFI Signal (RSSI): -54dBm
[0d00h06m54s] 2023-03-15T08:15:24 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h06m54s] 2023-03-15T08:15:24 <ERR> [MQTT IF] Disconnected, multiple reconnect attempts failed, still retrying...
[0d00h07m27s] 2023-03-15T08:15:57 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h08m01s] 2023-03-15T08:16:31 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h08m34s] 2023-03-15T08:17:04 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h09m08s] 2023-03-15T08:17:38 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h09m41s] 2023-03-15T08:18:11 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h09m41s] 2023-03-15T08:18:11 <ERR> [MQTT IF] Disconnected, multiple reconnect attempts failed, still retrying...
[0d00h10m15s] 2023-03-15T08:18:45 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h10m26s] 2023-03-15T08:18:56 <DBG> [TFLITE SERVER] ----------------------------------------------------------------
[0d00h10m26s] 2023-03-15T08:18:56 <INF> [TFLITE SERVER] Round #3 started
[0d00h10m26s] 2023-03-15T08:18:56 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h10m30s] 2023-03-15T08:19:00 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h10m33s] 2023-03-15T08:19:03 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h10m45s] 2023-03-15T08:19:15 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h10m58s] 2023-03-15T08:19:28 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h10m58s] 2023-03-15T08:19:28 <DBG> [CNN] doFlow after alignment
[0d00h10m58s] 2023-03-15T08:19:28 <DBG> [TFLITE] CTfLiteClass::LoadModel
[0d00h10m58s] 2023-03-15T08:19:28 <DBG> [TFLITE] CTfLiteClass::ReadFileToModel: /sdcard/config/dig-cont_0600_s3.tflite
[0d00h11m00s] 2023-03-15T08:19:30 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h11m15s] 2023-03-15T08:19:45 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h11m15s] 2023-03-15T08:19:45 <ERR> [MQTT IF] Disconnected, multiple reconnect attempts failed, still retrying...
[0d00h11m30s] 2023-03-15T08:20:00 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h11m45s] 2023-03-15T08:20:15 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h11m46s] 2023-03-15T08:20:16 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h11m49s] 2023-03-15T08:20:19 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h11m50s] 2023-03-15T08:20:20 <INF> [POSTPROC] main: Raw: 01589215.2, Value: 1589215.2, Status: no error
[0d00h11m50s] 2023-03-15T08:20:20 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h11m50s] 2023-03-15T08:20:20 <WRN> [MQTT SERVER] Unable to send System Topics, we are not connected to the MQTT broker!
[0d00h11m50s] 2023-03-15T08:20:20 <WRN> [MQTT] One or more MQTT topics failed to be published!
[0d00h11m50s] 2023-03-15T08:20:20 <DBG> [MQTT IF] Publish skipped. Client not initalized or not connected. (topic: AHwatermeter/status)
[0d00h11m50s] 2023-03-15T08:20:20 <INF> [TFLITE SERVER] Round #3 completed (84 seconds)
[0d00h11m50s] 2023-03-15T08:20:20 <DBG> [TFLITE SERVER] CPU Temperature: 53°C
[0d00h11m50s] 2023-03-15T08:20:20 <DBG> [TFLITE SERVER] WIFI Signal (RSSI): -53dBm
[0d00h12m00s] 2023-03-15T08:20:30 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h12m16s] 2023-03-15T08:20:45 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h12m31s] 2023-03-15T08:21:00 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h12m31s] 2023-03-15T08:21:01 <ERR> [MQTT IF] Disconnected, multiple reconnect attempts failed, still retrying...
[0d00h12m46s] 2023-03-15T08:21:16 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h13m01s] 2023-03-15T08:21:31 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h13m16s] 2023-03-15T08:21:46 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h13m31s] 2023-03-15T08:22:01 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h13m46s] 2023-03-15T08:22:16 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h13m46s] 2023-03-15T08:22:16 <ERR> [MQTT IF] Disconnected, multiple reconnect attempts failed, still retrying...
[0d00h14m01s] 2023-03-15T08:22:31 <WRN> [MQTT IF] Disconnected, trying to reconnect
[0d00h14m17s] 2023-03-15T08:22:47 <INF> [MQTT IF] Connected to broker
[0d00h14m17s] 2023-03-15T08:22:47 <DBG> [MQTT IF] topic AHwatermeter/ctrl/flow_start subscribe successful, msg_id=44
[0d00h15m26s] 2023-03-15T08:23:56 <INF> [TFLITE SERVER] Round #4 started
[0d00h15m26s] 2023-03-15T08:23:56 <DBG> [MQTT IF] Published topic: AHwatermeter/status, content: Take Image (msg_id=45)
[0d00h15m33s] 2023-03-15T08:24:03 <DBG> [MQTT IF] Published topic: AHwatermeter/status, content: Aligning (msg_id=46)
[0d00h15m58s] 2023-03-15T08:24:28 <DBG> [MQTT IF] Published topic: AHwatermeter/status, content: Digitalization of ROIs (msg_id=47)
[0d00h16m47s] 2023-03-15T08:25:17 <DBG> [MQTT IF] Published topic: AHwatermeter/status, content: Digitalization of ROIs (msg_id=48)
[0d00h16m50s] 2023-03-15T08:25:20 <DBG> [MQTT IF] Published topic: AHwatermeter/status, content: Post-Processing (msg_id=49)
[0d00h16m50s] 2023-03-15T08:25:20 <INF> [POSTPROC] main: Raw: 01589215.3, Value: 1589215.3, Status: no error
[0d00h16m50s] 2023-03-15T08:25:20 <DBG> [MQTT IF] Published topic: AHwatermeter/status, content: Sending MQTT (msg_id=50)
[0d00h16m50s] 2023-03-15T08:25:20 <DBG> [MQTT SERVER] Publishing System MQTT topics...
[0d00h16m50s] 2023-03-15T08:25:20 <DBG> [MQTT IF] Published topic: AHwatermeter/connection, content: connected (msg_id=51)
[0d00h16m50s] 2023-03-15T08:25:20 <DBG> [MQTT IF] Published topic: AHwatermeter/uptime, content: 1010 (msg_id=52)
[0d00h16m50s] 2023-03-15T08:25:20 <DBG> [MQTT IF] Published topic: AHwatermeter/freeMem, content: 2981306 (msg_id=53)
[0d00h16m51s] 2023-03-15T08:25:20 <DBG> [MQTT IF] Published topic: AHwatermeter/wifiRSSI, content: -52 (msg_id=54)
[0d00h16m51s] 2023-03-15T08:25:20 <DBG> [MQTT IF] Published topic: AHwatermeter/CPUtemp, content: 65 (msg_id=55)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT SERVER] Successfully published all System MQTT topics
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT SERVER] Int. Heap Usage before publishing System Topics: 79407, after: 79407, delta: 0, lowest free: 59759
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT] Publishing MQTT topics...
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/value, content: 1589215.3 (msg_id=56)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/error, content: no error (msg_id=57)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/rate, content: 0.020000 (msg_id=58)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/rate_per_time_unit, content: 1.200000 (msg_id=59)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/changeabsolut, content: 0.1 (msg_id=60)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/rate_per_digitalization_round, content: 0.1 (msg_id=61)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/raw, content: 01589215.3 (msg_id=62)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/timestamp, content: 2023-03-15T08:24:03+0100 (msg_id=63)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/main/json, content: { "value": "1589215.3", "raw": "01589215.3", "pre": "1589215.3", .. (msg_id=64)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [MQTT IF] Published topic: AHwatermeter/status, content: Flow finished (msg_id=65)
[0d00h16m51s] 2023-03-15T08:25:21 <INF> [TFLITE SERVER] Round #4 completed (85 seconds)
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [TFLITE SERVER] CPU Temperature: 53°C
[0d00h16m51s] 2023-03-15T08:25:21 <DBG> [TFLITE SERVER] WIFI Signal (RSSI): -52dBm
[0d00h18m19s] 2023-03-15T08:26:49 <DBG> [OTA FILE] log_get_last_part_handler

@FastFrank
Copy link
Author

After the reboot the 15.0.3 is back online...
image

@caco3
Copy link
Collaborator

caco3 commented Mar 15, 2023

Homeassistant uses the topic AHwatermeter/connection to indicate if the device is available or not.
This especially gets sent in fix-timezone-config-parser, so that should be fine on device side!
Looking on your first logs (the ones for 15.0.3), it shows that you also have quite some connection problems with MQTT!

Please update to 15.1.0 and check the logs there.
The only MQTT related changes where #2091, but this should not make it worse for you.

Please note that it is not suggested to restart HA and the MQTT broker every night. This means you will lose messages during that time!

@FastFrank
Copy link
Author

I tried by manual publishing the connected payload to the AHwatermeter/connection topic. But is does not bring it back online.
It takes 10 minutes for my server to reboot/restart. So the next reading wil only miss 1 or 2 messages and the measurement will be twice or three times higher. Because it are counters you will not miss any volume or kWh.
I wil try 15.1.0 on 1 device and try restarting the server, i will let you know the result.

@FastFrank
Copy link
Author

v15.1.0 says: (Only send Homeassistant Discovery the first time we connect, ...)
I think it has to send the auto-discovery every time it connects...
That was my experience when was i publishing manual to test the HA behaviour...

@caco3
Copy link
Collaborator

caco3 commented Mar 15, 2023

I think it has to send the auto-discovery every time it connects...

No, HA only needs to receive the discovery topics once, so it can set the device representation up.

@caco3
Copy link
Collaborator

caco3 commented Mar 15, 2023

I tried by manual publishing the connected payload to the AHwatermeter/connection topic. But is does not bring it back online.

You can test the HA behaviour by sending "connection lost" resp. "connected" to "AHwatermeter/connection" using another MQTT client.

@FastFrank
Copy link
Author

No, HA only needs to receive the discovery topics once, so it can set the device representation up.

But when the HA restarts.. it needs those again.. the AI-on-the-Edge device does not "know" if HA had restarted or just lost the connection...

@caco3
Copy link
Collaborator

caco3 commented Mar 15, 2023

No, HA only needs to receive the discovery topics once, so it can set the device representation up.

But when the HA restarts.. it needs those again.. the AI-on-the-Edge device does not "know" if HA had restarted or just lost the connection...

Then your HA is setup quite odly!
HA does not forget or lose a device after a restart. It might show it as disconnected until it gets the next "connected" message (gets sent at each round), but that's all.

@FastFrank
Copy link
Author

It looks like HA keeps the devices but they will not re-appear online after they are offline for some minutes unless you re-send the auto-discovery sequence...

@caco3
Copy link
Collaborator

caco3 commented Mar 15, 2023

It looks like HA keeps the devices but they will not re-appear online after they are offline for some minutes unless you re-send the auto-discovery sequence...

What do you mean "not re-appear"?

After a MQTT timeout (which is set to 2.5 of the Round interval), the MQTT broker will send the Last Will Topic which is "connection lost". HA will then mark all entries of that device as "not available".
Example. <DBG> [MQTT] Digitizer interval is 2.0 minutes => setting MQTT LWT timeout to 5.0 minutes.

After the device completes a round, it publish the "connection" topic with "connected" and HA will show the entries as "available" again.

Sending the Discovery topics is completely independent of this!

And as a side note, there are many users with HA, if there would be such a bug, you for sure would not be the only one complaining!

@caco3 caco3 removed the bug Something isn't working label Mar 15, 2023
Repository owner locked and limited conversation to collaborators Mar 15, 2023
@caco3 caco3 converted this issue into discussion #2193 Mar 15, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants