Publishing 1-Wire temperature sensors to Emoncms via a Raspberry Pi part 2

Last time, we setup the Raspberry Pi so it could read the values from some DS18B20 sensors using the command line tool owfs. We’re a still few steps away from publishing these temperatures to Emoncms at the moment – namely getting owfs to start automatically, reading the values in Python, and then publishing them.

Running owfs automatically

When building owfs from source, you don’t get automatic startup as an option. It is quite easy to setup though.

First, let’s build a config file to store settings:

And copy and paste this in:

It is important to note that this setup means that only owfs can access the 1-Wire bus. The default configuration is to run owserver and then have all other ow* processes connect to owserrver – i.e. it distributes the data. I want to keep my setup as simple as possible, so owfs connects directly to the bus.

Let’s test this config out:

Now we need to create an init script:

And then copy and paste this into the file:

This is totally barebones, but I always use this form of init script and it works well.

Now make it executable:

Then use the very convenient tool, update-rc.d to add links so that this script runs at the appropriate times and runlevels:

Then restart your Pi:

Once restarted, check everything is running and you can still see the devices:

2 thoughts on “Publishing 1-Wire temperature sensors to Emoncms via a Raspberry Pi part 2

  1. Permalink  ⋅ Reply


    May 23, 2014 at 7:58pm

    I’m a real noob, but in your very first line where you create the config file, it seems to be called ows.conf should that be owfs.conf? I think that’s the name you refer to later on.

    • Permalink  ⋅ Reply


      May 23, 2014 at 8:34pm

      Indeed, an error. Will fix shortly, thanks.

Leave a Reply

Your email will not be published. Name and Email fields are required.

This site uses Akismet to reduce spam. Learn how your comment data is processed.