Skip to content

Instantly share code, notes, and snippets.

@hitorilabs
Last active May 14, 2024 22:37
Show Gist options
  • Save hitorilabs/c354f2efd8e55ec473f3795c507eb769 to your computer and use it in GitHub Desktop.
Save hitorilabs/c354f2efd8e55ec473f3795c507eb769 to your computer and use it in GitHub Desktop.

RPi 5 Shenanigans

power supply (?) issues - crashing when pulling >8W (i was running off a power bank)

you might want to consider getting the official one (5A/27W)


Temporarily limiting the CPU clock speed

echo 1500000 | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

or to persist a setting on reboot /boot/config.txt

arm_freq=1500

Thunderbolt bridge to RPi from a Mac without internet

It's a little bit awkward to get right, but you need to go into network settings and find "Manage Virtual Interfaces"

networks menu

Make sure that your ethernet adapter is added as a device to the "Thunderbolt Bridge" interface.

bridge add interface to bridge

You can also make sure to disable "General > Sharing > Internet Sharing" if you don't need it.

side note: arp -a has been quite useful for checking up on the connection and finding the IP that gets allocated, but you probably leverage bonjour/libnss-mdns and find it with just ssh user@hostname.local

If you leave the pi inactive and connected via bridge, you'll notice that the connection will drop. You either need to stay connected or just reconnect the adapter when this happens.


buying a powersupply with the official spec fixed the power issues, but now i need to wait 3 days because i accidentally bought a display cable instead of a camera cable 💀


vcgencmd get_config usb_max_current_enable check if you can draw max current from power supply


actual docs https://www.raspberrypi.com/documentation/computers/raspberry-pi.html


enable a hotspot on wlan0

sudo nmcli dev wifi hotspot ifname wlan0 ssid <name> password <password>
sudo nmcli radio wifi off

start hotspot on reboot

sudo nmcli con modify Hotspot connection.autoconnect true

you would probably want to get rid of any existing wifi connection

nmcli con delete id <ssid>

if you want to turn it off (i.e. to avoid interfering w/ wifi at home, but be able to connect when taking the pi outside) you can disconnect it using sudo nmcli dev disconnect wlan0 every time you boot up at home.

This method allows it to still autostart the hotspot correctly on the next reboot... basically I want to talk to the pi w/o internet or carrying an ethernet adapter everywhere I go.

note: nmcli radio wifi off hotspot won't start on reboot, but if you just disconnect it will still start


camera stuff

for compiling ffmpeg from source

./configure --enable-libx264 --enable-gpl --enable-shared

compiling rpicam-apps

meson setup build -Denable_libav=true -Denable_drm=true -Denable_egl=false -Denable_qt=false -Denable_opencv=false -Denable_tflite=false

streaming video (rpi server)

rpicam-vid -t 0 --codec libav -o "tcp://0.0.0.0:1234?listen=1" --camera 1

client

ffplay tcp://<raspberrypi>.local:1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment