mr-manuel / venus-os_dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
https://mr-manuel.github.io/venus-os_dbus-serialbattery_docs/
MIT License
48 stars 18 forks source link

Fix restarting GUI service #34

Closed SenH closed 5 months ago

SenH commented 5 months ago

I updated to Venus v3.33 and noticed following error in /var/log/boot:

Mon Jun 17 20:28:43 2024: svc: warning: unable to chdir to /service/gui: file does not exist
Mon Jun 17 20:28:44 2024: svc: warning: unable to chdir to /service/gui: file does not exist
Mon Jun 17 20:28:44 2024: New QML files were installed and the GUI was restarted.

It seems /service/gui was replaced by /service/start-gui. Not sure when this was done? It is not something specific to v3.33.

Is it also necessary to restart the GUI process in install-qml.sh? The battery interface looks fine without it. Maybe only necessary for restore-gui.sh?

mr-manuel commented 5 months ago

It may be, that the driver started before the GUI was installed by the Venus plattform. Do you get this error only after a reboot? If yes, then I will fix it in another way.

SenH commented 5 months ago

According to the logs start-gui launched 21 seconds before dbus-serialbattery upon boot. I get the error also when updating dbus-serialbattery because /service/gui does not exist.

root@cerbosgx:~$ file /service/gui
/service/gui: cannot open `/service/gui' (No such file or directory)
/data/log/start-gui/current
2024-06-17 22:28:35.478570500 *** CCGX booted (0) ***
2024-06-17 22:28:35.997545500 *** starting start-gui ***
/data/log/dbus-serialbattery.ttyUSB0/current
2024-06-17 22:28:35.297250500 *** CCGX booted (0) ***
2024-06-17 22:28:56.435479500 INFO:SerialBattery:
2024-06-17 22:28:56.436197500 INFO:SerialBattery:Starting dbus-serialbattery
mr-manuel commented 5 months ago

I checked 10 different Venus OS systems with different versions including v3.33 and none had a service called /service/start-gui. On all systems the service /service/gui existed. I checked also the image from https://updates.victronenergy.com/feeds/venus/ and there is only a gui and no start-gui service. Has to be a problem with your config and/or addons you are using.

Disable all add-ons/drivers you have installed and reinstall the latest Venus OS update. You can launch the re-installation of Venus OS with

/opt/victronenergy/swupdate-scripts/check-updates.sh -update -force
SenH commented 5 months ago

Okay, thanks. I don't have any add-ons installed except for venus-os_dbus-serialbattery. Also when updating a new root fs is created. I have a Cerbo-S GX maybe there is a difference.

SenH commented 5 months ago

Here is the proof that in cerbosgx image there is only /service/start-gui :)

wget https://updates.victronenergy.com/feeds/venus/release/images/cerbosgx/venus-swu-cerbosgx.swu
cpio -iv < venus-swu-cerbosgx.swu 
gzip -d venus-image-cerbosgx.ext4.gz 
sudo mkdir -pv /mnt/venus
sudo mount -o loop venus-image-cerbosgx.ext4 /mnt/venus

file /mnt/venus/opt/victronenergy/service/start-gui
/mnt/venus/opt/victronenergy/service/start-gui: directory
file /mnt/venus/opt/victronenergy/service/gui
/mnt/venus/opt/victronenergy/service/gui: cannot open `/mnt/venus/opt/victronenergy/service/gui' (No such file or directory)
mr-manuel commented 5 months ago

Indeed, I looked only at the raspberry pi and nanopi image. Strange that after all this years nobody noted this.

SenH commented 5 months ago

I guess the restart of the GUI is not necessary? Since this has never worked on my Cerbo-S GX but I could access the changed battery QML pages.

mr-manuel commented 5 months ago

If you make a reboot it is not necessary.