2013-08-04

OWFS for Raspberry Pi

One Wire File System is a nice package that helps you use 1wire in a simple way.
There is a very good description for how to install OWFS on Raspberry Pi on temperatur.nu. It is in Swedish but should be easy to follow for most of you.

Note that in newer Raspian Wheezy SW there is a conflict between owfs and some sound drivers. To fix this add "blacklist snd_soc_tas5713" to the file /etc/modprobe.d/raspi-blacklist.conf and reboot. Thanks to the people at m.nu forum.

Prolong life of SD card on Raspberry Pi by sending all logs to my NAS via syslog

You can read a lot about how your SD card in the Raspberry Pi can become broken if you write too much to it. I don't know if it is still applicable for modern SD cards.
However I have tried to reduce writing log events to the SD card and instead sending them to my NAS.
You need to edit a few text files. I'm used to emacs and have installed that. You can use whichever editor that you feel comfortable with.
This is what I did:

  1. Set the host name of the Raspberry Pi to something unique. This is the host name that will show up for each log on the NAS.
    $ sudo emacs /etc/hostname
    Replace raspberrypi with the host name you would like to use. Save the file and exit the editor.
  2. Then open the next file:
    $ sudo emacs /etc/hosts
    Replace all instancied of raspberrypi with the new host name. Save the file and exit the editor.
  3. You have to restart a process or reboot your Raspberry Pi. To restart process type
    $ sudo /etc/init.d/hostname.sh start
  4. To redirect all syslog logs to a NAS open the syslog config file:
    $ sudo emacs /etc/rsyslog.conf
    Under the RULES sections add the following line:
    *.* @11.22.33.44
    You need to change 11.22.33.44 with the IP number to your NAS server.
    Then you have to comment out all log directives to log files by setting a # before each row.
    Save the file and exit the editor.
  5. Now you need to restart the rsyslog daemon mto make it reread the config file:
    $ sudo service rsyslog restart
    Now you can watch the logs come to your NAS instead of to the SD card.