Author Topic: [SOLVED] Connection lost to MQTT  (Read 1760 times)

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: Connection lost to MQTT
« Reply #15 on: June 18, 2016, 06:00:54 pm »
Sorry about this! There were a few issues around recovering from broken links or connections that can't start (due to invalid address at the time). I thought I had addressed them all. I will look at this issue again. Thanks for testing and reporting back.
« Last Edit: June 18, 2016, 06:09:40 pm by mc-Abe »

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Connection lost to MQTT
« Reply #16 on: June 19, 2016, 12:56:41 am »
No problem, let us know if you want us to test and verify something.

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: Connection lost to MQTT
« Reply #17 on: June 20, 2016, 04:26:42 pm »
I am trying to reproduce this problem and I don't seem to be able to crash the gateway as you guys have described here. Clearly I am missing something. My gateway is configured with the IP address of my machine and the port of the broker. Also using mosquitto version 1.4.8 (build date 14/02/2016 15:33:31.09). I cannot make the gateway hang if the MQTT broker is stopped or not started at all.

I have started the gateway with the new configurations and the broker stopped. Then started the broker and you can see the connection established and data comming in. I then stopped the broker and started it again for good measure. The connection is restablished and more data is coming in.

What am I doing different than you guys that I cannot crash my gateway?

Code: [Select]
c:\Program Files (x86)\mosquitto>mosquitto.exe -p 1883 -v
1466457786: mosquitto version 1.4.8 (build date 14/02/2016 15:33:31.09) starting
1466457786: Using default config.
1466457786: Opening ipv6 listen socket on port 1883.
1466457786: Opening ipv4 listen socket on port 1883.
1466457790: New connection from 10.1.1.140 on port 1883.
1466457790: New client connected from 10.1.1.140 as 00010B51 (c1, k20, u'').
1466457790: Sending CONNACK to 00010B51 (0, 0)
1466457800: Received PINGREQ from 00010B51
1466457800: Sending PINGRESP to 00010B51
1466457802: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457806: mosquitto version 1.4.8 terminating

c:\Program Files (x86)\mosquitto>mosquitto.exe -p 1883 -v
1466457812: mosquitto version 1.4.8 (build date 14/02/2016 15:33:31.09) starting
1466457812: Using default config.
1466457812: Opening ipv6 listen socket on port 1883.
1466457812: Opening ipv4 listen socket on port 1883.
1466457814: New connection from 10.1.1.140 on port 1883.
1466457814: New client connected from 10.1.1.140 as 00010B51 (c1, k20, u'').
1466457814: Sending CONNACK to 00010B51 (0, 0)
1466457822: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457822: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457822: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457822: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457823: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457823: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457823: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457823: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457823: Received PUBLISH from 00010B51 (d0, q0, r0, m0, 'mcThings/beacon', ... (13 bytes))
1466457823: mosquitto version 1.4.8 terminating

[ Guests cannot view attachments ]

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Connection lost to MQTT
« Reply #18 on: June 20, 2016, 04:41:59 pm »
Well it seems that you and I is doing exactly the same.
That's strange. And you are using exactly the same version that is provided on your download page?
And you are not running the mcGateway in some sort of debug mode and that is the difference between our tests?

Maybe we could arrange some tests where you is connected to my broker and that I terminates the broker and maybe I could test against yours just to see what happens then.
Now the time here is 23:45 so if we should test then tomorrow is better for me.

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: Connection lost to MQTT
« Reply #19 on: June 20, 2016, 05:11:32 pm »
That would be great! I will send you a private message tomorrow morning when I get in. Should be around 3pm your time. We can schedule something then that works for you.
Like Like x 1 View List

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: Connection lost to MQTT
« Reply #20 on: June 21, 2016, 04:52:55 pm »
I believe we have now resolved this issue and it will included in the next mc-Gateway release. Kudos to kristofferis for all his help with the debugging and verifying the fix.
Like Like x 1 View List

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Connection lost to MQTT
« Reply #21 on: June 23, 2016, 06:40:25 am »
Was just going to chime in and say I changed the port on my mqtt server and was unable to reconfigure the gateway until I changed my port back rebooted my gateway again (tried this with the new port first) and then I could set the new port on the gateway, change the broker port and reboot the gateway.
McGateway 0.6-360, 0.7-405
McModules 0.7-358
McStudio 0.7-894

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Connection lost to MQTT
« Reply #22 on: June 23, 2016, 06:57:14 am »
Yes, this is the same bug that is resolved in next release.

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Connection lost to MQTT
« Reply #23 on: June 23, 2016, 04:03:32 pm »
I have now verified the new version V0.6-358 and the issue is solved.