philippoo66 / optolink-splitter

Splitter for Viessmann Optolink connection
GNU General Public License v3.0
18 stars 4 forks source link

Service does not run after reboot when only connected via WiFi #34

Closed FransOv closed 1 month ago

FransOv commented 1 month ago

The Service description specifies: After=network.target However this does not alsways ensure conncectivity in case of a WiFi connection, only that the network stack is started. Even After=network-online.target does not do this. It only means to wait untill the network interface is configured correctly and has an IP address. In case of a fixed IP address and a WiFi connection that can still mean that the network resources, particulary the MQTT server, are not yet accessible. In my case I noticed that the service always failed after a reboot because of MQTT server not accessible. For some reason, I was not able to find out what, also having a [Timer] section with an OnBootSec line did not work. I finally solved it by including an ExecStartPre=/bin/sleep 30 in the service section.

I'd recommend adding The ExecStartPre line to the top of the service section of the example service definition file in page 120 of the Wiki. Like This: [Service] ExecStartPre=/bin/sleep 30 Type=simple

philippoo66 commented 1 month ago

hi Frans,

thank you again! I agree (adding the entry). can you please do it!? There are two 'autostart instructions, https://github.com/philippoo66/optolink-splitter/wiki/510-error:-externally%E2%80%90managed%E2%80%90environment-%E2%80%90%E2%80%90-venv also.

Do we have to drop a small note rgarding the background of this setting?

greetings! Phil

FransOv commented 1 month ago

Service definitions on page 120 and 510 changed.