Skip to content

Instantly share code, notes, and snippets.

@yvesvanbroekhoven
Last active May 13, 2022 06:04
Show Gist options
  • Save yvesvanbroekhoven/73adcafb55a300fa1a2b9869b9e1efb6 to your computer and use it in GitHub Desktop.
Save yvesvanbroekhoven/73adcafb55a300fa1a2b9869b9e1efb6 to your computer and use it in GitHub Desktop.
Raspberry Pi Setup Essentials

Raspberry Pi Setup Essentials

Raspbian

Headless setup

https://davidmaitland.me/2015/12/raspberry-pi-zero-headless-setup/

Add file ssh to /boot/ directory.

Update & upgrade Raspbian

https://www.raspberrypi.org/documentation/raspbian/updating.md

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get clean

Update the firmware of your Raspberry Pi

sudo rpi-update

Samba

sudo apt-get install samba samba-common-bin
sudo smbpasswd -a pi
sudo service samba restart

Mount

sudo mount 192.168.xxx.xxx:/volume1/video /mnt/video -o nolock

Dropbox

Clone GIT repo and follow the instructions

git clone git@github.com:andreafabrizi/Dropbox-Uploader.git

Plex

Update

sudo apt-get update; sudo apt-get install plexmediaserver -y

Picopix

sudo apt-get update; sudo apt-get install libam7xxx0.1-bin

Troubleshooting

SSH Host key verification failed

ssh-keygen -R hostname
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(17, GPIO.OUT) # LED Red
GPIO.setup(26, GPIO.OUT) # LED Green
GPIO.output(26, GPIO.HIGH)
prevInput = 0
def toggleLed():
if (GPIO.input(17)):
GPIO.output(17, GPIO.LOW)
else:
GPIO.output(17, GPIO.HIGH)
while True:
if (GPIO.input(18) and prevInput == 0):
toggleLed()
prevInput = 1
print("button up")
if (not GPIO.input(18) and prevInput == 1):
prevInput = 0
print("button down")
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment