Sunday, October 9, 2016

Internet of Things (IoT): Raspberry Pi + DS18B20 + Eclipse KURA + Mosquitto + Eclipse Paho MQTT-P1

These posts describe a working set-up of following component:
  • Raspberry Pi 3
  • DS18B20 (1-Wire Digital Temperature Sensor)
  • Eclipse Kura (Eclipse Project: Framework for IoT Gateway)
  • Eclipse Mosquitto (Message Broker for MQTT)
  • Eclipse Paho MQTT (Eclipse Project: MQTT Client)

The post primarily discusses how to make above components work, however, we will try to provide the relevant resources throughout the posts.

We start off with connecting DS18B20 and Raspberry Pi, there are a number of online resources which helps to understand 1-wire sensor and how to connect them to Raspberry Pi, following are the two which I used:

Above links explains it in a detailed way, we instead look at another issue: in some cases, we come across an error when following command is executed: (discussed on the above links)

cat w1_slave

Error: w1_slave: No such file or directory

Generally when sensor is connected successfully and is working properly, upon executing following commands:

cd /sys/bus/w1/devices/

The list should show your sensor(s) as a directory with its name starting with ‘28-’, the name itself is a combination of characters and numbers. I experienced that in situations where sensor is not correctly working in fact not connected properly, the sensor directory name is although, a combination of characters and numbers but doesn’t start with ‘28-’. In these situation command: cat w1_slave returns the above error.

The source of the error, as mentioned earlier, could be incorrect connections, connecting wires not working properly, incorrect GPIO connections (Caution: As always be careful with GPIO connections).

I have attached some images from my working set-up below. I used 10K ohm resistor in my setup and Dallas Digital 1-Wire Temperature sensor.

No comments: