Rasberry Pi: Difference between revisions
NickPGSmith (talk | contribs) |
NickPGSmith (talk | contribs) |
||
| Line 33: | Line 33: | ||
apt update && sudo apt upgrade -y | apt update && sudo apt upgrade -y | ||
=== Web Server === | === Apache Web Server === | ||
apt install apache2 | apt install apache2 | ||
| Line 39: | Line 39: | ||
* Configuration: /etc/apache2 | * Configuration: /etc/apache2 | ||
* Serve from: /var/www/html | * Serve from: /var/www/html | ||
=== Composite Video === | |||
Note: CVBS is on sleve; Gnd is ring 3. It is enabled when no HDMI monitor is connected. | |||
In /boot/firmware/config.txt: | |||
enable_tvout=1 | |||
dtoverlay=vc4-kms-v3d,composite | |||
Ensure hdmi_force_hotplug=1 is commented out or set to 0. | |||
In /boot/firmware/cmdline.txt, either: | |||
vc4.tv_norm=PAL | |||
vc4.tv_norm=NTSC | |||
To control overscan, see settings: | |||
margin_left | |||
margin_right | |||
=== Mail === | === Mail === | ||
Revision as of 15:12, 27 May 2026
Device
- Rasberry Pi 3B ("Rev 1.2")
cat /proc/device-tree/model
Rasbian OS
See /boot/firmware/config.txt.
Command line configuration program:
raspi-config
Go
Cross compile on amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build myprog.go
GPIO
Raspberry Pi OS versions use the newer gpiod subsystem (which interacts with /dev/gpiochip)
python:
apt install python3-gpiozero -y
go: periph.io
Upgrades
apt update && sudo apt upgrade -y
Apache Web Server
apt install apache2
- Configuration: /etc/apache2
- Serve from: /var/www/html
Composite Video
Note: CVBS is on sleve; Gnd is ring 3. It is enabled when no HDMI monitor is connected.
In /boot/firmware/config.txt:
enable_tvout=1 dtoverlay=vc4-kms-v3d,composite
Ensure hdmi_force_hotplug=1 is commented out or set to 0.
In /boot/firmware/cmdline.txt, either:
vc4.tv_norm=PAL vc4.tv_norm=NTSC
To control overscan, see settings:
margin_left margin_right
MUA:
apt install bsd-mailx apt install mutt
Mail spool directory (eg NFS mount from server):
/var/mail
Exim is the default MTA:
dpkg-reconfigure exim4-config update-exim4.conf systemctl restart exim4
Monitor logs:
/var/log/exim4/mainlog
Swap
free -m swapon --show
Add filesystem swap:
swapoff -a dd if=/dev/zero of=/swapfile bs=1M count=1024 chmod 600 /swapfile mkswap /swapfile swapon /swapfile
Add to /etc/fstab:
/swapfile none swap sw 0 0
To see current zram configuration:
zramctl zramctl --output-all /dev/zram0
To resize:
swapoff /dev/zram0 zramctl --reset /dev/zram0 zramctl --find --size 512M mkswap /dev/zram0 swapon /dev/zram0
NFS Automounter
apt install autofs nfs-common -y
Edit /etc/auto.master and enable the host map:
/net -hosts --timeout=60
systemctl enable autofs systemctl restart autofs
NTP Client
apt install systemd-timesyncd -y
Edit /etc/systemd/timesyncd.conf and set NTP parameter
systemctl restart systemd-timesyncd timedatectl status timedatectl timesync-status
Temperature
echo "scale=2; $(cat /sys/class/thermal/thermal_zone0/temp) / 1000" | bc
CPU Core throttling above 80 C.