-
Download imager from https://www.raspberrypi.org/downloads/ /
sudo apt install rpi-imager -y -
Install Raspbian lite on the SD. For newer >Bookworm click on the gear and setup WiFi and ssh from the imager. Bookworm doesn't use wpa_supplicant.conf
I had issues. So i connected via WiFi, enabled wifi with sudo raspi-config. Then generated a pair key, copied to the client, set 600 for key and 644 for pub and was able to passwordless ssh via wifi.
To manage static IP and DNS:
sudo nmcli c mod telenet-81BD3_EXT ipv4.addresses 192.168.0.3/24 ipv4.method manual
sudo nmcli con mod telenet-81BD3_EXT ipv4.dns "8.8.8.8 1.1.1.1"
Before Bookworm: 3. Add a wpa_supplicant.conf file to the boot partition. Set the return line to LF for unix systems. See: https://www.raspberrypi.org/documentation/configuration/wireless/headless.md Example:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert 2 letter ISO 3166-1 country code here>
network={
ssid="<Name of your wireless LAN>"
psk="<Password for your wireless LAN>"
}
- Enable SSH
See: https://www.raspberrypi.org/documentation/remote-access/ssh/README.md
Add an empty
sshfile to the boot partition with no extension.
- Boot the pi with the sd card.
- Find the pi address with an app like Fing on your smartphone
ssh pi@192.168.0.144- Default password is
raspberry. After logging in, change it usingpasswd. - Buster comes with Python 3.7, you can change the default
pythonsymbolic link to usepython3instead ofpython2.
sudo unlink /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo visudo
add
%sudo ALL = (ALL) NOPASSWD:ALL
sudo apt update && sudo apt -y upgrade
Follow https://github.com/dzanaga/jns
sudo nano /etc/dhcpcd.conf
add:
interface wlan0
static ip_address=192.168.0.2/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8 8.8.4.4
On the client, generate a key pair with ssh-keygen.
The create an entry for the pi in the ssh config .ssh/config:
Host pi
HostName 192.168.0.2
User pi
Port 22
IdentityFile /home/daniele/.ssh/id_rsa
Host piTunnels
HostName 192.168.0.2
User pi
Port 22
LocalForward 18888 localhost:8888
IdentityFile /home/daniele/.ssh/id_rsa
ServerAliveInterval 30
ServerAliveCountMax 3
Finally add the public key to the authorized keys:
cat .ssh/id_rsa.pub | ssh pi 'cat >> .ssh/authorized_keys'
Install autossh on your client:
sudo apt-get install -y autossh
Run:
autossh -M 0 -f -T -N piTunnels
In the boot partition set:
-
octopi-wpa-supplicant.txt: -
octopi.txt:
camera="raspi"
camera_raspi_options="-x 1280 -y 720 -fps 5 -quality 100 -rot 180"