mqtt_vacuum_camera: Proxmox VE: The map fails to update after an unpredictable time interval.
Checklist
- I have updated the integration to the latest version available
- I have checked if the problem is already reported
The problem
In a fresh installation of version 1.5.7.1 with the Viomi V7, also known as Mi Robot Vacuum-Mop P, I’m utilizing both ‘Hypfer/lovelace-valetudo-map-card’ and ‘Valetudo Vacuum’s Camera’ in conjunction with ‘lovelace-xiaomi-vacuum-map-card.’ However, I’ve noticed that the map image stops updating pretty randonly(usually within 10 min it stops) when using ‘Valetudo Vacuum’s Camera,’ while the maps from ‘Hypfer/lovelace-valetudo-map-card’ and the Web GUI of Valetudo are functioning as expected.
Toggling any option that restarts the addon in the ‘Configure - Valetudo Camera Options’ workflow gets it working again for a brief period. However, it eventually stops again.
What version of an integration has described problem?
1.5.7.1
What was the last working version of an integration?
1.5.7.1
What vacuum model do you have problems with?
Mi Robot Vacuum-Mop P (Viomi v7)
Please firmware installed on your Vacuum.
0047 - Valetudo 2023.12.0
What version of Home Assistant do you use?
2024.1.6
What type of installation are you running?
Home Assistant OS
Camera’s settings.
No response
Logs or Errors shown in the HA snapshots (please enable the Debug Mode)
Updating valetudo_vacuum_camera camera took longer than the scheduled update interval 0:00:03
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 45 (45 by maintainers)
@sca075 Hello there, good day! I’ve just submitted two language packs: one for Japanese (jp.json) and another for Taiwanese Mandarin (zh-Hant). I hope I’m not too late. I apologize for not being able to keep up with the topic closely last week, as I was sent to Valencia for work. While it was a wonderful trip overall, I can’t help but wish it was for vacation instead of work.😂
Wishing you a safe and enjoyable journey ahead!👍
Sorry for the huge delay, I’ll do my best to address it once I’m back home, starting this coming Sunday. I believe we can figure it out next week. Have a great weekend by thw way!
@kodbuzz https://github.com/sca075/valetudo_vacuum_camera/issues/78 Tests on Promox are passed, I will keep the robot in standby for this time and I still need to enable a couple of thinks like VS code but on issue #78 I did post the link of the procedure I followed for the setup of the VE and also the settings I used to create it… Base Hardware is actually made for OpenSense (Celeron J1900 8GB with 4x GB-LAN) and it connected directly to the main router.
Please note that I give you a sing as soon we are ready to test it and of course, please do not stress on checking daily here… I will use the @ so that if you use github on mobile you will be notified. Thanks once again for you kind availability… I will update in any cases the progress on this issue (just for tracking 😉. Wish you a beautiful weekend.
Firstly, I want to extend my apologies for the delay in getting back to you, it was a tough week for me. and once again, thank you for your continued efforts and commitment to resolving this issue, yyour persistence is truly inspiring. Take your time with it as I’m here as a tester whenever you’re ready to proceed. 😃
okay it was just to better understand… I found an old laptop meanwhile and I will setup proxmox on it… will let you know thanks once again 😃
Good evening, I’ve removed the Valetudo Map Card from both Lovelace and HACS, then got HA restarted, and waited for few minutes and sadly, turned out valetudo_vacuum_camera fails eventually as the debug log looks exactly the same like before. Plus I found the entity of the map data source went unavailable just once the system restarts, and it is stable afterwards.
It is my pleasure to support you, and I really appreciate your efforts too. There are other users using the VE as you do and I will deeply investigate it (this anyway is going to take time as per I will need to setup an environment for the tests) I’m sorry it didn’t work.
De facto you also confirmed that the rendering of the image happened without to influence Home Assistant (and that is already a progress)
Unfortunately the camera as it is structured is relatively heavy to handle on those environments (I did test it on real hardware instead) therefore I’m considering to use an old laptop to setup one VE and proximos to understand this issue at a deeper level.
I’m really grateful to you for the great support and cooperation demonstrated and especially the time you spent on it… this is the kind of cooperation we really need more than just pointing out “that doesn’t work” … I hope soon to arrive to a tested and surely working solution in the next days will let you know when all is ready
Good morning, sorry for the delay. I just updated to the most recent commit, and I
believeI may have some interesting discoveries.According to the debug log, it appears that the addon suddenly returns only the last valid image and continues to do so. Interestingly, around the same time this behavior started, I noticed that the entity of the map data source, in my case ‘camera.valetudo_desertedpalenightingale_map_data,’ went Unavailable for a very brief period, like 1s, since then, the addon stops updating. I’m unsure if these events are somehow related. ^1 Seems not related.
Here comes the debug log, and screenshots.
Update1: There’s also a warning in the log besides debug logs:
Update2: ^1: Just tested another round, and this time it stops updating while the map data source didn’t go unavailable. So, it seems unlikely that they are related.
Update3: I’m gonna rename all my rooms from Japanese to English to see if there were any issues related to codepage traps.
@kodbuzz, Good morning, just for clarity… it looks the calculation of the CPU usage is the guilty part… as well there is a problem that I need to solve to read the snapshot in the www folder if it is there (as per it can be deleted by option). The camera startup message was coming from the this function. Then now… if you would be so kind to test also the new commits I posted few minutes ago at your convenience… In general it should happen the following:
Great! But please don’t push yourself too hard. Wishing you a wonderful night!
But now I think I know where is the problem 😉 will work on it and let you know soon
@kodbuzz currently working on it and for the most studding a possible solution. I think from the logs and also our conversation…
I did some modification in the camera, so that we do not search the screenshot directly but output the last image grabbed… and also some change on the MQTT part, that I’m currently testing. The next message would be to confirm when all it is okay that you can download the main version.
I will remove anyhow this log entry it is a good catch… privacy is high priority for us…
no no, I apologize for the confusion, the
<REDACTED>mark was made by me. I commented out my room layout information for privacy concerns, from the logs, left a<REDACTED>there as a place holder.2024-02-05 16:29:13.624 DEBUG (desertedpalenightingale_camera_0) [custom_components.valetudo_vacuum_camera.camera_processing] <REDACTED> I think we found the issue (security ???) then the component restart when the logger output the rooms attributes. I will remove this line and also I will modify any other specious points… Anyway I need to say we are doing quite a good team work here… thanks a lot for this.
To try to align with your setup, which doesn’t experience map issues, I attempted to assign 8GB of RAM to the HAOS VM in Proxmox VE (32GB in total on the host machine). I tested both Ballooning=0 and Ballooning=1, but unfortunately, the restart loop issue persists. attaching the log:
Oh no, it turned gray again just now, with the debug log reads:
2024-02-05 14:51:13.210 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Snapshot acquired during docked Vacuum State. 2024-02-05 14:51:13.210 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Image update complete 2024-02-05 14:51:13.210 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] Adjusted desertedpalenightingale: Frame interval: 5.724 2024-02-05 14:51:13.255 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale System CPU usage stat: 30.25% 2024-02-05 14:51:13.255 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale Camera Memory usage in GB: 0.59, 15.54% of Total. 2024-02-05 14:51:49.809 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] Received valetudo/DesertedPaleNightingale image data from MQTT 2024-02-05 14:51:50.643 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] No data from valetudo/DesertedPaleNightingale or vacuum docked 2024-02-05 14:51:50.692 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Image not processed. Returning not updated image. 2024-02-05 14:51:50.741 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale System CPU usage stat: 0.0% 2024-02-05 14:51:50.741 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale Camera Memory usage in GB: 0.63, 16.39% of Total. 2024-02-05 14:52:50.643 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] Received valetudo/DesertedPaleNightingale image data from MQTT 2024-02-05 14:52:50.663 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] No data from valetudo/DesertedPaleNightingale or vacuum docked 2024-02-05 14:52:50.711 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Image not processed. Returning not updated image. 2024-02-05 14:52:50.714 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale System CPU usage stat: 27.0% 2024-02-05 14:52:50.715 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale Camera Memory usage in GB: 0.61, 16.06% of Total. 2024-02-05 14:53:51.684 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] Received valetudo/DesertedPaleNightingale image data from MQTT 2024-02-05 14:53:53.684 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] No data from valetudo/DesertedPaleNightingale or vacuum docked 2024-02-05 14:53:53.732 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Image not processed. Returning not updated image. 2024-02-05 14:53:53.735 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale System CPU usage stat: 180.3% 2024-02-05 14:53:53.735 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale Camera Memory usage in GB: 0.62, 16.06% of Total. 2024-02-05 14:54:52.427 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] Received valetudo/DesertedPaleNightingale image data from MQTT 2024-02-05 14:54:53.723 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] No data from valetudo/DesertedPaleNightingale or vacuum docked 2024-02-05 14:54:53.771 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Image not processed. Returning not updated image. 2024-02-05 14:54:53.774 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale System CPU usage stat: 27.23% 2024-02-05 14:54:53.774 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale Camera Memory usage in GB: 0.63, 16.42% of Total. 2024-02-05 14:55:53.135 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] Received valetudo/DesertedPaleNightingale image data from MQTT 2024-02-05 14:55:53.929 INFO (MainThread) [custom_components.valetudo_vacuum_camera.valetudo.MQTT.connector] No data from valetudo/DesertedPaleNightingale or vacuum docked 2024-02-05 14:55:53.981 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Image not processed. Returning not updated image. 2024-02-05 14:55:53.985 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale System CPU usage stat: 0.0% 2024-02-05 14:55:53.986 DEBUG (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale Camera Memory usage in GB: 0.62, 16.2% of Total. 2024-02-05 14:55:56.906 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot image 2024-02-05 14:55:59.850 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot image 2024-02-05 14:55:59.851 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Starting up … 2024-02-05 14:56:02.851 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot image 2024-02-05 14:56:02.852 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Starting up … 2024-02-05 14:56:05.852 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot image 2024-02-05 14:56:05.853 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Starting up … 2024-02-05 14:56:08.852 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot image 2024-02-05 14:56:08.853 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Starting up … 2024-02-05 14:56:11.880 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot image 2024-02-05 14:56:11.886 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Starting up … 2024-02-05 14:56:14.880 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot image 2024-02-05 14:56:14.881 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] desertedpalenightingale: Starting up … 2024-02-05 14:56:17.881 INFO (MainThread) [custom_components.valetudo_vacuum_camera.camera] /config/www/snapshot_desertedpalenightingale.png: searching Snapshot
After installing v1.5.7.2, the map turned completely gray following the initial reboot of HA. However, it returned to normal after restarting the addon. I plan to conduct a few test runs after the local quiet hours conclude, just a few hours, since unfortunately, the elderly woman who lives downstairs is unwell at home. I hope she recovers soon, and I don’t want to disturb her.
btw, just starred this awesome project! 😃
@kodbuzz in few minutes the v1.5.7.2 should be available please let me know if the issue can be closed 😉 p.s. if you are satisfied please start this project 😃
@kodbuzz I did acknowledge this too, but I didn’t get that message (the reason is that the code did slow down due to the use of GC too often). I’m going to release another version in the next minutes (that should be equal to the 1.5.7 but with some CPU and memory safe guard) for another issue I’m trying to understand… on Intel the update of the image is almost same as the one on the vacuum map… the technology used (java is faster than python) is different so yep there could be some delay but no stop on the rendering… please give me a couple of minutes and we should be ready for fixing this 😉