rocnet:headless-cam-en
Differences
This shows you the differences between two versions of the page.
— | rocnet:headless-cam-en [2022/06/17 09:42] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Headless Setup====== | ||
+ | [[: | ||
+ | [[: | ||
+ | * **[[: | ||
+ | * [[: | ||
+ | |||
+ | |< >| | ||
+ | ^ [[https:// | ||
+ | \\ | ||
+ | \\ | ||
+ | =====SD Card with Pi OS Lite (32bit)===== | ||
+ | Download the Raspberry Pi Imager: | ||
+ | * __**[[https:// | ||
+ | {{: | ||
+ | |||
+ | Insert a SD-Card.\\ | ||
+ | Start the " | ||
+ | |||
+ | Select: | ||
+ | - CHOOSE OS | ||
+ | - Pi OS Other | ||
+ | - Pi OS Lite (32bit) | ||
+ | |||
+ | See also __**[[: | ||
+ | |||
+ | \\ | ||
+ | =====Config the Boot Partition===== | ||
+ | Insert the SD-Card again, after creating of the Image on the SD-Card has finished.\\ | ||
+ | The SD-Card should be visible in the File-Explorer as '' | ||
+ | \\ | ||
+ | To make the Zero able to connect to the WiFi, it must get some settings to get this done.\\ | ||
+ | The easiest way is to create a text file locally named as '' | ||
+ | < | ||
+ | country=DE | ||
+ | ctrl_interface=DIR=/ | ||
+ | update_config=1 | ||
+ | network={ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | network={ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | Replace the "< | ||
+ | * **Note:** //Multiple network definitions may be added. The highest priority will be connected first if available.// | ||
+ | Copy an empty file named '' | ||
+ | |||
+ | to the boot partition of the SD-Card:\\ | ||
+ | {{: | ||
+ | |||
+ | - Unmount/ | ||
+ | - Insert the SD-Card into the slot on the Raspberry Pi. | ||
+ | - Power on the Raspberry Pi. | ||
+ | - Wait a few minutes to give Raspbian time to resize the file system. (With a connected monitor, on the Mini-HDMI, the progress can be watched.) | ||
+ | |||
+ | \\ | ||
+ | =====Raspbian SSH Connect===== | ||
+ | < | ||
+ | ssh pi@raspberrypi | ||
+ | </ | ||
+ | The standard password is '' | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Raspbian Update===== | ||
+ | < | ||
+ | sudo apt update | ||
+ | sudo apt upgrade | ||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Raspi-Config===== | ||
+ | < | ||
+ | ssh pi@raspberrypi | ||
+ | sudo raspi-config | ||
+ | </ | ||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Python Script===== | ||
+ | Unzip the {{: | ||
+ | < | ||
+ | scp cam.py pi@raspberrypi:/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Install PiCamera===== | ||
+ | < | ||
+ | ssh pi@raspberrypi | ||
+ | sudo apt install python3-picamera | ||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Start Script===== | ||
+ | < | ||
+ | ssh pi@raspberrypi | ||
+ | nano startcam.sh | ||
+ | </ | ||
+ | Create the script "/ | ||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | cd /home/pi | ||
+ | python3 cam.py | ||
+ | </ | ||
+ | Make the script executable: | ||
+ | < | ||
+ | chmod +x startcam.sh | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | =====Crontab===== | ||
+ | Add the line " | ||
+ | < | ||
+ | ssh pi@raspberrypi | ||
+ | crontab -e | ||
+ | |||
+ | no crontab for pi - using an empty one | ||
+ | |||
+ | Select an editor. | ||
+ | 1. / | ||
+ | 2. / | ||
+ | 3. /bin/ed | ||
+ | |||
+ | Choose 1-3 [1]: | ||
+ | </ | ||
+ | Close the nano editor with ctrl+x After edit to save the changes.\\ | ||
+ | |||
+ | Check if the changes are saved: | ||
+ | < | ||
+ | crontab -l | ||
+ | # Edit this file to introduce tasks to be run by cron. | ||
+ | # | ||
+ | # Each task to run has to be defined through a single line | ||
+ | # indicating with different fields when the task will be run | ||
+ | # and what command to run for the task | ||
+ | # | ||
+ | # To define the time you can provide concrete values for | ||
+ | # minute (m), hour (h), day of month (dom), month (mon), | ||
+ | # and day of week (dow) or use ' | ||
+ | # | ||
+ | # Notice that tasks will be started based on the cron's system | ||
+ | # daemon' | ||
+ | # | ||
+ | # Output of the crontab jobs (including errors) is sent through | ||
+ | # email to the user the crontab file belongs to (unless redirected). | ||
+ | # | ||
+ | # For example, you can run a backup of all your user accounts | ||
+ | # at 5 a.m every week with: | ||
+ | # 0 5 * * 1 tar -zcf / | ||
+ | # | ||
+ | # For more information see the manual pages of crontab(5) and cron(8) | ||
+ | # | ||
+ | # m h dom mon dow | ||
+ | @reboot / | ||
+ | </ | ||
+ | |||
+ | Reboot the Raspberry Pi: | ||
+ | < | ||
+ | sudo reboot | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | =====Boot speed===== | ||
+ | Check the services which are not needed for the headless setup: | ||
+ | < | ||
+ | systemd-analyze blame | ||
+ | </ | ||
+ | Google " | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Power consumption===== | ||
+ | ====HDMI==== | ||
+ | Running a headless Zero, there' | ||
+ | Add the following line in ''/ | ||
+ | < | ||
+ | (-p to re-enable).\\ | ||
+ | Approximately 25mA reduction.\\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Special Boot Options===== | ||
+ | To be able to use pin 27 and 28 as normal I/O, add an extra line in the / | ||
+ | < | ||
+ | force_eeprom_read=0 | ||
+ | </ | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Notes===== | ||
+ | ====SFTP File Transfer==== | ||
+ | WinSCP and FileZilla can be used for transferring files to and from the Raspberry Pi.\\ | ||
+ | For more information see: | ||
+ | * https:// | ||
+ | |||
+ | |||
+ | ====SSH==== | ||
+ | * The terminal/ | ||
+ | * If " | ||
+ | |||
+ | ====Wait for Network at Boot==== | ||
+ | Under specific network conditions, the following system option (sudo raspi-conf) must be activated, if the WIOpi or CAM does not start at boot: | ||
+ | * **1** System Options | ||
+ | * **S6** Network at Boot ((Select wait for network connection on boot)) | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | ====Disable screen saver==== | ||
+ | In case of a connected display, none headless, without user interaction.\\ | ||
+ | |||
+ | Edit the lightdm configuration: | ||
+ | < | ||
+ | find this section, and add the extra options: | ||
+ | < | ||
+ | [Seat:*] | ||
+ | xserver-command=X -s 0 -dpms | ||
+ | </ |
rocnet/headless-cam-en.txt · Last modified: 2022/06/17 09:42 by 127.0.0.1