kelvin icon indicating copy to clipboard operation
kelvin copied to clipboard

Fail to start/install in Raspi

Open Sarcas666 opened this issue 5 years ago • 8 comments

Hi there, I am a beginner with the Raspi and unix. I got some stuff working by simply following step-by-step instructions. I followed the exact instructions for installing kelvin, but unfortunately it won't run, and I have no idea how to fix it.

When checking of the process is running it says:

● kelvin.service - Kelvin
   Loaded: loaded (/etc/systemd/system/kelvin.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2019-08-14 19:02:31 CEST; 1s ago
  Process: 1548 ExecStart=/home/pi/kelvin/kelvin (code=exited, status=210/CHROOT)
 Main PID: 1548 (code=exited, status=210/CHROOT)

Aug 14 19:02:31 raspberrypi systemd[1]: kelvin.service: Failed with result 'exit-code'.

Any suggestions?

Thx

Sarcas666 avatar Aug 14 '19 17:08 Sarcas666

Hey,

could you paste the output of

journalctl -fu kelvin.service

This should give us a hint what exactly went wrong here.

stefanwichmann avatar Aug 19 '19 10:08 stefanwichmann

Hi, I was actually going to post the same thing. I am able to get Kelvin working fine on my rasberry pi zero W running raspbian when I open the file manually through the command line.

However, I have followed the instructions in your readme file twice and both times I get the same error as what Sarcas666 posted. I do see raspbian loading Kelvin.service when it starts, but it's not able to do anything like download an update, make a config file, or find a location.

I think it has something to do with the permissions. Maybe from setting up a new user? But I'm also a Linux noob and really have no idea what I'm doing.

Unfortunately, I'm formatting my rasberry pi again to try and figure something out again so can't give you logs, but if it'll help, I'll go through the steps to install Kelvin as a system process again and share the output with you.

Thanks!

Otherwise, really awesome program and the reason I filled my house with ambience lights! Thanks so much for your work!

jon6fingrs avatar Aug 28 '19 01:08 jon6fingrs

Havent forgotten about this, but some of my hardware died and I am still slowly rebuilding/reconfiguring stuff. I'll be back :)

Sarcas666 avatar Oct 05 '19 14:10 Sarcas666

Ok thank you! Good luck!

On Oct 5, 2019, at 10:35 AM, Sarcas666 [email protected] wrote:

 Havent forgotten about this, but some of my hardware died and I am still slowly rebuilding/reconfiguring stuff. I'll be back :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jon6fingrs avatar Oct 05 '19 14:10 jon6fingrs

I had the same problem (code=exited, status=210/CHROOT); was able to fix it by following these steps:

Fetch latest release v1.3.2

wget https://github.com/stefanwichmann/kelvin/releases/download/v1.3.2/kelvin-linux-arm-v1.3.2.tar.gz -O /tmp/kelvin-arm.tar.gz

Create directory

sudo mkdir -p /opt/kelvin

Create user to run as

sudo adduser --system --group --shell /bin/nologin --no-create-home --home /opt/kelvin kelvin

Install

cd /opt/kelvin sudo tar -xvzf /tmp/kelvin-arm.tar.gz sudo mv kelvin-linux-arm*/* . sudo rmdir kelvin-linux-arm* sudo rm /tmp/kelvin-arm.tar.gz

Set permissions

sudo chown -R kelvin:kelvin /opt/kelvin

Start the service and look into log

sudo systemctl start kelvin journalctl -fu kelvin.service (close log by pressing CTRL+C)

I noticed the error (code=exited, status=210/CHROOT) was gone now, but kelvin was unable to discover my bridge, so I stopped the service sudo systemctl start kelvin and edited config.json to explicitly state the (fixed) IP of my HUE bridge sudo nano /opt/kelvin/config.json

  "bridge": {
    "ip": "192.168.xxx.xxx",
    "username": ""
  },

I started the service again and looked into the log: sudo systemctl start kelvin journalctl -fu kelvin.service

At this point, it finally asked to press the physical button on the bridge. After pressing the button, it registered and took control over the lights.

After this, I got back to scheduling the service like normal:

Start on boot

sudo systemctl enable kelvin

Confirm status

sudo systemctl status kelvin

c0sm0t0pian avatar Oct 22 '19 10:10 c0sm0t0pian

This worked great. Thank you so much!

On Tue, Oct 22, 2019 at 6:23 AM c0sm0t0pian [email protected] wrote:

I had the same problem (code=exited, status=210/CHROOT); was able to fix it by following these steps: Fetch latest release v1.3.2

wget https://github.com/stefanwichmann/kelvin/releases/download/v1.3.2/kelvin-linux-arm-v1.3.2.tar.gz -O /tmp/kelvin-arm.tar.gz Create directory

sudo mkdir -p /opt/kelvin Create user to run as

sudo adduser --system --group --shell /bin/nologin --no-create-home --home /opt/kelvin kelvin Install

cd /opt/kelvin sudo tar -xvzf /tmp/kelvin-arm.tar.gz sudo mv kelvin-linux-arm*/* . sudo rmdir kelvin-linux-arm* sudo rm /tmp/kelvin-arm.tar.gz Set permissions

sudo chown -R kelvin:kelvin /opt/kelvin Start the service and look into log

sudo systemctl start kelvin journalctl -fu kelvin.service (close log by pressing CTRL+C)

I noticed the error (code=exited, status=210/CHROOT) was gone now, but kelvin was unable to discover my bridge, so I stopped the service sudo systemctl start kelvin and edited config.json to explicitly state the (fixed) IP of my HUE bridge sudo nano /opt/kelvin/config.json

"bridge": { "ip": "192.168.xxx.xxx", "username": "" },

I started the service again and looked into the log: sudo systemctl start kelvin journalctl -fu kelvin.service

At this point, it finally asked to press the physical button on the bridge. After pressing the button, it registered and took control over the lights.

After this, I got back to scheduling the service like normal: Start on boot

sudo systemctl enable kelvin Confirm status

sudo systemctl status kelvin

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanwichmann/kelvin/issues/69?email_source=notifications&email_token=AMXQZUSKSVCYKTOEQHKZYS3QP3IAJA5CNFSM4ILXCUU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB5HPTQ#issuecomment-544896974, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXQZUR33V4VHARKXARBMOLQP3IAJANCNFSM4ILXCUUQ .

jon6fingrs avatar Oct 27 '19 12:10 jon6fingrs

Tried it again, with the latest version as described by c0sm0t0pian above, but still have the same problem.

Running on an rPi3 with buster, everything updated & upgraded. Tried a second time, removed everything from the previous attempt, removed the user kelvin, but no success. Then I noticed the kelvin.service file in /etc/systemd/system was different then the one in /opt/kelvin/etc/ , username and workingdir for example were different. I deleted the one in /etc/systemd/system and copied the one from /opt/kelvin/etc/ . It still did not work, until I manually added the ip of my hue bridge in /etc/systemd/system/kelvin.service .

Now it seems to work...

Aug 17 15:44:29 raspberrypi systemd[1]: Started Kelvin. Aug 17 15:44:29 raspberrypi systemd[17746]: kelvin.service: Changing to the requested working directory failed: No such file or directory Aug 17 15:44:29 raspberrypi systemd[17746]: kelvin.service: Failed at step CHDIR spawning /home/pi/kelvin/kelvin: No such file or directory Aug 17 15:44:29 raspberrypi systemd[1]: kelvin.service: Main process exited, code=exited, status=200/CHDIR Aug 17 15:44:29 raspberrypi systemd[1]: kelvin.service: Failed with result 'exit-code'. Aug 17 15:44:35 raspberrypi systemd[1]: kelvin.service: Service RestartSec=5s expired, scheduling restart. Aug 17 15:44:35 raspberrypi systemd[1]: kelvin.service: Scheduled restart job, restart counter is at 1. Aug 17 15:44:35 raspberrypi systemd[1]: Stopped Kelvin. Aug 17 15:44:35 raspberrypi systemd[1]: Started Kelvin. Aug 17 15:44:35 raspberrypi systemd[17756]: kelvin.service: Changing to the requested working directory failed: No such file or directory Aug 17 15:44:35 raspberrypi systemd[17756]: kelvin.service: Failed at step CHDIR spawning /home/pi/kelvin/kelvin: No such file or directory Aug 17 15:44:35 raspberrypi systemd[1]: kelvin.service: Main process exited, code=exited, status=200/CHDIR Aug 17 15:44:35 raspberrypi systemd[1]: kelvin.service: Failed with result 'exit-code'.

Sarcas666 avatar Aug 17 '20 14:08 Sarcas666

@Sarcas666 you either did not update to https://github.com/stefanwichmann/kelvin/releases/download/v1.3.2/kelvin-linux-arm-v1.3.2.tar.gz -O /tmp/kelvin-arm.tar.gz or you haven't reloaded you systemctl config sudo systemctl daemon-reload

flmessier avatar Aug 18 '20 02:08 flmessier