Comments (3)
Hi John,
thanks for reporting this issue. Since Kelvin doesn't do any good without the network being up, we should definitely take care of this issue.
My first take after reading the systemd documentation (https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/) would be to change the dependency in the service file from After=network.target
to After=network-online.target
. This should delay the startup of Kelvin until there is a working network.
Could you try this on the machine where you discovered the problem. This way we could directly verify the fix.
A next step would be to handle network failures more gracefully in the future.
from kelvin.
That did not resolve the issue, behavior was identical. I also tested adding Wants=network-online.target, but it also had no effect.
It looks like network-online target is not enabled by default for the PI:
pi@eqraspberry:~ $ sudo systemctl is-enabled systemd-networkd-wait-online.service
disabled
Based on https://unix.stackexchange.com/questions/353179/why-isnt-my-systemd-service-waiting-for-the-network I then tried changing the kelvin.service to restart on failure after 5 seconds, instead of restart on abort.
My new kelvin.service file looks like:
# /etc/systemd/system/kelvin.service
# service file for Kelvin - The hue bot
# https://github.com/stefanwichmann/kelvin
[Unit]
Description=Kelvin
After=network-online.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/kelvin
ExecStart=/home/pi/kelvin/kelvin
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
And it worked:
pi@eqraspberry:~ $ journalctl -u kelvin
-- Logs begin at Wed 2018-07-18 10:41:43 CDT, end at Wed 2018-07-18 10:44:19 CDT. --
Jul 18 10:41:46 eqraspberry systemd[1]: Started Kelvin.
Jul 18 10:41:46 eqraspberry kelvin[259]: time="2018/18/07 10:41:46" level=info msg="Kelvin v1.1.8 starting up... 🚀"
Jul 18 10:41:46 eqraspberry kelvin[259]: time="2018/18/07 10:41:46" level=info msg="⚙ Configuration /home/pi/kelvin/config.json loaded"
Jul 18 10:41:46 eqraspberry kelvin[259]: time="2018/18/07 10:41:46" level=info msg="Looking for updates..."
Jul 18 10:41:46 eqraspberry systemd[1]: kelvin.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 10:41:46 eqraspberry systemd[1]: kelvin.service: Unit entered failed state.
Jul 18 10:41:46 eqraspberry systemd[1]: kelvin.service: Failed with result 'exit-code'.
Jul 18 10:41:51 eqraspberry systemd[1]: kelvin.service: Service hold-off time over, scheduling restart.
Jul 18 10:41:51 eqraspberry systemd[1]: Stopped Kelvin.
Jul 18 10:41:51 eqraspberry systemd[1]: Started Kelvin.
Jul 18 10:41:51 eqraspberry kelvin[385]: time="2018/18/07 10:41:51" level=info msg="Kelvin v1.1.8 starting up... 🚀"
Jul 18 10:41:51 eqraspberry kelvin[385]: time="2018/18/07 10:41:51" level=info msg="Looking for updates..."
Jul 18 10:41:51 eqraspberry kelvin[385]: time="2018/18/07 10:41:51" level=info msg="⚙ Configuration /home/pi/kelvin/config.json loaded"
Jul 18 10:41:51 eqraspberry systemd[1]: kelvin.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 10:41:51 eqraspberry systemd[1]: kelvin.service: Unit entered failed state.
Jul 18 10:41:51 eqraspberry systemd[1]: kelvin.service: Failed with result 'exit-code'.
Jul 18 10:41:56 eqraspberry systemd[1]: kelvin.service: Service hold-off time over, scheduling restart.
Jul 18 10:41:56 eqraspberry systemd[1]: Stopped Kelvin.
Jul 18 10:41:56 eqraspberry systemd[1]: Started Kelvin.
Jul 18 10:41:57 eqraspberry kelvin[474]: time="2018/18/07 10:41:57" level=info msg="Kelvin v1.1.8 starting up... 🚀"
Jul 18 10:41:57 eqraspberry kelvin[474]: time="2018/18/07 10:41:57" level=info msg="Looking for updates..."
Jul 18 10:41:57 eqraspberry systemd[1]: kelvin.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 10:41:57 eqraspberry systemd[1]: kelvin.service: Unit entered failed state.
Jul 18 10:41:57 eqraspberry systemd[1]: kelvin.service: Failed with result 'exit-code'.
Jul 18 10:42:02 eqraspberry systemd[1]: kelvin.service: Service hold-off time over, scheduling restart.
Jul 18 10:42:02 eqraspberry systemd[1]: Stopped Kelvin.
Jul 18 10:42:02 eqraspberry systemd[1]: Started Kelvin.
Jul 18 10:42:02 eqraspberry kelvin[646]: time="2018/18/07 10:42:02" level=info msg="Kelvin v1.1.8 starting up... 🚀"
Jul 18 10:42:02 eqraspberry kelvin[646]: time="2018/18/07 10:42:02" level=info msg="Looking for updates..."
Jul 18 10:42:02 eqraspberry kelvin[646]: time="2018/18/07 10:42:02" level=info msg="⚙ Configuration /home/pi/kelvin/config.json loaded"
Jul 18 10:42:02 eqraspberry kelvin[646]: time="2018/18/07 10:42:02" level=info msg="Webinterface started on port 8080"
Jul 18 10:42:02 eqraspberry kelvin[646]: time="2018/18/07 10:42:02" level=info msg="⌘ Connection to bridge established"
from kelvin.
Hi John,
thanks for finding a solution and testing it! Your help is really appreciated.
I adopted your change to the service configuration. It will be part of the next release.
from kelvin.
Related Issues (20)
- After the Upgrade to v1.3.3, Kelvin No Longer Reacts to Lights Turning On HOT 4
- Push new releases to Docker Hub? HOT 1
- Possible to have defined time take precedence over sunset?
- Daylight Savings Adjustment
- Can't run on mac HOT 2
- How to make Kelvin play nicely with the "Wake up with light" automation? HOT 1
- How to stop Kelvin for disabling when physical lightswitch turned off and on? HOT 5
- How do I change the lights at exactly sunrise and sunset? HOT 1
- Kel
- Auto update to 1.3.5 failing on raspberry pi HOT 2
- Hue API v2 support
- Previous versions were deleted from Docker Hub HOT 1
- 1.3.5 unable to serve GUI HOT 2
- Disable automatic Updates HOT 1
- "enable kelvin" greyed out in dashboard
- Home Assistant OS Plugin HOT 1
- Does not work when bulp is disconected from the power grid
- Half of lights not adjusting when enableWhenLightsAppear = false
- Kelvin only applies defaultBrightness, defaultTemperature and schedules. Nothing else. HOT 3
- Auto update installed bad binary on Raspberry Pi HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kelvin.