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
1 2 |
touch /etc/modprobe.d/8192cu.conf sudo nano touch /etc/modprobe.d/8192cu.conf |
Add following one lins to 8192cu.conf we just created.
1 |
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 |
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 :
rtw_power_mgnt
1 2 3 |
0 = disable power saving 1 = power saving on, minPS 2 = power saving on, maxPS |
rtw_enusbss
1 2 |
0 = disable auto suspend 1 = enable auto suspend |
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.
1 2 3 |
sudo raspi-config Select: Enable Boot to Desktop/Scratch Choose whether to boot into a desktop environment, Scratch, or the command-line Select Console Text console, requiring login (default) |
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
1 2 |
sudo apt-get update sudo apt-get upgrade |
Expand Filesystem on SD Card
Run following command to enable all of the SD card storage is available to the OS.
1 |
sudo raspi-config |
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.
1 |
sudo raspi-config |
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.
1 |
/dev/sda1 /var/log vfat defaults 0 0 |
4 comments
Loving the site so far. in he last line of code above could it be possible that the powershell code line should read: “/var/logs” , rather than “/var/log” ? Or is it just too damn early again 🙂
@Meremortal
Thank you for compliments: i just double checked my fstab and i have following line in it
/dev/sda1 /var/log vfat defaults 0 0
on my second RPI all logs are on sd card in /var/log may be you have different version of os ?
Really love this site for all the tips you have for all common problems with raspberry pi, i was really pulling my hairs on time zone setting.