ive installed the mqtt module for emoncms from trystans github page. installed SAM as well as its required.
i however cant find anything else on how to get going with it. in emoncms i have an extras tab with mqtt in it. so i guess the module is installed. however when i click on the mqtt button i get the following error:
Fatal error: Call to a member function fetch_array() on a non-object in C:\wamp\www\emoncms\Modules\mqtt\mqtt_model.php on line 26
Call Stack
# Time Memory Function Location
1 0.0020 156304 {main}( ) ..\index.php:0
2 0.0260 379264 controller( ) ..\index.php:107
3 0.0280 391704 mqtt_controller( ) ..\core.php:66
4 0.0280 401680 Mqtt->get( ) ..\mqtt_controller.php:26
any help would be appreciated.
i am running emoncms on windows 7 and using wampserver.
thanks
jason
Re: emoncms mqtt module
Anyone?
Am I getting no reply because I use Windows? ;)
Re: emoncms mqtt module
Possibly, but that's most likely because there seem to be a lot less WAMP users than Raspberry Pi users. I used to have WAMP on Windows XP, but this year I upgraded my laptop but it came with downgraded software (Win 8), so I upgraded the software to Ubuntu. Sorry, but I can't help.
Re: emoncms mqtt module
Thanks Robert,
Im going to install into ubuntu and see if I get the same error.
Re: emoncms mqtt module
ok, Ubuntu install works and the mqtt module loads via emoncms. So I guess there is some issue with Wamp, but Im abandoning that.
My next problem is how to configure the emoncms mqtt module? I have been using MQTT for a while but have never come across the "field" and "expression" config items. Can emoncms local receive published mqtt messages from this module?
Anyone with a sample config?
I have tried what I understand to be the best config I know but cant get the mqtt module to subscribe to my broker. Here is my config:
Host: IP Address = localhost
Port:=1883 [this should not be a fixed radio button. I use 1884 at home]
Node=1
Topic= 1/10/$P/151
Type=sub
qos=0
fields= <empty>
expression=<empty>
and under forward data to remote emoncms:
domain name=localhost [I only want to send to local emoncms inputs]
write api=<my api>
Thanks
Jason
Re: emoncms mqtt module
Hello Jason, I've been wondering whether adding a python MQTT listener to EmonHub might be a better way to go for doing this kind of thing, are you familiar with EmonHub?: https://github.com/emonhub
Re: emoncms mqtt module
Hi,
I just checked out emonhub and I think it combines emonbase and emoncms into a single box? Makes sense to me.
I modded my emonTx sketches to publish mqttsn messages instead of the standard struct data. Not much additional radio overhead, and I can bypass a emonbase and route via a broker to any/multiple mqtt clients - like emoncms and Openhab.
Is the intention then to not have the emoncms mqtt module and then have a standalone script [read yet another standalone script in Jason's setup] do the translation from mqtt to json?
What about getting data out of emoncms and publishing via mqtt? For me this would work as I want to use emoncms analytics in other application tools as well like Openhab.
Thanks
Jason