Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
MQTT Client
Re: MQTT Client
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...
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: MQTT Client
How does your topic definition in EG MQTT Client look like?
How does the mqtt event look like that you are publishing?
Are you able to see any mqtt message with another mqtt client? Like the MQTT.fx client?
How does the mqtt event look like that you are publishing?
Are you able to see any mqtt message with another mqtt client? Like the MQTT.fx client?
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: MQTT Client
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?
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: MQTT Client
Copy & paste some messages here so I can see the structure of themYes, with the MQTT.fx client, I am receiving the messages
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: MQTT Client
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
1447804039460-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: MQTT Client
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
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
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
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
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
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: MQTT Client
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
And...it works both with and without the leading slash!
So where do we go from here?
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: MQTT Client
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?
(If uncertain, always make a partial screen shot or copy & paste partly from your log, makes it easier to capture what you have working...and what is not)
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: MQTT Client
Good idea on the screenshot. This is EG's log of me testing it with the debugging print statements you asked me to insert into the code. Also, I have included the plugin settings window to see how I have it configured.
It appears I am not getting an event in EG. Does everything look okay so far?
It appears I am not getting an event in EG. Does everything look okay so far?
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: MQTT Client
It looks ok I think, you should receive events.
I have configured it similar and here it works when I publish a timestamp like that to a broker
PS just an idea! If you could change your setting to publish on the same broker & topic, I would expect that I would receive your time stamps and then I could see further what kind of problem there could be!
I have configured it similar and here it works when I publish a timestamp like that to a broker
PS just an idea! If you could change your setting to publish on the same broker & topic, I would expect that I would receive your time stamps and then I could see further what kind of problem there could be!
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: MQTT Client
OK, so I really have no idea what the heck changed, but somehow...it's now working. 
According to my best recollection, the only thing I changed was that I deleted the disabled "Keyboard" plugin from my EG configuration. I can't imagine that that would have anything to do with the MQTT plugin. In fact, I even re-added the keyboard plugin, re-disabled it, and re-tested MQTT, and it still worked. So, I cannot recreate the non-working situation.
Thank you so much, krambriw, for sticking with me to help me get your plugin working, even when it seems like it was some kind of issue on my side.
According to my best recollection, the only thing I changed was that I deleted the disabled "Keyboard" plugin from my EG configuration. I can't imagine that that would have anything to do with the MQTT plugin. In fact, I even re-added the keyboard plugin, re-disabled it, and re-tested MQTT, and it still worked. So, I cannot recreate the non-working situation.
Thank you so much, krambriw, for sticking with me to help me get your plugin working, even when it seems like it was some kind of issue on my side.
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: MQTT Client
Well, good to hear, finally a happy end
Best regards, Walter
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: MQTT Client
Your website seems to be down. Is you plugin available via github?
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: MQTT Client
Sorry for that, my apache server stops sharing from time to time ... unknown reason, trying to fix it now...
Should be accessible now again
Should be accessible now again
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM