Don't understand configuring inputs from an external node

Hi, I’m trying to integrate the emonPi and my new Mk2PVrouter which is connected via RF433MHz.

Robin Emley tells me that the router transmits radio packets similar to an emonTX and, using these definitions for node [10] in emonHub.conf…

… I have got so far as seeing the values from the router on the emonHub log of the local emonCMS.

Where I’m hitting a snag is that on the inputs page of the local emonCMS I don’t see the three values transmitted by the router, I only see the rssi, which I think is the signal strength.

I think that I’ll need to see the three values as inputs from the router before I can start logging them in the emonCMS, but I don’t know what is my next step. Do I need to edit emonhub.conf to enable the rx from the router in some way?

Many thanks, David.

It maybe a little premature, but I’m going to hazard a guess here that it’s the underscores causing an issue.

The “Publishing: …” lines in emonhub.log suggest emonHub is publishing to MQTT ok, but recent debugging has suggested the emoncms’s MQTT input code is quite fussy about what is will or won’t process.

See this the tests I performed here

and also the more recent “Unable to use certain symbols in MQTT topics with emonCMS mqtt_input” discussion about certain characters in MQTT topics too.

As a quick test you can try subscribing to that topic from the command-line using

mosquitto_sub -v -u 'emonpi' -P 'emonpimqtt2016' -t 'emon/DW_mk2PVrouter/#'

(assuming the password etc is still stock)

If you get output you have confirmed the MQTT is there for the taking, but emoncms isn’t processing.

You could set the logging level to info in emoncms/settings.php and restart the mqtt_input script with

sudo service mqtt_input stop
sudo service mqtt_input start

then you will have more debugging info available in /var/log/emoncms.log, to view via emoncms or by reading the file directly.

Could you try removing the underscores from both the node name and the input names and try it again?

As for the rest of the node configuration in emonhub.conf, I cannot comment as I do not know the sketch output nor is there enough emonhub.log to deduce it.

For debugging would you mind copying and pasting logs and confs excerpts into the post rather than using screenshots, it makes debugging so much easier. If you use 3x backticks on the lines before and after the excerpt it will retain the formating and add vertical and horizontal scroll bars if required.

insert code, log or conf here

Thanks again Paul,

Are you saying that when everything is as it should be I will see the three inputs from the remote device in the inputs page? See below, Yes you are.

I tried

mosquitto_sub -v -u 'emonpi' -P 'emonpimqtt2016' -t 'emon/DW_mk2PVrouter/#'

and received this response. (btw only 1 x / needed at end of line)

How do I “set the logging level to info in emoncms/settings.php”?

I removed the underscores from my section in emonhub.conf which now reads

      units =W,W,W,W,V,C,C,C,C,C,C,p

[[10]]
    nodename = DWmk2PVrouter
    [[[rx]]]
       names = gridpower, divertedpower, vrms
       datacode = h
       scales = 1,1,0.01
       units =W,W,V

[[11]]
    nodename = 3phase

and when I restarted the mqtt_input script with…

sudo service mqtt_input stop
sudo service mqtt_input start

… the inputs page now looks like

So I’ll carry on and see if I can start to log that input data from the router.

Thanks for your help again.

Cheers, David

Oops! sorry that was a typo, I’ve corrected my previous post so as not to confuse any future users.

I looks like MQTT is ok with the underscores from that command’s respnose, But yes, you will need to avoid using them to post to emoncms via MQTT.

rpi-rw
sudo nano /var/www/emoncms/settings.php

should open the settings in a text editor and the lines relating to the log level are these
https://github.com/emoncms/emoncms/blob/master/default.settings.php#L132-L133

change it to “1” for a more verbose log, the mqtt_input requires restarting to take on the change, I doubt is was needed to the changes you made to be taken in, but no harm restarting it anyway. Although hopefully you will not be seeing any errors with the new naming, minus the underscores.