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?
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.
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.
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).