Might someone remind me how I check whether an inbound MQTT arrives at my emonPi (which I use as my sole MQTT broker) &/or is then passed on out again?
I have set a separate RPi to send out MQTT messages, but they are not arriving on may Home Assistant instance. Being able to check what is happening on the emonPi will help fault finding.
So on the basis that the inbound MQTT messages are not being shown as Inputs within my emonPi, I will take it that the messages are not arriving. They used to, but for some reason stopped, so I will have to investigate why.
But there is no home/rtl topic within my emonCMS. And looking at the emonHub log file, I see no reference to the word rtl either. So perhaps it is not being generated on the other RPi.
Emoncms only picks up topics on a base topic you specify (by default emon).
Cannot see how they did. Wrong base topic.
Use an MQTT client and connect to the Broker, then you can see what is appearing at the broker (I use MQTT.fx from the Windows Store on my Win machine).
Thanks @borpin - I am obviously not the only one wanting to do this . I’m afraid that my Linux knowledge is sufficiently low as to not really understand a service file. But FWIW, these are the Dummies notes that I have cobbled together so far concerning restarting after boot …
.
.
. To make the Raspberry Pi start the process on boot up automatically, do the following
In Terminal type export & look for a line that is similar to declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
In my case it was declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
Type sudo nano YOURFILENAME.sh . In the file type (on 4 lines)
#!/bin/bash -x export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games***** sleep 20 rtl_433 -F json -M utc -R 43 | mosquitto_pub -t home/rtl_433 -l -h YOUR_MQTT_BROKER_IP -p 1883 -u YOUR_MQTT_BROKER_USERNAME -P YOUR_MQTT_BROKER_PASSWORD
… and then save it (Cntl+O, ENTER, Cntl+X)
Now make it executable with sudo chmod +x YOURFILENAME.sh
Test that it works by running sudo ./YOURFILENAME.sh and it should be OK.
==============================================
Up until this point all is fine for me, but when I did this yesterday I continued with the next bit but something broke. Not 100% sure my notes are quite right …
Open a new Terminal window and type sudo nano /etc/rc.local and put in it …
cd /home/pi(adjust path as required)
*/the/full/path/to/YOURFILENAME.sh & NB: Don’t forget the “&”; in my case, it was * cd /home/pi/jjbwatchman.sh & exit 0 NB: This line should already be there, but I include it here to show where to put these lines
Type sudo nohup ./YOURFILENAME.sh & (don’t forget the &)
Reboot the Pi and it should provide the Watchman data automatically from now on
`
I would like to send an MQTT message from Home Assistant to my emonPi which is my MQTT broker. The Topic Name is barns_pv, and this is the Actions section of an Automation.
Is it just a matter of adding a new “node” within emonHub, possibly something like this?
[[17]] #16 is the last node currently listed
nodename = barns_pv
[[[rx]]]
names = #not_sure_what_to_put_here#
datacodes = #not_sure_what_to_put_here#
scales = 1
units = W
whitening = 1