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

Autostart onBoot is not working! #27

Open
FuchsLo opened this issue May 13, 2020 · 5 comments
Open

Autostart onBoot is not working! #27

FuchsLo opened this issue May 13, 2020 · 5 comments

Comments

@FuchsLo
Copy link

FuchsLo commented May 13, 2020

I've tried with a lot of ways to make the server run when the pi is starting but nothing is working.
I have a raspberry 3 with the Raspbian Buster Lite OS. The system is just for the oven and i exactly follow the commands, the oven is working well but its not starting when i boot the system.

@chron0
Copy link
Member

chron0 commented May 14, 2020

I suppose Raspbian is using systemd now, so the provided init script wont help much. I've looked thru the forks and so far it seems no one has provided a systemd unit file :) I could write one blind but without the ability to test it wont make much sense and is likely not to work properly the first time.

Have a look at https://github.com/torfsen/python-systemd-tutorial

it shouldnt be too hard, and if it works for you, please send a PR or comment your unit file here and I'll add it into the lib/init folder.

@dawskit
Copy link

dawskit commented Sep 22, 2021

I've done startup code by systemd service.
You need to do below steps:

  1. create a file picoReflow.service in /etc/sysemd/system by command $ sudo nano picoReflow.service

if your username is pi and picoReflow is installed in location /home/pi/picoReflow you don't need to make any changes in code below.

put in file code:

[Unit]
#Human redable name of the unit
Description=picoReflow Service

[Service]
#Command to execute when the service is started
ExecStart=/usr/bin/python /home/pi/picoReflow/picoreflowd.py

[install]
WantedBy=default.target
  1. $ sudo chown root:root picoReflow.service
  2. $ sudo chmod 664 picoReflow.service
  3. $ sudo systemctl enable /etc/systemd/system/picoReflow.service
  4. sudo systemctl daemon-reload
  5. test if script is working by typing $ sudo systemctl | grep picoReflow.service

You should get answer:
$ picoreflow.service loaded active running picoReflow Service

after reebot script should start automaticaly.
Tested on RPI zero

@chron0
Copy link
Member

chron0 commented Sep 22, 2021

<3 - thx for sharing

@f1ssf
Copy link

f1ssf commented Jul 1, 2024

Hi dawstik, I try your solace, but I have this message:
.pi@raspberrypi:~/picoReflow $ sudo systemctl enable /etc/systemd/system/picoReflow.service The unit files have no installation config (WantedBy=, RequiredBy=, Also=, Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled using systemctl.
Can you help me please? Many thank's regards

@f1ssf
Copy link

f1ssf commented Jul 7, 2024

it is ok now, I use command diretly on rc.local.
thank's

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

4 participants