We need to modify few things before we can continue to next step: disable power management so we can connect pi over WiFi reliably, make our SD card lost longer by moving logs to USB stick, disable GUI as we don’t need GUI running and utilize CPU time, expand file system to utilize all SD card space.

Disable Power Management for Raspberry PI

I am using cheap generic USB WI-Fi dongle, the latest image has built-in support for most WiFi dongles. But by default raspberry pi turn off WiFi connection and you’ll lose connection with your pi, to improve stability and avoid disconnection it is recommended to disable power management. To disable power management simply create file /etc/modprobe.d/8192cu.conf

Add following one lins to 8192cu.conf we just created.

The two options we set in the configuration are rtw_power_mgnt and rtw_enusbss. If you are interested they take the values defined below :


Disable GUI on Boot

We don’t need GUI interface as all access is based on web we can simply disable this and save some cpu/ram resourcess, simple Launch raspi-config.

Hit OK and then Finish.

Update Raspbian Jessie and Firmware

Lets update raspberry pi OS (Raspbian Jessie) and firmware by issuing following two commands from shell, i prefer to use Putty but its up to you what ever you want to use to remote connect your Raspberry Pi

Expand Filesystem on SD Card

Run following command to enable all of the SD card storage is available to the OS.

Select Advanced Options and then select Expand Filesystem and hit enter, following message will be displayed

Root partition has been resized.
The filesystem will be enlarged upon the next reboot

Hit return again and select finish and hit enter now last screen you will get choice to reboot RPI, select yes and hit enter.

Setting the Time-zone

Time-zone setting is very important and if you don’t set time-zone right you might end up pulling your hairs as schedule wouldn’t work properly, rung sudo raspi-config command from console and select Localization Options and hit return, select Change Timezone and hit return, now select your Geographic area and hit return and now select Time zone and hit return and then Finish.

Optimize SD Card: Move /var/log to USB Stick on Raspberry pi

SD comes with very limited wear-level, to prevent SD card wear out to quickly its best to move all logs to usb stick so SD card can lost longer. on same nor i would recommend to use class 10 branded sd card.

I have one very small USB stick 16gb in size and it host log files for all raspberry pi which way SD will be used less and stay in use for long time. Following steps worked for me without any issue.

  • Format USB stick on your windows computer with FAT32 or any FAT filesystem.
  • Connect USB stick to Raspberry pi
  • Edit /etc/fstab file and add following entry and save file and reboot.