Using Mosquito on another machine

Hi guys

 

Newbie to Emoncms and OEM in general....learning fast!

 

Ive got a emonbase up and running on a Rpi ModelB, and i have one emonTX and 2x emonTX shields connected to it.. they are not yet wired to CT's but are sending some dummy data.

I also have on my network a debian linux VM, which i run OpenHab /mosquito and some other bits and bobs.

I would like to run EmonHUB there on the Linux VM also ultimately, but happy to do small steps first.

 

So since i wish to pull data from emoncms into openhab i though i would try to use the Mosquito running on the VM and ignore the one on the RPI.

I saw that inside emonhub.conf there is 

     mqtt_host =127.0.0.1

so i changed this to the IP of my existing mosquito and restarted.

It looked good initially... i could see in mosquito the messages from emonhub, but then i noticed that within emoncms/nodes/view that they were all "inactive".... i reverted the config back to 127.0.0.1 ,restarted and the Nodes came back!

So how or where can i modifiy emoncms to also pull data from the remote mosquito instance??

 

Hope the above makes sense and thanks for reading.

 

Greg

 

 

glyn.hudson's picture

Re: Using Mosquito on another machine

Hi greg,

You have got emoHub posting Ok to MQTT, you also need to set Emoncms Nodes module to subscribe to that topic on another server. 

You can either just set the IP address in /var/www/emoncms/Modules/nodes/nodes_mqtt_process.php

 https://github.com/emoncms/nodes/blob/master/nodes_mqtt_process.php#L58

Or update your nodes module to 9.0 git branch:

cd  /var/www/emoncms/Modules/nodes/

git checkout 9.0

The set the server IP in /var/www/emoncms/settings.php

e.g: https://github.com/emoncms/emoncms/blob/master/default.settings.php#L24

 

Your emonPi / emonBase will be running the older 'low-write' emoncms branch, this does not yet support authenticating with Mosquitto. This has been added to latest master branch of Emoncms V9. However this is quite a bit update. I would recommend moving to the new pre-built image if you want to update: http://openenergymonitor.org/emon/node/11799

gregl's picture

Re: Using Mosquito on another machine

Hi Glyn,

Success - i updated nodes_mqtt_process.php as you mentioned, restarted and it worked! Thanks!

I didnt mention it previously, but i actually have emoncms v9.2 (2015.12.11) installed on my Linux VM.

I followed this guide:
https://github.com/emoncms/emoncms/blob/master/docs/LinuxInstall.md

Of the additional modules, I have the MQTT module added, but unsure if this is correct??

Im not sure what config items it needs. Obviously i have set the IP address to that of my mosquito and port 1883. I also set Node 11 ( which is one of my emonTX shields ) and Topic "emonhub/11"

..but that doesnt seem to add anything to Feeds or Inputs...i dont have a Nodes module, but i *think* this is only for configuring a node coming in over the RF???

I also see https://github.com/emoncms/emoncms/blob/stable/docs/RaspberryPi/MQTT.md

Could this be what i should be following??

 

 

Thanks again!

 

Greg

 

 

glyn.hudson's picture

Re: Using Mosquito on another machine

Hi Greg,

The nodes module has been designed for use with emonHub but will allow posting to Emoncms from MQTT. Once installed the nodes modules will post to

emonhub/rx/10/values
a csv string: e.g100,200,300
that will appear as a node in the nodes interface which can then be logged to a feed

We are working on an update to the nodes module to make using it much easier and give better MQTT support

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.