Raspberry Pi Setup

I like to keep around several SD cards with different images for my Raspberry Pi. It allows me to swap between tasks easily and ensure there is no bloat for a particular project. However there are several common setup tasks I like to do to enable access and functionality this guide includes several of those setup tasks.

Enable Windows Share Access

The ability to easily upload, download and edit files on the pi is critical for me. The easiest way to do this from a Windows machine is through Samba.These commands will install Samba, add the pi user and tell Samba to share out the home drive for that user. Once run you can access your files at \\raspberrypi\pi

sudo apt-get install -q -y samba samba-common-bin
sudo smbpasswd -a pi
sudo smbpasswd -e pi
sudo sed -i '0,/encrypt passwords = no/{s/encrypt passwords = no/encrypt passwords = yes/}' /etc/samba/smb.conf
sudo sed -i '0,/read only = yes/{s/read only = yes/read only = no/}' /etc/samba/smb.conf
sudo /etc/init.d/samba restart

Enable SPI and I2C

I tend to use I2C or SPI in my projects so I find it helpful to have them enabled. There are many guides out there but these commands will do all the work for you.

sudo apt-get install i2c-tools
sudo sed -i 's/blacklist spi-bcm2708/#blacklist spi-bcm2708/g' /etc/modprobe.d/raspi-blacklist.conf
sudo sed -i 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/g' /etc/modprobe.d/raspi-blacklist.conf
sudo sh -c "echo 'i2c-bcm2708' >> /etc/modules"
sudo sh -c "echo 'i2c-dev' >> /etc/modules"
sudo adduser pi i2c

WiFi Auto Connect & Reconnect

If you need to put your Pi in a place without an Ethernet cable it’s helpful if it automatically connects to your WiFi network and reconnects if the connection drops. The easiest guide I’ve found on the topic is right here: http://www.raspyfi.com/wi-fi-on-raspberry-pi-a-simple-guide/

Leave a Reply