Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to start/install in Raspi #69

Open
Sarcas666 opened this issue Aug 14, 2019 · 8 comments
Open

Fail to start/install in Raspi #69

Sarcas666 opened this issue Aug 14, 2019 · 8 comments

Comments

@Sarcas666
Copy link

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

@stefanwichmann
Copy link
Owner

Hey,

could you paste the output of

journalctl -fu kelvin.service

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

@jon6fingrs
Copy link

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!

@Sarcas666
Copy link
Author

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

@jon6fingrs
Copy link

jon6fingrs commented Oct 5, 2019 via email

@c0sm0t0pian
Copy link

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

@jon6fingrs
Copy link

jon6fingrs commented Oct 27, 2019 via email

@Sarcas666
Copy link
Author

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'.

@flmessier
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants