question

davep avatar image
davep asked

How to get my dbus device service on the GX Device List page

Hello Everyone,

I'm trying to get the GX GUI to see my dbus service on the device list. dbus-spy shows me it's running, but the GUI doesn't seem to see it.

I'm looking into PageMain.qml, which constructs that list dynamically based on DbusServices. I discovered my service isn't getting started until after the GUI has already performed the services evaluation and I can't find a way to make it re-eveluate.

Is there a way to force my service to start before the GUI? Or something that would trigger the PageMain.qml re-evaluation?

Secondly, how do I provide a service.type value that will then be recognized during that evaluation?

Thanks for any insight.

Dave

Venus OS
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
bathnm avatar image
bathnm answered ·

I do not believe it is that easy! I have have recently investigated this myself.

If you look at PageMain.qml, there is a switch statement within function addService(service). The switch statement uses the value service.type.

So you need to find what calls addServcie and where service.type is set. From my research I believe it is within the main GUI executable and therefore not editable or changeable.

There are some other ways to add an item. Again look at the code for how the Settings and Messages pages are added to the list. However that is not tidy and a lot fo extra code used to check if my service is running and available and should it be loaded.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

davep avatar image davep commented ·

Yeah, that switch got me very quickly to a dead end as far as finding definitions. The gui executable matches...

It looks like there are two ways to get to addService: 1) Component.onCompleted, which I believe is triggered when one of the pre-defined pages in the file finishes loading. Ultimately, this may be where I need to go, but for now, I'm just looking to get on the GUI radar; and 2) Connections, which looks like it should trigger whenever a new DBUS service appears. I added some logging within addService to show any service that gets there, and mine never does.

I'm new to QML, so I could be guessing wrong...

I'll take a look at those pages for examples.

Thanks.


0 Likes 0 ·
laurenceh avatar image
laurenceh answered ·

I looked at this some time ago as I have a humidity service which will not appear on the GUI or VRM. I have already added about 5 temperature sensors, they work fine.

so Ihave decided my approach will be to make humidity a “temperature” service and just rename it “humidity”. The latest code releases allow quite a lot of renaming.


Or of course I could make it a “tank” service as humidity is something that fits nicely with the concept of a value between 0% and 100%.


I did already suggest in this forum that allowing anyone to define as many “temperature” services as they choose, but not allowing them to add a service of a different type was a bit silly. Perhaps Markus will think again if Victron see how many renamed temperature devices ther are going to be in the VRM.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic