Yannick Weiss

Raspberry Pi

DD img to SD card

diskutil list
diskutil unmountDisk /dev/diskX
sudo dd bs=4m if=img of=/dev/rdiskX
touch /Volumes/boot/SSH

Enable SSH

touch /Volumes/boot/SSH

Backup and Restore SD on a Macbook

This will create a backup of all the blocks so you can only restore it to a stick of the same size.

diskutil unmountDisk /dev/disk2
sudo dd bs=4m if=/dev/disk2 | gzip > rasbian.img.gz
(gunzip --stdout rasbian.img.gz | sudo dd bs=4m of=/dev/rdisk2)
gzip -dc rasbian.img.gz | dd of=/dev/rdisk2

Small script to reconnect WiFi

It checks if the network is down, if so, reconnects it. http://raspberrypi.stackexchange.com/a/28047/52917

Common Problems

  • SSH is not running -> Create a file called SSH on the boot parition.
  • Time/Timezone is not working or problem with NTP -> run sudo raspi-config and setup timezone.
  • Raspberry Pi does not start -> Check if the SD card can be read on a computer.
  • How can I extend the life of my SD card?
  • Print serial: cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2
  • Print MAC: cat /sys/class/net/eth0/address
  • PoE Adapters -> Search for “poe raspberry” on aliexpress.com