Skillnad mellan versioner av "OWFS with i2c support on Raspberry Pi (English version)"

Från Temperatur.nu/m.nu Wiki
Hoppa till:navigering, sök
(Ersätter sidans innehåll med 'This guide has moved to http://wiki.m.nu/index.php/OWFS_with_i2c_support_on_Raspberry_Pi_(English_version)')
 
(6 mellanliggande versioner av samma användare visas inte)
Rad 1: Rad 1:
This guide will help you to get [[OWFS]] working on [[Raspberry Pi]]'s i2c GPIO port.
+
This guide has moved to http://wiki.m.nu/index.php/OWFS_with_i2c_support_on_Raspberry_Pi_(English_version)
{| align="right"
 
  | __TOC__
 
  |}
 
 
 
==GOAL==
 
To get full OWFS support on the i2c bus the Raspberry Pi.
 
 
 
==Software==
 
* [http://www.raspberrypi.org/downloads Raspian Wheezy]
 
* [http://owfs.org/ OWFS] (Latest tested version is 2.8p20)
 
 
 
==Hardware==
 
* [https://www.m.nu/raspberry-pi-raspberry-pi-c-97_96.html Raspberry Pi]
 
* [https://www.m.nu/mnu-i2c-1wire-expansion-module-p-599.html i2c 1wire breakout board]
 
 
 
==prerequisites==
 
This guide is written based on a clean install of [http://www.raspberrypi.org/downloads Raspbian Wheezy] (2012-10-28).
 
 
 
==Modules==
 
Make sure that the i2c-bus module is not included in the blacklist file.
 
sudo nano /etc/modprobe.d/raspi-blacklist.conf
 
 
 
Add "#" before
 
blacklist i2c-bcm2708
 
 
 
The row will look like this:
 
#blacklist i2c-bcm2708
 
 
 
Make sure that the i2c-dev module is included in /etc/modules
 
sudo nano /etc/modules
 
 
 
Add "i2c-dev" on it's own row in the file.
 
i2c-dev
 
 
 
==Installation of OWFS==
 
First you'll have to install som neccecary and usefull packages.
 
sudo apt-get update
 
sudo apt-get install automake autoconf autotools-dev gcc-4.7 libtool libusb-dev libfuse-dev swig python2.6-dev tcl8.4-dev php5-dev i2c-tools
 
Answer Yes on any question during the install.
 
 
 
Download the latest version of OWFS (currently 2.8p20)
 
cd /usr/src
 
sudo wget  -O owfs-latest.tgz http://sourceforge.net/projects/owfs/files/latest/download
 
 
 
Unpack OWFS
 
  sudo tar xzvf owfs-latest.tgz
 
 
 
Configure OWFS
 
cd owfs-2.8pXX
 
sudo ./configure
 
 
 
If everything goes as planned you'll get a result like this:
 
Current configuration:
 
 
    Deployment location: /opt/owfs
 
 
Compile-time options:
 
                  Caching is enabled
 
                      USB is enabled
 
                      I2C is enabled
 
                    HA7Net is enabled
 
                        W1 is enabled
 
            Multithreading is enabled
 
    Parallel port DS1410E is enabled
 
        TAI8570 barometer is enabled
 
              Thermocouple is enabled
 
          Zeroconf/Bonjour is enabled
 
              Debug-output is enabled
 
                Profiling is DISABLED
 
Tracing memory allocation is DISABLED
 
1wire bus traffic reports is DISABLED
 
 
Module configuration:
 
                    owlib is enabled
 
                  owshell is enabled
 
                      owfs is enabled
 
                  owhttpd is enabled
 
                    owftpd is enabled
 
                  owserver is enabled
 
                owexternal is enabled
 
                    ownet is enabled
 
                  ownetlib is enabled
 
                    owtap is enabled
 
                    owmon is enabled
 
                    owcapi is enabled
 
                      swig is enabled
 
                    owperl is enabled
 
                    owphp is DISABLED
 
                  owpython is DISABLED
 
                    owtcl is enabled
 
 
 
Compile OWFS, it will take approx 30 minutes
 
sudo make
 
 
 
Install OWFS, it will take a couple of minutes
 
sudo make install
 
 
 
Create a mountpoint for the 1wire folder.
 
sudo mkdir /mnt/1wire
 
 
 
To make it possible to access the 1wire devices without root privileges you'll have to modify the FUSE settings.
 
Open the fuse configuration file:
 
sudo nano /etc/fuse.conf
 
Change
 
#user_allow_other
 
to
 
user_allow_other
 
 
 
Now you can start OWFS!
 
sudo /opt/owfs/bin/owfs --i2c=ALL:ALL --allow_other /mnt/1wire/
 
 
 
Make sure everything works as it should by checking the contents of the 1wire folder or by reading a sensor: (Change path according to your sensor id)
 
cat /mnt/1wire/10.F6877C010800/temperature
 
You should get the current temperature as result.
 
 
 
[[File:Owfs_ls_example.png|thumb|Example of how the output of "ls" in the 1wire folder can look like.]]
 
 
 
==Make sure OWFS is started automatically at boot==
 
 
 
Create the startup script in '''/etc/init.d/'''
 
cd /etc/init.d
 
sudo nano start1wire.sh
 
Add the folowing to the file (remove the first space on each row):
 
#!/bin/bash
 
 
### BEGIN INIT INFO
 
# Provides:          start1wire
 
# Required-Start:    $local_fs $syslog
 
# Required-Stop:    $local_fs $syslog
 
# Default-Start:    2 3 4 5
 
# Default-Stop:      0 1 6
 
# Short-Description: Start OWFS at boot time
 
# Description:      Start OWFS at boot time
 
### END INIT INFO
 
 
# Starts OWFS
 
/opt/owfs/bin/owfs --i2c=ALL:ALL --allow_other /mnt/1wire
 
 
 
To make the script executable, run the following command:
 
sudo chmod +x start1wire.sh
 
 
 
Add the script to the default runlevel.
 
sudo update-rc.d start1wire.sh defaults
 
 
 
Congratulations, if you've made it this far you've installed OWFS with i2c support and made sure that it starts automatically when the Raspberry Pi boots.
 
 
 
==Sources==
 
* [[OWFS_HowTo]]
 
* http://tomasz.korwel.net/2006/07/02/owfs-instalation-on-ubuntu-606/
 
* http://owfs.org/index.php?page=ubuntu
 
* http://owfs.org/index.php?page=fuse
 
* http://www.temperatur.nu/forum/viewtopic.php?f=24&t=489#p2616
 
 
 
[[Kategori:Linux]]
 
[[Kategori:HowTo]]
 

Nuvarande version från 26 september 2014 kl. 20.21