Community
OpenEnergyMonitor

Community

Configure emonhub.conf Reading data from gpio


(Hans) #1

Hi,

I am trying to upgrade my emonpi. I’ve already installed a RPICT4T4 which works fine.

No I like to add more temperature sensors. On a 2nd Raspi I got 10 DS18B20 working on gpio4. Now I want to connect at the emon-raspi and emoncms. I am wondering how to configure '/home/pi/data/emonhub.conf` that these temperatures are availble as nodes inside emoncms. In the documentation I don’t find advise for that matter.

My question: How to setup emonhub.conf to read data from gpio directly?

Regards


[solved] No Inputs in input list
(Paul) #2

The quick answer is “you can’t!”, but it is possible in-directly.

There is currently no emonhub interfacer published to do what you ask. I have used custom scripts to read ds18b20’s via the Pi’s GPIO and submit via an emonhub socket interfacer. I recently had 88 ds18b20’s connected to a Pi via 8 separate buses on 8 GPIO pins so that all 88 sensors could be read at full resolution comfortably within 10secs.

If this method is of interest to you I can perhaps share some code to get you started.


(Hans) #3

It sounds exactly to my plan. I have 8 ds18b20 on a single GPIO. Until today I have no problems. I have cable length between 1 and 5 m on this finger.

I have a small script from somewhere which prints the temperature on screen. So, I proceed to build a dictionary and send the data like described by the Input-API.

What would be the best method in this case? If you have some hints or a snipped for that, I would be glad.


(Hans) #4

Here the code for reading sensors:
ds18b20_read.py.txt (689 Bytes)


(Brian Orpin) #5

Just fire it via MQTT with a base topic of emon.


(Hans) #6

I’m sorry. I don’t see your point. I have absolutly no idea how to configure and perform this. Maybe tomorrow I have enough time to study.


(Brian Orpin) #7

Search for “Python MQTT post”. It will throw up this (these tutorials are pretty good) http://www.steves-internet-guide.com/into-mqtt-python-client/

Use the base topic emon and the sensor data either as a JSON object or individual values with their own topics. You will need the username an password for the MQTT broker on the EmonPi (it’s in the docs somewhere).


(Hans) #8

:star_struck: Never searched outside of this forum for that. Thanks:+1: