Skip to content
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

Wireless temp (& tank?) sensor issues #1666

Closed
chriadam opened this issue Oct 31, 2024 · 16 comments
Closed

Wireless temp (& tank?) sensor issues #1666

chriadam opened this issue Oct 31, 2024 · 16 comments
Assignees
Labels
bug Something isn't working medium_prio
Milestone

Comments

@chriadam
Copy link
Contributor

chriadam commented Oct 31, 2024

There are a few reports about Ruuvi temperature sensors:

  1. After adding a Ruuvi sensor (bluetooth), a reboot is required to make it show up in the device list. (I, Matthijs, have not reproduced it or tried to). Reported here: https://community.victronenergy.com/t/new-venus-os-3-50-ui-issue-adding-bt-sensor-ruvitag/9942/4

  2. Temperatures go missing on local GX Touch: https://community.victronenergy.com/t/firmware-3-50-issue-ruvvi-tags-dropping-on-gx-touch-display-but-not-on-remote-console/10225/1.

  3. its reported, seen by Matthijs also (while running WASM), that the Bluetooth sensor config menu is sometimes empty. But then reopening it soon, ie 30 minutes, after, it all sensors show up again in that same menu. This could also be a range issue, but from initial investigation in the logs of that system that doesn't seem to be the case. I've asked Dirk-Jan to look into tha side further; meanwhile please check gui-v2 code.

Note that there is also another issue, which has to do with the temperature type selection - but thats not a gui-v2 issue and handled here: victronenergy/venus#1385

@chriadam chriadam added bug Something isn't working high_prio High priority labels Oct 31, 2024
@chriadam chriadam added this to the 1.0.0-fixes milestone Oct 31, 2024
@chriadam

This comment was marked as resolved.

@chriadam chriadam added medium_prio and removed high_prio High priority labels Oct 31, 2024
@ReinvdZee

This comment was marked as resolved.

@chriadam

This comment was marked as resolved.

@mpvader

This comment was marked as resolved.

@mpvader
Copy link
Contributor

mpvader commented Nov 4, 2024

Another Ruuvi bug report: https://community.victronenergy.com/t/firmware-3-50-issue-ruvvi-tags-dropping-on-gx-touch-display-but-not-on-remote-console/10225/1

i’ve added it to the list. (Not sure if this is ruuvi only, also other devices can be lost and come back, but with Ruuvis that is much more common due to wireless)

@chriadam

@chriadam
Copy link
Contributor Author

chriadam commented Nov 4, 2024

@blammit ^ this one looks like the device model isn't handling changes properly.

@mpvader mpvader assigned chriadam and dirkjanfaber and unassigned ReinvdZee Nov 9, 2024
@mpvader
Copy link
Contributor

mpvader commented Nov 9, 2024

An update:

I found the cause of the temperature type configuration issue has been found; its not a gui-v2 issue and will be solved shortly.

But meanwhile there are still other reports. Please look into that @chriadam or @blammit ; and I've asked @dirkjanfaber to look as well as he has god experience with the Ruuvi sensors and has them available.

@nmbath
Copy link
Contributor

nmbath commented Nov 9, 2024

Regarding 3, I regularly see this within WASM. A browser refresh brings them back, then after a period of time they disappear and a browser refresh brings them back. See video. On the actual curb display they never disappear.

If any logs would help let me know, also feel free to access my system.

Screen.Recording.2024-11-09.at.08.34.33.mov

@blammit
Copy link
Contributor

blammit commented Nov 12, 2024

Regarding 3, I regularly see this within WASM. A browser refresh brings them back, then after a period of time they disappear and a browser refresh brings them back. See video. On the actual curb display they never disappear.

@nmbath the list in the Bluetooth sensor configs is built by looking under mqtt/ble/0/Devices/<X> on wasm. When the devices disappear, could you check under Settings > Debug > Values and see if there are any values there?

I can have a look on your system too if you can provide access, but if it's difficult to reproduce it might be easier for you to check that.

@nmbath
Copy link
Contributor

nmbath commented Nov 12, 2024

@blammit Yes they are listed. See Video. It is easy to reproduce. I have a browser window that is permanently connected. Return after a period of time and they have gone, refresh and they return. I have never timed exactly how long between being there and they disappear.

System is available to you, will message privately the VRM ID.

Screen.Recording.2024-11-12.at.07.44.16.mov

@mpvader mpvader changed the title Temperature sensor configuration bugs Wireless temp (& tank?) sensor issues Nov 12, 2024
@blammit blammit self-assigned this Nov 14, 2024
@blammit
Copy link
Contributor

blammit commented Nov 14, 2024

I can reproduce the issue that Mark mentioned in wasm. It seems that the model is losing some of its items for some reason; I need to investigate further.

@blammit
Copy link
Contributor

blammit commented Nov 18, 2024

I think this is what's happening:

  1. The Bluetooth sensor list is populated by a VeQItemSortTableModel that is filtered with a FilterOffline flag, so that it only shows 'online' sensors.
  2. When the MQTT transport disconnects after some idle period, each VeQItemMqtt object detects the connection state change to VeQItemMqttProducer::Disconnected, and calls produceValue(QVariant(), VeQItem::Offline) to change its state to "offline".
  3. At this point, all sensors are removed from the model, due to the FilterOffline flag.
  4. When you start using the browser again, the MQTT transport reconnects, but nothing in VeQItemMqtt changes the state back to a non-offline value like VeQItem::Idle, so the items disappear for good until the browser is refreshed.

blammit added a commit to victronenergy/veutil that referenced this issue Nov 19, 2024
When the MQTT producer is disconnected, leaf items should have their
states set to VeQItem::Offline. This should not be done for non-leaf
items, because when the producer is reconnected, it will only receive
updated values for leaf items; therefore, if a non-leaf item had its
state set to VeQItem::Offline, it would stay offline and never return
to the Idle or Synchronized states.

This fixes a bug where if a VeQItemSortTableModel had non-leaf uids
and was set to FilterOffline, the non-leaf uids would be filtered out
when the MQTT transport was disconnected, but when reconnected, the
non-leaf uids would stay offline and would not be added back to the
model.

victronenergy/gui-v2#1666
blammit added a commit to victronenergy/veutil that referenced this issue Nov 19, 2024
When the MQTT producer is disconnected, leaf items should have their
states set to VeQItem::Offline. This should not be done for non-leaf
items, because when the producer is reconnected, it will only receive
updated values for leaf items; therefore, if a non-leaf item had its
state set to VeQItem::Offline, it would stay offline and never return
to the Idle or Synchronized states.

This fixes a bug where if a VeQItemSortTableModel had non-leaf uids
and was set to FilterOffline, the non-leaf uids would be filtered out
when the MQTT transport was disconnected, but when reconnected, the
non-leaf uids would stay offline and would not be added back to the
model.

victronenergy/gui-v2#1666
blammit added a commit that referenced this issue Nov 19, 2024
Bump veutil version to get 1c6616ae8cbbe86a28ee70dd920375ecbfd79ee1
with the fix.

Part of #1666
blammit added a commit that referenced this issue Nov 19, 2024
Bump veutil version to get 1c6616ae8cbbe86a28ee70dd920375ecbfd79ee1
with the fix.

Part of #1666
@blammit
Copy link
Contributor

blammit commented Nov 20, 2024

  1. its reported, seen by Matthijs also (while running WASM), that the Bluetooth sensor config menu is sometimes empty. But then reopening it soon, ie 30 minutes, after, it all sensors show up again in that same menu. This could also be a range issue, but from initial investigation in the logs of that system that doesn't seem to be the case. I've asked Dirk-Jan to look into tha side further; meanwhile please check gui-v2 code.

This is a bug in the MQTT producer, and is fixed by #1745. The bug was that the VeQuickItem changed to Offline when disconnected, but never returned back from the Offline state when reconnected.

The first two issues appear to be bugs relating to VeQuickItem on a D-Bus backend. Perhaps the VeQuickItem there is doing something similar where it does not return from an Offline state. @jhofstee is this something you would be familiar with, or know how to debug?

@jhofstee
Copy link
Contributor

@blammit First of all, never going into offline state isn't really a fix, simply removing 'filterFlags: VeQItemSortTableModel.FilterOffline' would fix it as well then. But now disconnected sensors will remain shown, while they shouldn't. I will have a look at the dbus code, but it will require something like, if the child is connected, then the parents must be as well e.g.

@blammit
Copy link
Contributor

blammit commented Dec 9, 2024

The main issue (Bluetooth sensors disappearing) has been resolved. I've created #1791 for the issue Jeroen mentioned where the devices are still shown when disconnected. Closing this one.

@blammit blammit closed this as completed Dec 9, 2024
@jhofstee
Copy link
Contributor

jhofstee commented Dec 9, 2024

I checked the dbus implementation, there is no issue there with filtering offline devices and returning later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium_prio
Projects
None yet
Development

No branches or pull requests

7 participants