Re: MQTT Client
Posted: Sat Oct 03, 2015 12:56 pm
Thanx a lot 
Can you share what you did to fix it? I am experiencing the same issue that you had (i.e. no MQTT messages being seen by EG's MQTT client, with or without the leading "/").mlava wrote:Scratch all that...
I now have it working, it was more about the format of the topic definitions on my side, not a problem with the plugin.
Sorry to have wasted your time! Silly me...
I am testing with the topic as:krambriw wrote:How does your topic definition in EG MQTT Client look like?
Code: Select all
eventghost/#I am using Node-RED (from a Raspberry Pi on my LAN) to test the MQTT on Eventghost. Currently, I am just sending a timestamp as the payload.krambriw wrote:How does the mqtt event look like that you are publishing?
Yes, with the MQTT.fx client, I am receiving the messages. And my mosquitto broker's log says that it is sending the messages to my Eventghost (best that I can tell, at least). However, even with EG's log set to show unassigned events, I see nothing that shows it's receiving the MQTT messages. Any idea what's going on?krambriw wrote:Are you able to see any mqtt message with another mqtt client? Like the MQTT.fx client?
Copy & paste some messages here so I can see the structure of themYes, with the MQTT.fx client, I am receiving the messages
I'm not sure if I'm misunderstanding you, or if I've confused you. I am sending MQTT messages from Node-RED on my R-Pi to Eventghost on my PC. For testing purposes, I am simply sending a timestamp. If the copy/paste of the message helps, here is one:krambriw wrote:Copy & paste some messages here so I can see the structure of them
Code: Select all
1447804039460Code: Select all
print msg.topic
print msg.payload
On mosquitto's man page, all their examples have no leading slash, so I was doing the same. If you mean that your plugin is expecting that leading slash, then so be it.krambriw wrote:OK, fine, I see
The thing is that in general topics need to be with a leading slash (/)
So in your case, you have to set the topic to /eventghost/#
When you publish the timestamp in the RPi, you have to publish it to the topic /eventghost
After adding those lines to the code, I can see the printouts in EG's log! Yay!krambriw wrote:If this still does not work, we could start debugging. Open the __init__.py file for the MQTT Client plugin with a text editor, insert the following code at line 173, save and restart EG
Code: Select all
print msg.topic print msg.payload
PS another possible solution could eventually work if you use the topic NRED (without leading slash) on both sides. In EG, configure the topic as NRED/# and in RPi, publish to topic NRED
Yeah, that is needed in the normal case (with some special exceptions for the topics NRED, switchking, nethomeserver, zwave and rfxtrx, then it is not needed. You see them if you scroll down the code )If you mean that your plugin is expecting that leading slash
OK, so the correct time stamp is now printed. Do you also see it as event in the EG log on the left side? If so, you can comment out or delete those lines we just added. Next is to start using the event to trigger macros...or just...I don't know what you wanna do. I guess the time stamp was just a test signal. If you have other information to transfer from the RPi, the principal is the same.So where do we go from here?