Archived
1.4 KiB
1.4 KiB
Headless_Pi
How to setup a Raspberry Pi headless.
Get an Image
Download the Lite Image from here: https://www.raspberrypi.org/software/operating-systems/ and flash it with the tool from here: https://www.balena.io/etcher/
Changes on boot
- Add an empty file named ssh on boot partition to enable ssh
- Add a new file named wpa_supplicant.conf on boot partition to enable WiFi on boot. Use attached wpa_supplicant.conf as example.
Fire up
- Inserd SD-card in your raspi and power it up. Wait afew minutes to let it boot up.
- you can get the IP of your raspi by looking at your dhcp-server or your wlan-router
- login via ssh on your raspberry pi with the user pi and raspberry as password
- open up
sudo raspi-configand change your pi password! - expand filesystem to get the most of your SD-card space
prepair anything else
- create a ssh key with
ssh-keygenfor user pi - go to admcenter and
ssh-copy-id pi@<your-pi-ip>and login with your new pi password - initiate the new system with ansible
ansible-playbook -i <your-pi-ip>, -u pi /etc/ansible/playbooks/init.yml
python3 installation
- install python3 with
sudo apt install python3 python3-dev - generate alternatives:
update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2 # on debian buster default python3 is 3.7update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 # old python version
- install pip3 with
sudo apt install python3-pip