autowx2 icon indicating copy to clipboard operation
autowx2 copied to clipboard

Autostart script

Open OK1SLM opened this issue 5 years ago • 5 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

OK1SLM avatar Jul 20 '19 11:07 OK1SLM

This will create a service which will start at bootup and restart if autowx dies (which happens) :

sudo nano /etc/systemd/system/autowx2.service

[Unit] Description=autowx2 [Service] User=pi Group=pi Restart=always RestartSec=10 WorkingDirectory=/home/pi/autowx2 ExecStart=/home/pi/autowx2/autowx2.py [Install] WantedBy=multi-user.target

Replace /home/pi with the location of your autowx2 directory _This assumes you're using the default "pi" user to install & run autowx2. Check the User & Group with "id" command.

sudo chmod 644 /etc/systemd/system/autowx2.service sudo systemctl daemon-reload sudo systemctl enable autowx2.service sudo systemctl start autowx2.service

Check if working properly with : systemctl status autowx2.service

0nnyx avatar Aug 22 '19 21:08 0nnyx

sudo nano /lib/systemd/system/autowx2.service

[Unit] Description=autowx2 After=multi-user.target [Service] Restart=always RestartSec=10 WorkingDirectory=/home/pi/autowx2 ExecStart=/usr/bin/python /home/pi/autowx2/autowx2.py [Install] WantedBy=multi-user.target

sudo chmod 644 /lib/systemd/system/autowx2.service sudo systemctl daemon-reload sudo systemctl enable autowx2.service sudo systemctl start autowx2.service

OK1SLM avatar Aug 22 '19 22:08 OK1SLM

gm i follow your script but raspi answer after cmd "sudo systemctl enable autowx2.service" : Failed to enable unit: Unit file autowx2.service does not exist. can your help Me ? 73 Eric F1SMV

Eric738 avatar Jun 06 '20 05:06 Eric738

Hi Eric, your error means the autowx2.service file was not created. I just updated my initial post to be fully correct & more explicit. Try it again

0nnyx avatar Jun 06 '20 08:06 0nnyx

GA

follow your nex instructions, but always this error message...

Loaded: loaded (/etc/systemd/system/autowx2.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2020-06-07 18:15:35 CEST; 21s ago Main PID: 3230 (python) Tasks: 2 (limit: 2200) Memory: 49.1M CGroup: /system.slice/autowx2.service └─3230 python /home/pi/autowx2/autowx2.py

juin 07 18:15:51 raspberrypi autowx2.py[3230]: self.__target(*self.__args, **self.__kwargs) juin 07 18:15:51 raspberrypi autowx2.py[3230]: File "/home/pi/autowx2/autowx2_functions.py", line 722, in mainLoop juin 07 18:15:51 raspberrypi autowx2.py[3230]: while not runTest(): juin 07 18:15:51 raspberrypi autowx2.py[3230]: File "/home/pi/autowx2/autowx2_functions.py", line 268, in runTest juin 07 18:15:51 raspberrypi autowx2.py[3230]: stderr=subprocess.PIPE) juin 07 18:15:51 raspberrypi autowx2.py[3230]: File "/usr/lib/python2.7/subprocess.py", line 394, in init juin 07 18:15:51 raspberrypi autowx2.py[3230]: errread, errwrite) juin 07 18:15:51 raspberrypi autowx2.py[3230]: File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child juin 07 18:15:51 raspberrypi autowx2.py[3230]: raise child_exception juin 07 18:15:51 raspberrypi autowx2.py[3230]: OSError: [Errno 2] No such file or directory

i updated python for version 3.8.0

Eric

Eric738 avatar Jun 07 '20 16:06 Eric738