Raspberry Pi#

ssh#

Default user/pass: pi/raspberry

sudo systemctl enable --now ssh

locale#

https://blag.felixhummel.de/admin/debian.html#debian-locale

hostname#

https://blag.felixhummel.de/admin/debian.html#hostname

user, ssh, sudo, updates, configs#

add user

sudo -i
addgroup --gid 1337 felix
adduser --uid 1337 --gecos '' --gid 1337 felix
# set password

for g in adm dialout cdrom sudo audio video plugdev games users input netdev spi i2c gpio; do adduser felix $g; done

echo 'felix ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/020_felix-nopasswd

ssh key

sudo -iu felix
# follow the next link

https://blag.felixhummel.de/apps/ssh.html#authorized-keys

test on workstation

ssh pi1
sudo id

# kill "pi" user
sudo deluser pi

updates#

sudo apt-get update
sudo apt-get upgrade
sudo reboot  # initramfs, kernel or rpi-eeprom

wifi#

sudo raspi-config
# System > Wireless ...
reboot
# disconnect ethernet

audio via headphone-jack#

https://www.raspberrypi.org/documentation/configuration/audio-config.md

sudo raspi-config
# System > Audio > Headphones
sudo reboot

alsamixer  # shows Headphone

play something#

scp /tmp/test.mp3 pi1:

ssh pi1
sudo apt-get install omxplayer
omxplayer test.mp3

camera#

blakeblackshear/frigate#3097

rpicam-vid --camera 0 --mode 2304:1296 --framerate 15 --hdr --timeout 0 --nopreview --codec h264 --libav-video-codec h264 --libav-format h264 --inline -o - | ffmpeg -i - -f mjpeg tcp://0.0.0.0:5000?listen

VLC: network stream (Ctrl+N)

tcp://pi3:5000

mediamtx#

bluenviron/mediamtx

sudo apt install -y libcamera0 libfreetype6

wget https://github.com/bluenviron/mediamtx/releases/download/v1.8.4/mediamtx_v1.8.4_linux_arm64v8.tar.gz
tar xf mediamtx_v1.8.4_linux_arm64v8.tar.gz
sudo mv mediamtx /usr/local/bin/
rm mediamtx_v1.8.4_linux_arm64v8.tar.gz

cat <<'EOF' > mediamtx.yml
paths:
  cam:
    source: rpiCamera
EOF

mediamtx

WebRTC: http://pi3:8889/cam/

Could not get RTSP to work (neither vlc nor gstreamer). Meh.

The mediamtx documentation is brilliant though. Kudos!

Boot from USB (SSD / SATA)#

https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#enable-usb-host-boot-mode-with-otp

sudo -i

vcgencmd otp_dump | grep 17:
# output before setting the bit:
# 17:1020000a

vi /boot/firmware/config.txt
reboot

vcgencmd otp_dump | grep 17:
# output after setting the bit:
# 17:3020000a

Raspberry Pi as Bluetooth Headphone (aka. “audio sink”)#

sudo -i

cat <<'EOF' > /etc/bluetooth/main.conf
[General]
Name = pi3
Class = 0x41C
DiscoverableTimeout = 0
[BR]
[LE]
[GATT]
[AVDTP]
[Policy]
AutoEnable=true
[AdvMon]
EOF

systemctl restart bluetooth
systemctl status bluetooth

bluetoothctl
power on
discoverable on
pairable on
agent on

Mobile: pair.

Cornrow fail:

cornrowd[4387]: 03:27:58.561 [main thread     ]         RtpDecoder.cpp:69    WARN| sequence discontinuous. 49168, 8048
cornrowd[4387]: 03:27:58.561 [main thread     ]         RtpDecoder.cpp:123   WARN| SBC header invalid
cornrowd[4387]: 03:27:58.561 [main thread     ]         SbcDecoder.cpp:94    WARN| Sync byte incorrect