I am becoming active again with new developments for Venus Gx and refactoring my code and utils for Venus OS 2.8.
OS: Venus Gx 2.87
Platform: is Rpi 3B+ with 7" touch screen.
I have moved my dbus-i2c service over to python 3 and Gx Venus 2.8 and it works, however....
Problem
When my service starts it does not seem to connect to the dbus settings service, the my service code exits and immediately restarts, on the second run though it works and starts up.
Evidence:
All my code is over here https://github.com/LHardwick-git/Victron-Service
The logfile record of the startup following a reboot is below, you can see that the service has to start twice before it runs correctly.
Question:
Any ideas what to do to get this right?
Should a Just "wait" for a while before trying to call the setting service?
MY PLANS
1) I'm going to insert one-wire code into my dbus service framework (or create a new 1-wire service, to drive relays and read 1-wire temperature sensors.
2) I have new device to play with - A Raspberry Pi Zero with a 2" display
- I plan to write a dbus service to connect wirelessly use HTML/JSon between Venus GX the new device to:
a) read values from sensors at the other end of my narrowboat. Thus avoiding ground loops which are a bad idea in a steel vessel. Interfaces will be temperature, humidity and tank levels to start with.
b) be able to send key sensor values from the Venus Gx to display on the 2" display in my cabin.
Logfile......
2022-06-28 07:55:26.368043500 *** CCGX booted (0) ***
2022-06-28 07:55:29.638348500 INFO:root:/opt/victronenergy/dbus-i2c/dbus-i2c.py is starting up
2022-06-28 07:55:29.638882500 INFO:root:Loglevel set to INFO
2022-06-28 07:55:29.657638500 INFO:root:registered ourselves on D-Bus as com.victronenergy.temperature.Rpi-cpu_id06
2022-06-28 07:55:29.660968500 INFO:root:Add setting /Settings/Temperature/6/TemperatureType [0, 0, 3]
2022-06-28 07:55:29.661646500 INFO:root:Add setting /Settings/Temperature/6/CustomName ['', 0, 0]
2022-06-28 07:55:29.689894500 Traceback (most recent call last):
2022-06-28 07:55:29.689901500 File "/opt/victronenergy/dbus-i2c/dbus-i2c.py", line 341, in <module>
2022-06-28 07:55:29.689906500 initSettings(newSettings)
2022-06-28 07:55:29.689908500 File "/opt/victronenergy/dbus-i2c/dbus-i2c.py", line 210, in initSettings
2022-06-28 07:55:29.689913500 settings = SettingsDevice(
2022-06-28 07:55:29.689915500 File "/opt/victronenergy/dbus-modem/settingsdevice.py", line 51, in __init__
2022-06-28 07:55:29.689920500 raise Exception("The settings service com.victronenergy.settings does not exist!")
2022-06-28 07:55:29.690022500 Exception: The settings service com.victronenergy.settings does not exist!
2022-06-28 07:55:31.101781500 INFO:root:/opt/victronenergy/dbus-i2c/dbus-i2c.py is starting up
2022-06-28 07:55:31.102628500 INFO:root:Loglevel set to INFO
2022-06-28 07:55:31.118723500 INFO:root:registered ourselves on D-Bus as com.victronenergy.temperature.Rpi-cpu_id06
2022-06-28 07:55:31.122157500 INFO:root:Add setting /Settings/Temperature/6/TemperatureType [0, 0, 3]
2022-06-28 07:55:31.122971500 INFO:root:Add setting /Settings/Temperature/6/CustomName ['', 0, 0]
2022-06-28 07:55:31.219031500 INFO:root:Retreived setting /Settings/Temperature/6/TemperatureType /TemperatureType 2
2022-06-28 07:55:31.219859500 INFO:root:Retreived setting /Settings/Temperature/6/CustomName /CustomName CPU Temperature
2022-06-28 07:55:31.221293500 INFO:root:cpu temperature interface connected