How Many Usb Cameras Can I Connect To Raspberry Pi
Using Linux
Concluding
The terminal (or 'command-line') on a computer allows a user a peachy deal of control over their organization. Users of Windows may already take come across Command Prompt
or Powershell
, while mac Os users may exist familiar with Final
. All of these tools allow a user to directly dispense their system through the use of commands. These commands tin be chained together and/or combined together into complex scripts that can potentially complete tasks more efficiently than much larger traditional software packages.
Opening a Terminal window
On the Raspberry Pi OS, the default final application is called LXTerminal
. This is known equally a 'final emulator', this means that it emulates the old manner video terminals — from before Windowing systems were developed — inside a graphical environs. The awarding can exist establish on the Raspberry Pi desktop, and when started will look something like this:
In the terminal window you should be able to encounter the following prompt:
This shows your username and the hostname of the Raspberry Pi. Here the username is pi
and the hostname is raspberrypi
.
Navigating and browsing your Raspberry Pi
One of the central aspects of using a terminal is being able to navigate your file system. Go ahead and blazon ls -la
into the Terminal window, and then hit the Render key. Yous should see something like to:
The ls
command lists the contents of the directory that you are currently in (your present working directory). The -la
component of the control is what's known as a 'flag'. Flags change the command that'south being run. In this instance the l
displays the contents of the directory in a list, showing data such as their sizes and when they were last edited, and the a
displays all files, including those beginning with a .
, known every bit 'dotfiles'. Dotfiles normally act as configuration files for software and as they are written in text, they can be modified by simply editing them.
In club to navigate to other directories the change directory control, cd
, can be used. Yous can specify the directory that you lot want to go to by either the 'absolute' or the 'relative' path. So if you wanted to navigate to the python_games
directory, you could either practise cd /dwelling/pi/python_games
or just cd python_games
(if you lot are currently in /home/pi
). At that place are some special cases that may exist useful: ~
acts every bit an alias for your domicile directory, so ~/python_games
is the aforementioned as /habitation/pi/python_games
; .
and ..
are aliases for the current directory and the parent directory respectively, e.g. if y'all were in /abode/pi/python_games
, cd ..
would accept you to /habitation/pi
.
History and car-consummate
Rather than type every command, the terminal allows you to coil through previous commands that you've run past pressing the upwards
or downward
keys on your keyboard. If you are writing the proper noun of a file or directory as part of a control then pressing tab
will attempt to automobile-complete the name of what y'all are typing. For example, if you take a file in a directory called aLongFileName
and then pressing tab after typing a
will allow yous to choose from all file and directory names outset with a
in the current directory, assuasive you lot to choose aLongFileName
.
The sudo
control
Some commands that brand permanent changes to the state of your system require you to have root privileges to run. The control sudo
temporarily gives your account (if you're not already logged in every bit root) the ability to run these commands, provided your user proper name is in a list of users ('sudoers'). When y'all append sudo
to the start of a command and printing enter
, the command post-obit sudo
will be run using root privileges. Be very conscientious: commands requiring root privileges tin irreparably damage your arrangement! Note that on some systems you will be prompted to enter your password when you run a command with sudo
.
Further information on sudo
and the root user tin be establish on the linux root page.
Installing software using apt
You can utilise the apt
command to install software in Raspberry Pi Bone. This is the 'package manager' that is included with any Debian-based Linux distributions, including Raspberry Pi OS. It allows you to install and manage new software packages on your Raspberry Pi.
In order to install a new parcel, you would type sudo apt install <packet-name>
, where <package-name>
is the package that you desire to install.
Running sudo apt update
will update a list of software packages that are bachelor on your system. If a new version of a parcel is available, then sudo apt full-upgrade
volition update any old packages to the new version.
Finally, sudo apt remove <package-name>
removes or uninstalls a package from your organisation.
Other useful commands
There are a few other commands that you may find useful, these are listed below:
-
cp
makes a copy of a file and places it at the specified location (essentially doing a 're-create-paste'), for example -cp file_a /home/other_user/
would copy the filefile_a
from your habitation directory to that of the userother_user
(assuming you take permission to re-create it there). Note that if the target is a binder, the filename will remain the aforementioned, but if the target is a filename, information technology volition requite the file the new proper noun. -
mv
moves a file and places information technology at the specified location (and then wherecp
performs a 're-create-paste',mv
performs a 'cutting-paste'). The usage is similar tocp
, and thenmv file_a /home/other_user/
would motility the filefile_a
from your habitation directory to that of the specified user.mv
is also used to rename a file, i.east. movement it to a new location, e.g.mv hullo.txt story.txt
. -
rm
removes the specified file (or directory when used with-r
). Warning: Files deleted in this way are mostly non restorable. -
mkdir
: This makes a new directory, e.g.mkdir new_dir
would create the directorynew_dir
in the present working directory. -
cat
lists the contents of files, e.g.true cat some_file
will display the contents ofsome_file
.
Other commands you lot may discover useful can be found in the commands page.
Finding out most a command
To find out more than information nigh a particular command and then you can run the man
followed past the command you desire to know more about (east.g. human being ls
). The man-page (or manual page) for that command will exist displayed, including data almost the flags for that program and what effect they have. Some human-pages will give example usage.
The Linux File System
Information technology is important to have a basic understanding of the fundamentals of the Linux file system: where your files are kept, where software is installed, where the danger zones are, and then on. For more information, delight refer to the Linux Filesystem Hierarchy Standard.
Home
When you log into a Raspberry Pi and open up a terminal window, or you lot boot to the control line instead of the graphical user interface, you lot start in your domicile folder; this is located at /dwelling house/pi
, assuming your username is pi
.
This is where the user's ain files are kept. The contents of the user's desktop is in a directory here chosen Desktop
, along with other files and folders.
To navigate to your home folder on the command line, simply blazon cd
and printing Enter
. This is the equivalent of typing cd /home/pi
, where pi
is your username. Yous can as well apply the tilde key (~
), for example cd ~
, which can be used to relatively link back to your home folder. For instance, cd ~/Desktop/
is the same as cd /home/pi/Desktop
.
Navigate to /abode/
and run ls
, and you lot'll see the home folders of each of the users on the system.
Annotation that if logged in equally the root user, typing cd
or cd ~
will have you to the root user's home directory; unlike normal users, this is located at /root/
non /home/root/
.
Linux Commands
Here are some fundamental and mutual Linux commands with example usage:
Filesystem
ls
The ls
control lists the content of the current directory (or ane that is specified). Information technology tin be used with the -fifty
flag to display additional information (permissions, owner, grouping, size, engagement and timestamp of concluding edit) near each file and directory in a list format. The -a
flag allows yous to view files beginning with .
(i.e. dotfiles).
cd
Using cd
changes the current directory to the ane specified. Y'all can use relative (i.east. cd directoryA
) or absolute (i.e. cd /abode/pi/directoryA
) paths.
pwd
The pwd
command displays the proper noun of the present working directory: on a Raspberry Pi, inbound pwd
volition output something like /home/pi
.
mkdir
Y'all can use mkdir
to create a new directory, east.grand. mkdir newDir
would create the directory newDir
in the present working directory.
rmdir
To remove empty directories, utilise rmdir
. So, for example, rmdir oldDir
volition remove the directory oldDir
simply if it is empty.
rm
The command rm
removes the specified file (or recursively from a directory when used with -r
). Be careful with this control: files deleted in this mode are mostly gone for expert!
cp
Using cp
makes a copy of a file and places it at the specified location (this is similar to copying and pasting). For example, cp ~/fileA /home/otherUser/
would copy the file fileA
from your home directory to that of the user otherUser
(bold y'all accept permission to copy it there). This command can either take FILE FILE
(cp fileA fileB
), FILE DIR
(cp fileA /directoryB/
) or -r DIR DIR
(which recursively copies the contents of directories) as arguments.
mv
The mv
control moves a file and places it at the specified location (so where cp
performs a 'copy-paste', mv
performs a 'cutting-paste'). The usage is similar to cp
. And so mv ~/fileA /home/otherUser/
would motion the file fileA
from your domicile directory to that of the user otherUser. This command can either have FILE FILE
(mv fileA fileB
), FILE DIR
(mv fileA /directoryB/
) or DIR DIR
(mv /directoryB /directoryC
) as arguments. This control is too useful as a method to rename files and directories subsequently they've been created.
touch
The control impact
sets the last modified time-stamp of the specified file(south) or creates it if information technology does not already exist.
cat
You lot can utilise true cat
to listing the contents of file(due south), due east.g. cat thisFile
will display the contents of thisFile
. Can exist used to list the contents of multiple files, i.due east. cat *.txt
volition listing the contents of all .txt
files in the current directory.
head
The head
command displays the offset of a file. Can be used with -n
to specify the number of lines to show (by default ten), or with -c
to specify the number of bytes.
tail
The contrary of head
, tail
displays the end of a file. The starting point in the file can be specified either through -b
for 512 byte blocks, -c
for bytes, or -due north
for number of lines.
chmod
You lot would ordinarily utilise chmod
to change the permissions for a file. The chmod
control can use symbols u
(user that owns the file), g
(the files group) , and o
(other users) and the permissions r
(read), w
(write), and x
(execute). Using chmod u+x filename
will add execute permission for the owner of the file.
chown
The chown
command changes the user and/or group that owns a file. It commonly needs to be run every bit root using sudo due east.grand. sudo chown pi:root filename
will modify the owner to pi and the group to root.
ssh
ssh
denotes the secure shell. Connect to another computer using an encrypted network connection. For more than details see SSH (secure beat)
scp
The scp
control copies a file from ane computer to another using ssh
. For more details see SCP (secure copy)
sudo
The sudo
command enables you to run a command equally a superuser, or some other user. Employ sudo -s
for a superuser shell. For more details see Root user / sudo
dd
The dd
control copies a file converting the file as specified. It is often used to re-create an unabridged disk to a single file or back over again. So, for instance, dd if=/dev/sdd of=backup.img
will create a fill-in image from an SD card or USB disk drive at /dev/sdd. Brand certain to employ the correct drive when copying an prototype to the SD card as it tin can overwrite the entire disk.
df
Utilize df
to display the disk space available and used on the mounted filesystems. Use df -h
to meet the output in a human-readable format using Chiliad for MBs rather than showing number of bytes.
unzip
The unzip
command extracts the files from a compressed zero file.
tar
Use tar
to store or extract files from a record archive file. It can too reduce the infinite required by compressing the file similar to a nothing file.
To create a compressed file, use tar -cvzf filename.tar.gz directory/
To extract the contents of a file, use tar -xvzf filename.tar.gz
pipes
A piping allows the output from one control to be used as the input for another control. The pipe symbol is a vertical line |
. For example, to only show the first 10 entries of the ls
command information technology can be piped through the caput control ls | caput
tree
Use the tree
command to show a directory and all subdirectories and files indented as a tree structure.
&
Run a command in the background with &
, freeing up the shell for future commands.
wget
Download a file from the web directly to the figurer with wget
. So wget https://datasheets.raspberrypi.com/rpi4/raspberry-pi-iv-datasheet.pdf
volition download the Raspberry Pi 4 datasheet and salvage it every bit raspberry-pi-four-datasheet.pdf
.
curl
Use curl
to download or upload a file to/from a server. By default, it volition output the file contents of the file to the screen.
man
Testify the manual page for a file with man
. To find out more, run man human
to view the manual page of the human control.
Search
grep
Apply grep
to search inside files for sure search patterns. For example, grep "search" *.txt
volition look in all the files in the electric current directory catastrophe with .txt for the string search.
The grep
command supports regular expressions which allows special letter combinations to exist included in the search.
awk
awk
is a programming language useful for searching and manipulating text files.
find
The find
control searches a directory and subdirectories for files matching certain patterns.
whereis
Use whereis
to find the location of a command. Information technology looks through standard program locations until it finds the requested command.
Networking
ping
The ping
utility is commonly used to check if communication can exist made with another host. It can be used with default settings by just specifying a hostname (e.g. ping raspberrypi.com
) or an IP accost (east.g. ping 8.8.viii.8
). It can specify the number of packets to send with the -c
flag.
nmap
nmap
is a network exploration and scanning tool. Information technology can return port and OS data about a host or a range of hosts. Running just nmap
will display the options available also as example usage.
hostname
The hostname
control displays the current hostname of the system. A privileged (super) user tin set the hostname to a new one past supplying information technology every bit an argument (e.g. hostname new-host
).
ifconfig
Use ifconfig
to display the network configuration details for the interfaces on the electric current organization when run without any arguments (i.eastward. ifconfig
). By supplying the control with the name of an interface (e.g. eth0
or lo
) you can and then alter the configuration: cheque the manual page for more than details.
Text Editors
On Linux, y'all take a choice of text editors. Some are easy-to-employ just take limited functionality; others require grooming to use and have a long time to master, only offer incredible functionality.
Text Editors on Desktop
Text Editor
When using Raspberry Pi OS with desktop, in the accessories menu there is an option to run a Text Editor. This is a simple editor which opens in a window like a normal awarding. It allows use of the mouse and keyboard, and has tabs and syntax highlighting.
You can use keyboard shortcuts, such as Ctrl + S
to save a file and Ctrl + X
to get out.
Thonny
Thonny is a Python REPL and IDE, so you can write and edit Python code in a window and run information technology straight from the editor. Thonny has independent windows, and syntax highlighting, and uses Python iii.
Geany
A fast and lightweight IDE, supporting many different file types, including C/C++ and Python. It is installed past default on Raspberry Pi Bone.
Text Editors in the Terminal
Nano
GNU Nano is at the like shooting fish in a barrel-to-use cease of command-line editors. It's installed by default, so use nano somefile.txt
to edit a file, and keyboard shortcuts like Ctrl + O
to save and Ctrl + X
to exit.
Half dozen
Vi is a very old (c. 1976) control-line editor, which is available on nearly UNIX systems and is pre-installed on Raspberry Pi OS. Information technology's succeeded by Vim (Vi Improved), which requires installation.
Different most editors, Six and Vim accept a number of different modes. When you open 6 with vi somefile.txt
, you start in command mode which doesn't directly permit text entry. Press i
to switch to insert mode in order to edit the file, and type away. To save the file you must return to command mode, so press the Escape
key and enter :w
(followed by Enter
), which is the command to write the file to disk.
To search for the give-and-take 'raspberry' in a file, brand sure yous're in command style (printing Escape
), so type /raspberry
followed by northward
and N
to flick forwards/backwards through the results.
To save and exit, enter the command :wq
. To exit without saving, enter the command :q!
.
Depending on your keyboard configuration, you may find your cursor keys don't work. In this case, yous tin can use the H-J-K-L keys (which move left, down, up, and correct respectively) to navigate the file in control mode.
Vim
Vim is an extension of Vi and works in much the same way, with a number of improvements. Just Vi is installed by default and so to get the full features of Vim, install it with APT:
You can edit a file in Vim with vim somefile.txt
.
Emacs
Emacs is a GNU control-line text editor; it's powerful, extensible, and customisable. You lot can install it with APT:
You tin can use keyboard combination commands, such every bit Ctrl + Ten Ctrl + S
to salve and Ctrl + X Ctrl + C
to close.
Linux Users
User direction in Raspberry Pi Os is washed on the command line. The default user is pi
, and the countersign is raspberry
. You tin can add users and change each user's password.
Changing your Password
In one case yous're logged in as the pi
user, it is highly advisable to utilize the passwd
command to alter the default password to amend your Raspberry Pi's security.
Enter passwd
on the command line and press Enter
. You lot'll be prompted to enter your current password to authenticate, so asked for a new password. Press Enter
on completion and y'all'll be asked to confirm it. Note that no characters will exist displayed while entering your password. Once you've correctly confirmed your password, you lot'll exist shown a success bulletin (passwd: countersign updated successfully
), and the new password will apply immediately.
If your user has sudo
permissions, you can change another user'due south password with passwd
followed by the user'southward username. For example, sudo passwd bob
will allow you to set the user bob
's countersign, and then some additional optional values for the user such as their name. Just press Enter
to skip each of these options.
Remove a User'due south Countersign
Yous can remove the password for the user bob
with sudo passwd bob -d
. Without a countersign the user will non exist able to login to a Terminal.
Note | This is useful for users that need to exist for system reasons, but y'all don't desire information technology to be possible to login to the account for security reasons. |
Creating a New User
Yous can create additional users on your Raspberry Pi Bone installation with the adduser
command.
Enter sudo adduser bob
and you'll be prompted for a password for the new user bob
. Leave this blank if you don't want a password.
Your Dwelling Folder
When you lot create a new user, they will have a home folder in /home/
. The pi
user'due south home folder is at /habitation/pi/
.
The skel
Command
Upon creating a new user, the contents of /etc/skel/
will be copied to the new user'due south dwelling binder. You lot tin can add together or modify dot-files such as the .bashrc
in /etc/skel/
to your requirements, and this version will be applied to new users.
Deleting a User
You can delete a user on your system with the command userdel
. Apply the -r
flag to remove their home folder too:
Root and Sudo
The Linux operating system is a multi-user operating organization which allows multiple users to log in and utilize the computer. To protect the computer (and the privacy of other users), the users' abilities are restricted.
Most users are immune to run most programs, and to save and edit files stored in their own domicile folder. Normal users are not normally immune to edit files in other users' folders or any of the organisation files. In that location's a special user in Linux known as the superuser, which is normally given the username root
. The superuser has unrestricted access to the computer and can do almost anything.
The sudo
Command
Yous won't normally log into the computer equally root
, but y'all can use the sudo
command to provide access as the superuser. If y'all log into your Raspberry Pi as the pi
user, then yous're logging in equally a normal user. Yous tin run commands as the root
user by using the sudo
control before the program you want to run.
For case, if yous want to install additional software on Raspberry Pi OS and then you normally use the apt
tool. To update the list of available software, you demand to prefix the apt
control with sudo:
sudo apt update
Y'all can also run a superuser shell past using sudo su
. When running commands as a superuser there'south nothing to protect against mistakes that could damage the organisation. It'due south recommended that you only run commands equally the superuser when required, and to exit a superuser shell when it's no longer needed.
The Sudo'ers List
The default pi
user on Raspberry Pi Bone is a member of the sudo
group. This gives the ability to run commands as root when preceded by sudo
, and to switch to the root user with sudo su
.
To add a new user to the sudo
group, use the adduser
command:
Annotation that the user bob
will be prompted to enter their password when they run sudo
. This differs from the behaviour of the pi
user, since pi
is non prompted for their password. If you lot wish to remove the countersign prompt from the new user, create a custom sudoers file and place information technology in the /etc/sudoers.d
directory.
-
Create the file using
sudo visudo /etc/sudoers.d/010_bob-nopasswd
. -
Insert the following contents on a single line:
bob ALL=(ALL) NOPASSWD: ALL
-
Relieve the file and exit.
In one case you have exited the editor, the file volition be checked for any syntax errors. If no errors were detected, the file will be saved and you volition be returned to the shell prompt. If errors were detected, yous will be asked 'what now?' Press the 'enter' key on your keyboard: this will bring upwardly a list of options. You volition probably want to apply 'eastward' for '(e)dit sudoers file again', so yous can edit the file and set the trouble.
Note | Choosing option 'Q' volition save the file with any syntax errors nevertheless in identify, which makes it impossible for any user to utilise the sudo command. |
Note | Information technology is standard practice on Linux to have the user prompted for their password when they run sudo , since it makes the arrangement slightly more secure. |
The `.bashrc ` File
In your home folder you will notice a subconscious file chosen .bashrc
which contains some user configuration options. Yous can edit this file to suit your needs. Changes made in this file will be actioned the next time a last is opened, since that is when the .bashrc
file is read.
If you desire your changes to have place in your current terminal, y'all can employ either source ~/.bashrc
or exec bash
. These really exercise slightly different things: the onetime simply re-executes the .bashrc
file, which may result in undesirable changes to things similar the path, the latter replaces the electric current beat with a new bash shell, which resets the shell back to the state at login, throwing away any shell variables you lot may have prepare. Cull whichever is most appropriate.
Some useful adaptions are provided for you lot; some of these are commented out with a
past default. To enable them, remove the and they will exist active next time y'all kick your Raspberry Pi or start a new final.
For example, some ls
aliases:
alias ls='ls --color=machine' #alias dir='dir --color=auto' #alias vdir='vdir --color=motorcar' allonym grep='grep --colour=auto' allonym fgrep='fgrep --color=auto' alias egrep='egrep --colour=auto'
Aliases similar these are provided to help users of other systems similar Microsoft Windows (dir
is the ls
of DOS/Windows). Others are to add together colour to the output of commands like ls
and grep
by default.
More variations of ls
are also provided:
# some more than ls aliases #alias ll='ls -l' #allonym la='ls -A' #alias fifty='ls -CF'
Ubuntu users may be familiar with these every bit they are provided past default on that distribution. Uncomment these lines to have access to these aliases in futurity.
The .bash_aliases
File
.bashrc
also contains a reference to a .bash_aliases
file, which does non exist past default. You lot can add it to provide a handy way of keeping all your aliases in a dissever file.
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
The if
statement here checks the file exists before including information technology.
So you just create the file .bash_aliases
and add more aliases similar and then:
You can add together other things directly to this file, or to another and include that file like the .bash_aliases
example to a higher place.
Trounce Scripts
Commands can exist combined together in a file which can and then be executed. Equally an example, copy the post-obit into your favourite text editor:
#!/usr/bin/bash while : do echo Raspberry Pi! done
Save this with the name fun-script
.
Earlier you can run information technology you lot must first arrive executable; this can exist done by using the change manner command chmod
. Each file and directory has its own set of permissions that dictate what a user can and can't exercise to it. In this case, by running the command chmod +x fun-script
, the file fun-script
volition now be executable.
Y'all can then run it by typing ./fun-script
(assuming that it's in your current directory).
This script infinitely loops and prints Raspberry Pi!
; to stop it, press Ctrl + C
. This kills any command that'due south currently being run in the last.
Scheduling Tasks with Cron
Cron is a tool for configuring scheduled tasks on Unix systems. It is used to schedule commands or scripts to run periodically and at stock-still intervals. Tasks range from backing up the user's home folders every day at midnight, to logging CPU data every hour.
The command crontab
(cron table) is used to edit the list of scheduled tasks in operation, and is done on a per-user ground; each user (including root
) has their own crontab
.
Editing the crontab
File
Run crontab
with the -east
flag to edit the cron tabular array:
Note | The kickoff fourth dimension you run crontab you'll be prompted to select an editor; if you are not sure which one to employ, choose nano by pressing Enter . |
Calculation a Scheduled Task
The layout for a cron entry is made upward of six components: minute, 60 minutes, twenty-four hour period of month, month of yr, day of week, and the command to be executed.
# m h dom monday dow command
# * * * * * command to execute # ┬ ┬ ┬ ┬ ┬ # │ │ │ │ │ # │ │ │ │ │ # │ │ │ │ └───── day of calendar week (0 - 7) (0 to 6 are Sunday to Sabbatum, or use names; 7 is Sun, the same every bit 0) # │ │ │ └────────── month (one - 12) # │ │ └─────────────── day of month (one - 31) # │ └──────────────────── hour (0 - 23) # └───────────────────────── min (0 - 59)
For case:
0 0 * * * /home/pi/backup.sh
This cron entry would run the backup.sh
script every twenty-four hour period at midnight.
Viewing Scheduled Tasks
View your currently saved scheduled tasks with:
Erase scheduled tasks
Delete all currently scheduled tasks:
Running a Task on Reboot
To run a control every time the Raspberry Pi starts upwardly, write @reboot
instead of the time and date. For case:
@reboot python /home/pi/myscript.py
This will run your Python script every time the Raspberry Pi reboots. If you want your command to exist run in the background while the Raspberry Pi continues starting up, add a space and &
at the cease of the line, similar this:
@reboot python /home/pi/myscript.py &
The systemd
Daemon
In order to have a command or programme run when the Raspberry Pi boots, you tin add together information technology as a service. In one case this is done, you can start/terminate enable/disable from the linux prompt.
Creating a Service
On your Raspberry Pi, create a .service
file for your service, for example: myscript.service
[Unit of measurement] Description=My service After=network.target [Service] ExecStart=/usr/bin/python3 -u main.py WorkingDirectory=/home/pi/myscript StandardOutput=inherit StandardError=inherit Restart=ever User=pi [Install] WantedBy=multi-user.target
So in this case, the service would run Python 3 from our working directory /dwelling/pi/myscript
which contains our python program to run principal.py
. Only yous are not limited to Python programs: simply change the ExecStart
line to be the control to starting time any program or script that you lot want running from booting.
Copy this file into /etc/systemd/system
every bit root, for instance:
sudo cp myscript.service /etc/systemd/system/myscript.service
Once this has been copied, you accept to inform systemd
that a new service has been added. This is washed with the following command:
sudo systemctl daemon-reload
Now y'all tin attempt to start the service using the following control:
sudo systemctl start myscript.service
Stop it using post-obit command:
sudo systemctl stop myscript.service
When you are happy that this starts and stops your app, y'all can have it showtime automatically on reboot by using this control:
sudo systemctl enable myscript.service
The systemctl
command can also be used to restart the service or disable information technology from boot upwardly.
Note | The order in which things are started is based on their dependencies — this particular script should start fairly late in the boot process, after a network is available (see the After section). You tin configure unlike dependencies and orders based on your requirements. |
Source: https://www.raspberrypi.com/documentation/computers/using_linux.html
Posted by: smithsuffee.blogspot.com
0 Response to "How Many Usb Cameras Can I Connect To Raspberry Pi"
Post a Comment