What you will need
- Raspberry Pi Model
- Micro SD Card 8Mb
- Wi-fi connection
- Wi-fi SSID
- Wi-fi passcode
- Raspberry Pi Model
Prepare the Raspberry Pi by connecting a keyboard and monitor. Place the newly imaged SD card into the Raspberry Pi and switch on by plugging in the power cable.
The Raspberry Pi will power up and commentary about the start-up process will appear on the screen. Once complete the screen will have a login prompt:
Configure the Raspberry Pi to connect to WiFi
In order to connect to the internet, we need to configure the Raspberry Pi to connect to WiFi.
Lastly, select Finish and select 'Yes' to reboot the Raspberry Pi and for the settings to take effect.
Once the Pi has rebooted, you will be presented with the prompt to login again.
Just above this is a line of commentary starting 'My IP address is ....' as shown in red below.
Connect and Login to the Pi From Another Computer
One Wire File System (OWFS)
(Useful links: http://owfs.org/index.php?page=quickstart-guide and https://www.raspberrypi.org/forums/viewtopic.php?t=27379)
Listed below are the steps to install the 1-Wire software or OWFS (One Wire File System) onto the Raspberry Pi. Using the Raspberry Pi, OWFS allows easy interaction with the 1-wire sensors that are connected to the network.
The steps below assume that the 1-Wire network it to be connected to the Raspberry Pi using a USB serial adapter. (This is based on the micro controller LINK (serial adapter) coupled with a FTDI USB serial converter.
Connect & Check USB Serial Link Adapter
Plug in the Link USB adapter and check that the device is working and recognised by running the dmesg command as follows:
In the dmesg information above, the adapter appears as ttyUSB0. You should see text in the script similar to that highlighted in red above. ttyUSB0 is the serial port that the USB interface will be outputting the sensor readings through. Take note of this as it will be needed later on in the configuration.
Install the OWFS Package
Install OWFS by typing the following command:
Text will scroll up the screen giving a commentary on the installation. When the install process ends, the OWFS tasks are started, and they will restart automatically each time you reboot the Raspberry Pi.
Now check that the OWFS software has been properly installed by running the following command:
and where it has been installed:
When OWFS starts, it reads a configuration file—/etc/owfs.conf to get its stat-up settings. We need to make changes to this file to ensure that OWFS starts correctly.
Edit the OWFS configuration file using the following command:
Once the editor is open:
- Comment out the lines containing "FAKE" by placing a hash at the start of the line #. These lines have been highlighted in red below.
- # server: FAKE = DS18S20,DS2405
- Uncomment the the following lines by removing the hash at the beginning of the line. These lines have been highlighted in blue below.
- server: device = /dev/ttyUSB0
- mountpoint = /mnt/1wire and
As shown below and highlighted in Blue.
Edit the "fuse.conf" file in directory "/etc" in order to allow using the "--allow_other" option when invoking the OWFS program at the terminal prompt later on.
Uncomment the line containng "user_allow_other" as shown below:
Now we need to make a directory for the OWFS to place all the sensor readings.
We are now ready to connect the 1-wire sensors to the Raspberry Pi via the USB Adapter. For the purpose of these instructions, a 1-wire temperature sensors and humidity sensor are connected.
Finally, it is time to start OWFS. Restart owserver, owhttpd & the USB Adapter with the following commands.
The OWFS processes should all be running now. To check this go to a web browser and enter the web address as follows:
Where <localhost> is the IP address of your Raspberry Pi, which you should have noted earlier in the installation process. So if the IP address is 192.160.200, you would enter into your browser:
You should see a web page as follows:
At the top level, the device entries are cached. They will remain visible for at least a minute after you remove them.
In addition to the adapter ("01.52DE7913000"), a second device is present on the 1-wire ("28.2212F0080000").
This second device is the DS18B20 temperature sensor. "28" is the code given by Dallas (the conceptor of the 1-wire) to the family of temperature sensing device to which DS18B20 belongs and "2B7814020000" is the ID of the device being used. "temperature" is the name of the file that contains the measured temperature.
By clicking on sensor ID in the browser, you can drill down the file system and read further details about the sensor.
The third device ("26.D57725020000") is the DS2438 1-wire device used to read the humidity sensor. Again by clicking on the censor ID, you can read more information recorded by the sensor.
For the humidity sensor you can see that it is providing a humidity reading and a temperature reading.