roboticseducation
Posts: 2
Joined: Fri Oct 27, 2017 6:17 am
Contact: Website Facebook Google+ Twitter

Raspberry Pi Starting Code on Robot Startup

Thu May 17, 2018 3:58 am

How can I start my vision tracking code on startup of the robot?
robotics education

User avatar
DougieLawson
Posts: 32376
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Raspberry Pi Starting Code on Robot Startup

Thu May 17, 2018 7:12 am

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

Code: Select all

[Unit]
Description=stuff @ boot service

[Service]
ExecStart=/home/pi/python_to_run_at_boot.py
Restart=always
User=pi
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=stuff_at_boot

[Install]
WantedBy=multi-user.target
Enable that with
sudo systemctl enable stuff_at_boot.service
sudo systemctl start stuff_at_boot.service
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “Beginners”

Who is online

Users browsing this forum: jackandjill and 5 guests