Categories
Stuff

Raspberry Pi Setup

A few notes on how I set up new raspi systems, of which I am using quite a few for random home automation or toy things.

This is for the old version based on Debian Buster. For Debian Bullseye based OS just use the ‘advanced’ menu in the imager tool.

Prepping the SD card

  • Install “Lite” version of Raspberry Pi OS
  • This should have created one FAT formatted partition that Windows/Mac can access, this is the boot partition
  • Create file “ssh.txt” on boot partition to enable ssh right away, otherwise need to attach a screen for first login
  • If newer raspi and wifi should be used, create file “wpa_supplicant.conf” on boot partition (docs)
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>"
}

Initial Setup

  • Startup raspi, find IP in DHCP server or try direct ssh to host “raspberrypi” and cross fingers that something somewhere worked right (I think Unifi DHCP server automatically using DHCP provided hostname for DNS? Or is this some MDNS magic? No idea, never looked into it.)
  • Log in with username “pi”, default password “raspberry”
  • sudo raspi-config
    • set system-> hostname
    • set localization -> timezone
    • exit without reboot, it’s not necessary now
  • sudo su -
    • adduser kapet
    • adduser kapet adm
    • adduser kapet sudo
      • and more groups as necessary: dialout, cdrom, audio, video, plugdev, games, input, netdev, spi, i2c, gpio
    • Copy /etc/sudoers.d/010_pi-nopasswd for kapet and update it accordingly
    • reboot
  • Log in as “kapet”
  • sudo su -
    • disable login to the pi account: usermod -e1 -L pi
    • enable longrunning and at-boot started scripts for kapet: loginctl enable-linger kapet
    • apt update
    • apt dist-upgrade
    • apt install lsof tcpdump vim-nox
    • set the NTP server in /etc/systemd/timesyncd.conf
    • reboot

Other Potential Setup

  • set up basic X11: apt install raspberrypi-ui-mods
  • disable bluetooth on pi3: add dtoverlay=pi3-disable-bt to /boot/config.txt
  • when using any GPU to framebuffer magic like raspi2fb for a local LCD display remember to give the GPU enough memory through raspi-config, the minimum amount is not sufficient
  • setup Watterott display: docs