57
7 Set The Program to Start Automatically
7.1 Set The Specified Program to Run Automatically at Boot
●This section only introduces the auto-run method used by our products. If you need more information
about the Raspberry Pi auto-run program, you can refer to this document from
● If you have used the operation steps of 3.5 or 3.6, then the script program has been configured to
automatically run the program at startup. In this chapter, we explain how to set a program to start automatically
at startup from scratch.
●First we use the following code to create a new startup.sh:
sudo touch //home/pi/startup.sh
●Edit startup.sh
sudo nano startup.sh
●Write the following content in startup.sh, where python3 is followed by the program you want to run
automatically. Note that you must use an absolute path here. Let's take webServer.py as an example.
#!/bin/sh
sudo python3 [RobotName]/server/webServer.py
●After Ctrl + X To exit editing. Press Y Save. Enter Confirm and exit editing.
●Give startup.sh permissions, where *** is the Linux permission code, we do not recommend the use of
permissions such as 777, but for novices 777 can avoid many account and permissions problems, of course,
you can also set it to 700 , So that only the owner can read, write and execute startup.sh, you can learn more
about Linux permissions through this article from
Permissions.
sudo chmod 777 //home/pi/startup.sh
●Edit rc.local to configure the script to run automatically
sudo nano /etc/rc.local
●Add the following content under fi in the original document, save and exit:
//home/pi/startup.sh start
● Of course, you can also replace the above script file path with other scripts you want to run
automatically.
7.2 Change The Program That Starts Automatically
●After step 7.1, you can already set the program to run automatically at boot. If you want to change the
program to run automatically at boot, just edit startup.sh:
sudo nano //home/pi/startup.sh
maketecheasier
the article link
itechfythe
document Auto-Run.
Understanding File
Need help?
Do you have a question about the AWR Adeept Wheeled Robot and is the answer not in the manual?