OWFS Server on The Raspberry Pi

1

Quick and simple this one is. I have a DS9490R (internally it’s a DS1490F) one-wire bus master attached to my Raspberry Pi. 4 DS18B20 temperature sensors are hanging off the bus, and I’d like to access them from the home automation server.

On the Raspberry Pi, or the server/device that’s hosting the 1-Wire bus:

apt-get install owserver ow-shell
modprobe ds1wm
echo “ds1wm” >> /etc/modules

Edit /etc/owfs.conf such that the following parameters are entered. I’d advise commenting out the rest (at least, the rest of the server: directives)

! server: server = localhost:4304
server: usb = all
server: w1
server: port = 0.0.0.0:4304

Restart the 1-Wire server

/etc/init.d/owserver restart

All being well, the following command should output a listing of all the devices on the bus.

owdir -s localhost:4304 /

On the remote server, simply use the following command to read the data.

owread -s kitchenpi.vpn.glasgownet.com:4304 /28.DDBF1D030000/temperature

No tips yet.
Be the first to tip!

Like this post? Tip me with bitcoin!

19QULztJFRtW9KYgqdNtJU3kTRxBK5pZ2t

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

MQTT GPIO Monitoring

0

My little Raspberry Pi seems to be growing arms and legs.

The other day I hooked up a simple PIR to it. I can’t remember where I got it, but it runs off 5v, consumes a low enough amount of milliAmps to be directly connected to the Raspberry Pi 5v supply, and outputs a TTL compatible 3.3v signal. Bonus!

I wanted to be able to signal to my MQTT broker when motion was detected, so it was time to start monitoring the GPIO pins. I wrote up this short app using the framework I’d made for MQTT-Republisher earlier. MQTT-GPIO-Trigger will accept a list of GPIO pins that you wish to watch, and will cycle through them all and fire off MQTT messages on any state change.

It uses the standard Linux sysfs interface to read the pin states, and if it detects the WiringPi library on the system it will use Gordons gpio command to export the pins to the system.

No tips yet.
Be the first to tip!

Like this post? Tip me with bitcoin!

1N1cx5ZwPZjB8dLrRsMEGbTL8wXKyoYeBN

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

MQTT Republishing Itch

1

So, I had an itch. A variety of data coming in from a variety of sources, all over different protocols and methods, with different names, heirarchies, and paths. For a while I’d been pushing the data into MySQL, but this seemed a bit of a hack, and it still didn’t really cure the problem as it was more of a historical record than an attempt at mapping between the source and the destination, as it were.

I’d been fiddling with MQTT for a while, and had started publishing data over it via my personal broker. And then I read Roberts post over at http://blog.hekkers.net/2012/09/18/mqtt-about-dumb-sensors-topics-and-clean-code/ about republishing it in a logical way.

So simple! So, I wrote a republisher. It’s very simple, and it scratches my itch (and hopefully Roberts too). Data comes in via whatever naming scheme or topic you like, and it gets republished in whatever fashion you want. The map is maintained in map.csv, and items are separated by commas. The MQTT spec doesn’t reserve any characters for the topic name, so I’ve used a comma out of CSV convenience.

The code is over at https://github.com/kylegordon/mqtt-republisher

No tips yet.
Be the first to tip!

Like this post? Tip me with bitcoin!

13ZcZBEddD1VER362BasFkjmV2PGvPtBuB

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

Accessing Novell Groupwise from Ubuntu, Mint, etc

0

We use Groupwise at work, and up until recently Groupwise support was available in Evolution. I don’t know why it was dropped, but it’s fairly easy to reinstate it again if you’re prepared to build from source.

These are the steps I used to build it on two Linux Mint installations, although it should work on Ubuntu and Debian too.

Edit /etc/apt/sources.list and ensure you have deb-src equivalents for all your main, universe and multiverse repositories

sudo apt-get update
sudo apt-get install libedata-book1.2-dev libedata-cal1.2-dev evolution-dev libdb5.1-dev libcamel1.2-dev
sudo apt-build dep evolution

All being well, a big bunch of build dependencies will be installed

cd ~/src/
git clone http://git.gnome.org/browse/evolution-groupwise/
git checkout -b 3.2.0-patch EVOLUTION_GROUPWISE_3_2_0
# This is the patch for the SOAP port bug
git cherry-pick 3aae80f55d5fd565274f19210564e74d5350a66c
./autogen.sh

All being well, ./autogen.sh will finish and tell you to run make to compile it.

make ; sudo make install

Now, the makefile doesn’t seem to copy over some UI elements, which means the Proxy login feature destroys Evolution if you try to use it. A quick workaround is to copy them from your source tree to your system.

sudo cp src/plugins/*.ui /usr/share/evolution/3.2/ui/

Kill any existing Evolution components…

ps waux | grep -i evolutio[n] | awk {'print $2'} | xargs kill -9

Run evolution from the command line

evolution

No tips yet.
Be the first to tip!

Like this post? Tip me with bitcoin!

14GQgFuTdbd1wdQrUdgs3mSPTFfbezttJR

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

apt-key from behind a firewall

2

At work we’re pretty heavily firewalled. This means that outbound requests on funny ports are often firewalled off, and systems that rely on such ports will time out.

One such system that is commonly used yet inaccessible is the GPG SKS port 11371. And many many Linux things use GPG!

What got me looking was the common command to import a key, in this case for Spotify.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59

It will time out and fail to import the key, subsequently causing your apt-get operations to fail. A quick update to the command cures it. You *have* to specify hkp:// and :80

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59

Success! You can also apply the same changes to your default keyservers in ~/.gnupg/gpg.conf

No tips yet.
Be the first to tip!

Like this post? Tip me with bitcoin!

1Ere53BWR8weNv1vWb3csrHXtAD2mcaWTm

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

Go to Top