Kevin, yesterday my internet connection went down for 2 or 3 minutes and guess what ? EG couldn't reconnect to the xmpp server, so it's not yet fixed
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.
XMPP Plus
Re: XMPP Plus
you could check this easily, try to add the plugin again (even if it's already installed), and you will see the version of the plugin, then just press "Cancel" when you're done. But, yes your idea is good, we should be able to see the version of any plugin upon start 
Kevin, yesterday my internet connection went down for 2 or 3 minutes and guess what ? EG couldn't reconnect to the xmpp server, so it's not yet fixed
as soon as I restarted EG, it worked right away.
Kevin, yesterday my internet connection went down for 2 or 3 minutes and guess what ? EG couldn't reconnect to the xmpp server, so it's not yet fixed
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: XMPP Plus
I have found the issue.
even tho this code gets executed
it is supposed to loop if a server connection is not made. well guess what.. this thing doesn't loop because if there is a socket error it will still report back that he server connection has been made. guess the author of sleekxmpp made a HUGE mistake in the code.
I have coded around this to fix that and several other issues, one being the session ended getting called back after the socket error. the session should end first then report the socket error.
I have also added the reason for the socket disconnection as a payload to the socket error event. This way we will know why the thing has disconnected.
It will loop until the end of time. or until your computer stops running. every 10 seconds trying to reconnect.. I have tested this bugger upside down left and right it works and I have not been able to find a glitch in it. But as always you have my famous warranty. the same warranty i give to people when i work on their cars.. the tail light warranty. as soon as i see your tail lights your warranty has expired
I also added the version number to the name of the plugin so when the plugin loads you will see it in the log...
check this thing first before i attach it to the first post please.
even tho this code gets executed
Code: Select all
while not self._client.connect(address, reattempt=False):
if self._socket_error:
self.shutting_down_event.wait(10)
if self._shutting_down_event.isSet():
return
t = threading.Thread(
target=self._connect
)
t.daemon = True
t.start()
return
self._shutting_down_event.wait(2)
if self._shutting_down_event.isSet():
return
I have coded around this to fix that and several other issues, one being the session ended getting called back after the socket error. the session should end first then report the socket error.
I have also added the reason for the socket disconnection as a payload to the socket error event. This way we will know why the thing has disconnected.
It will loop until the end of time. or until your computer stops running. every 10 seconds trying to reconnect.. I have tested this bugger upside down left and right it works and I have not been able to find a glitch in it. But as always you have my famous warranty. the same warranty i give to people when i work on their cars.. the tail light warranty. as soon as i see your tail lights your warranty has expired
I also added the version number to the name of the plugin so when the plugin loads you will see it in the log...
check this thing first before i attach it to the first post please.
- Attachments
-
- XMPPPlus-1.2.5b.egplugin
- (538.76 KiB) Downloaded 45 times
Re: XMPP Plus
good job !! I guess my final clue helped you a little
.
I installed it a few hours ago, so far so good, I will let you know what happens in the next couple of days. BTW, I really like the version being displayed
it should be in every future plugins 
I installed it a few hours ago, so far so good, I will let you know what happens in the next couple of days. BTW, I really like the version being displayed
-
HTPCanwender
- Experienced User
- Posts: 89
- Joined: Wed Feb 08, 2012 9:41 pm
- Location: Germany
Re: XMPP Plus
I just started testing. I will keep you informed what is happening.
Thank You
Thank You
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: XMPP Plus
well i have been looking at the code trying to figure out why the thing was not reconnecting. and why there were only 2 socket disconnects. so i was thinking it was it was an issue with how i have the timing and thread locks set up. and that is what i have been focusing on... i wasn't paying attention to the one clue. the 2 socket error events.. my system was doing the same thing as well but it was doing it on a single connection. i then noticed that and said to myself.... hmmm... 2 events for the single drop in connection. when i got the thing to spit out the error with it it all became apparent. the first error is from the actual drop in connection. the second is from something that is getting sent down the broken socket. it doesn't always produce 2 errors. so that clued me in to the fact that the loop was returning true even if there is no connection made. thus not running my code.
-
HTPCanwender
- Experienced User
- Posts: 89
- Joined: Wed Feb 08, 2012 9:41 pm
- Location: Germany
Re: XMPP Plus
Until now, everything works fine.
I have two additional proposals.
1) I have installed a XMPP client on my android smartphone to control my homeserver with special commands. When I am moving (different WLANs and phone cells) I am getting really many "Incoming.Presence" events. It would be nice if it is possible to switch them off in the plugin configuration menu.
2) A "Get Sender" command could be added.
I have two additional proposals.
1) I have installed a XMPP client on my android smartphone to control my homeserver with special commands. When I am moving (different WLANs and phone cells) I am getting really many "Incoming.Presence" events. It would be nice if it is possible to switch them off in the plugin configuration menu.
2) A "Get Sender" command could be added.
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: XMPP Plus
you can switch them off.
and you can get the sender of a message or a presence.
the payload is a python object. that object represents what was received and it has several functions and properties attached to it.
so as far as the presences go if you put this code into a python script
and if you want to get the senders name
with the code above you can access the sender by using eg.result. an example would be the osd action. if you put {eg.result} in the text to display field it will grab the senders name.
the available objects caused by events and what you can do with them
presence.priority - gets the priority of the presence
presence.type - the presence type
presence.sender - the jid of the person who sent the presence change
presence.status - the custom message supplied by the user in a presence change
presence.unsubscribe() - unsubscribes from getting presence announcements from that sender
message receipt events will only show if the person sending the message requests one.
message_receipt.type
message_receipt.sender
message_receipt.room
message_receipt.body
message_receipt.subject
message_receipt.send_receipt() - send a receipt for the message
message.type - the type of message
message.sender
message.room - the room the person is in that is sending the message (pm)
message.body - the message
message.subject - the subject
message.send_reply(msg) - using this function you would replace the msg with the reply you want to send.
and you can get the sender of a message or a presence.
the payload is a python object. that object represents what was received and it has several functions and properties attached to it.
so as far as the presences go if you put this code into a python script
Code: Select all
presence = eg.event.payload
if presence.sender == 'ENTER SENDER JID HERE':
presence.unsubscribe()
Code: Select all
message = eg.event.payload
result = message.sender
the available objects caused by events and what you can do with them
presence.priority - gets the priority of the presence
presence.type - the presence type
presence.sender - the jid of the person who sent the presence change
presence.status - the custom message supplied by the user in a presence change
presence.unsubscribe() - unsubscribes from getting presence announcements from that sender
message receipt events will only show if the person sending the message requests one.
message_receipt.type
message_receipt.sender
message_receipt.room
message_receipt.body
message_receipt.subject
message_receipt.send_receipt() - send a receipt for the message
message.type - the type of message
message.sender
message.room - the room the person is in that is sending the message (pm)
message.body - the message
message.subject - the subject
message.send_reply(msg) - using this function you would replace the msg with the reply you want to send.
Re: XMPP Plus
in the mqtt plugin there is a neat feature that shows us when the connection is lost and it's trying to reconnect, here's a sample :
I'm sure you know what is the next question
could you implement this in XMPP ?
Code: Select all
24/05 21:07:07 Retrying to re-connect
24/05 21:07:07 MQTT Client: Trying to reconnect with...
24/05 21:07:12 Retrying to re-connect
24/05 21:07:12 MQTT Client: Trying to reconnect with...
24/05 21:07:17 Retrying to re-connect
24/05 21:07:17 MQTT Client: Trying to reconnect with...
24/05 21:07:22 Retrying to re-connect
24/05 21:07:22 MQTT Client: Trying to reconnect with...
24/05 21:07:27 Retrying to re-connect
24/05 21:07:27 MQTT Client: Trying to reconnect with...
24/05 21:07:32 Retrying to re-connect
24/05 21:07:32 MQTT Client: Trying to reconnect with...-
HTPCanwender
- Experienced User
- Posts: 89
- Joined: Wed Feb 08, 2012 9:41 pm
- Location: Germany
Re: XMPP Plus
Here it is. The connection to the XMPP server got lost and was new established.
09:13:13 [email protected]
09:13:13 [email protected]
09:13:13 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x07403270>
09:13:13 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x0B63F0D0>
09:13:13 [email protected]
21:18:45 [email protected]
21:18:45 XMPPPlus.jabber.de:5222.SocketError '[Errno 10060] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat'
21:20:00 [email protected]
21:20:00 [email protected]
21:20:00 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x06A81C10>
21:20:00 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x0BB48F70>
21:20:00 [email protected]
09:13:13 [email protected]
09:13:13 [email protected]
09:13:13 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x07403270>
09:13:13 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x0B63F0D0>
09:13:13 [email protected]
21:18:45 [email protected]
21:18:45 XMPPPlus.jabber.de:5222.SocketError '[Errno 10060] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat'
21:20:00 [email protected]
21:20:00 [email protected]
21:20:00 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x06A81C10>
21:20:00 [email protected] <eg.CorePluginModule.XMPPPlus.Presence object at 0x0BB48F70>
21:20:00 [email protected]
Re: XMPP Plus
it took 5 minutes to reconnect ? or your connection or the server was down for 5 minutes ?
-
HTPCanwender
- Experienced User
- Posts: 89
- Joined: Wed Feb 08, 2012 9:41 pm
- Location: Germany
Re: XMPP Plus
From 21:18:45 to 21:20:00 there are only 75 seconds, not 5 minutes.
Re: XMPP Plus
oh, sorry i didn't read well your log
so everything is fine, that's cool
so everything is fine, that's cool
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: XMPP Plus
it does show you when the connection is lost and when it is re established.
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: XMPP Plus
the plugin is only going to spit out connection failures attempts if it is a socket error. if you want events for a general connection failure i can do that as well.
Re: XMPP Plus
ok, fine but will it repeat over and over when the connection can not be made ? this way we will know exactly how long the connection wasn't established.
