Skip to content

Instantly share code, notes, and snippets.

@workingmatt
Last active March 25, 2021 17:53
Show Gist options
  • Save workingmatt/3c6f5854da506ce21b751e07c8b888ef to your computer and use it in GitHub Desktop.
Save workingmatt/3c6f5854da506ce21b751e07c8b888ef to your computer and use it in GitHub Desktop.
Useful Raspberry Pi Info

Camera

Shopping links

Raspberry Pi High Quality Camera: https://shop.pimoroni.com/products/raspberry-pi-high-quality-camera £49.50
Microscope Lens: https://shop.pimoroni.com/products/microscope-lens-0-12-1-8x £22.50
Camera Cable: https://shop.pimoroni.com/products/raspberry-pi-camera-cable?variant=10312197191 £4.50

Camera hi-res output to screen:

Save the following as /home/pi/cameraLocalView.sh

#!/bin/bash
raspivid -o - -t 0 -md 2 -fps 25 -ISO 800 | cvlc -vvv stream:///dev/stdin --no-audio --demux=h264 -h264-fps=25

Then run chmod +x /home/pi/cameraLocalView.sh
You can now double click the file and choose 'Run in Terminal' If you add a filename like this raspivid -o -vidFile.mpg the stream will also be saved to ~/vidFile.mpg To autorun the script at start up...

nano ~/.bashrc
bash /home/pi/cameraLocalView.sh

Better solution: https://elinux.org/RPi-Cam-Web-Interface#Installation_Instructions


View a video from the command line

omxplayer <filename>


Raspberry Pi full update including firmware

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo reboot now
sudo rpi-update (this updates the firmware)
sudo reboot now

Updating the firmware is good to do once for earlier Raspberry Pi 4s to stop overheating issue. Not necessary to do this regularly.


Manually Add Wifi

Plug the Pi's SDCard into a computer. Create a text file called wpa_supplicant.conf to SDCard boot partition to manually configure wifi access. This file is read when the RPi boots and is then removed.

country=gb
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="NETWORK-NAME"
psk="NETWORK-PASSWORD"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment