emqx / emqx-sn

EMQX MQTT-SN Gateway
https://www.emqx.com
Apache License 2.0
30 stars 20 forks source link

Shutdown due to idle timeout #110

Open saschathiergart opened 5 years ago

saschathiergart commented 5 years ago

Using emqx version 3.0 with the MQTT-SN plugin i get the following error messages:

2019-04-24 07:47:21.452 [error] MQTT-SN(127.0.0.1:40289): shutdown due to idle_timeout
2019-04-24 07:47:21.452 [error] MQTT-SN(172.17.0.2:40289): shutdown due to idle_timeout
2019-04-24 07:47:21.453 [error] MQTT-SN(172.17.0.1:38892): shutdown due to idle_timeout
2019-04-24 07:47:36.453 [error] MQTT-SN(127.0.0.1:40289): shutdown due to idle_timeout
2019-04-24 07:47:36.454 [error] MQTT-SN(172.17.0.2:40289): shutdown due to idle_timeout
2019-04-24 07:47:36.454 [error] MQTT-SN(172.17.0.1:38892): shutdown due to idle_timeout

Any idea what might be the problem?

ServerTech commented 5 years ago

Hi, I have this issue too. I attempted a rather large series of messages sent and received.

At first, I set the keepalive timeout in the CONNECT packet to 120 seconds. After these 120 seconds have passed, the server disconnects my device automatically, which is not expected as I've been communicating with the server every few seconds. I attempted to also send PINREQs every 10 seconds (but I am not responding to PINGREQ sent by the server---as far as I know it does not send any), this did not fix the issue either.

However, increasing the timeout in the CONNECT packet to 10 minutes works correctly.

EMQX v3.1-rc.3

gilbertwong96 commented 5 years ago

@pritstift Sorry for late response, the mqtt-sn gateway is in idle state which means that mqtt-sn gateway has not received connect packet of mqtt protocol. The default idle timeout value of this state has been hard coded as 10s. So if you do nothing for a long time which longer than 10s in idle state of emqx-sn gateway. It will log shutdown due to idle_timeout error.

gilbertwong96 commented 5 years ago

Hi, @ServerTech , is the device you refered is mqtt-sn device rather mqtt device?

saschathiergart commented 5 years ago

@Gilbert-Wong Thanks for the info. What is the reason that an idle timeout is required? Logging shutdown due to idle_timeout every 10 secs is not very helpful if no device does connect using mqtt-sn for some time. It may be useful to either configure a higher timeout or to turn off logging of this error. What would be the implications of a higher timeout?

pratikguru commented 5 years ago

@Gilbert-Wong answering for @ServerTech . Yes, It is an MQTT-SN device.

ServerTech commented 5 years ago

@Gilbert-Wong I was presuming that talking to the gateway in any shape or form resets the keepalive timer. Originally set to 120 seconds in the CONNECT packet, I publish and receive subscription messages every 10-15 seconds or so, and the gateway disconnects the device (and does not respond to subsequent PUBLISH messages) after the 120 seconds have passed.

As mentioned in the previous message, I also attempted to send frequent PINGREQs (with successful PINGRESPs from the server). The server still disconnects me once the 120 seconds have passed.

However, I was able to fix this by setting the keepalive timeout in the CONNECT packet to an unreasonably high value of 10 minutes (which means that I'll be able to keep the connection active for 10 minutes).

Am I doing something wrong and misunderstanding the protocol, or is the keepalive bugged?'

P.S. Yes, it's over MQTT-SN.

ServerTech commented 5 years ago

I believe we are speaking of a slightly different issue. Mine is with the gateway disconnecting the device after the timeout expires (however the timer should have been reset). I will open a new issue. Apologies!

gilbertwong96 commented 5 years ago

Never mind. On May 7, 2019, 5:08 PM +0800, Shreyas Vinod notifications@github.com, wrote:

I believe we are speaking of a slightly different issue. Mine is with the gateway disconnecting the device after the timeout expires (however the timer should have been reset). I will open a new issue. Apologies!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/emqx/emqx-sn/issues/110#issuecomment-489999672, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4H5U7ZA64SPFKKCEJ2BZLPUFBIXANCNFSM4HIBINGQ.

saschathiergart commented 5 years ago

@Gilbert-Wong Are there any updates on this yet?

gilbertwong96 commented 5 years ago

It would be fixed in emqx-3.2-rc.1

saschathiergart commented 5 years ago

What is the timeline on that rc?

Gilbert notifications@github.com schrieb am Mi. 19. Juni 2019 um 08:04:

It would be fixed in emqx-3.2-rc.1

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/emqx/emqx-sn/issues/110?email_source=notifications&email_token=ABBYYMWPMFBUWPT3THPSNILP3HD7JA5CNFSM4HIBING2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYAZFNQ#issuecomment-503419574, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBYYMSZFMNHN4A6M6HVXMTP3HD7JANCNFSM4HIBINGQ .

-- Embever GmbH, Carl-Miller-Straße 6, 39112 Magdeburg

info@embever.com mailto:info@embever.com embever.com http://embever.com

Registergericht: Amtsgericht Stendal, HRB: 25007,  Ust.-ID: DE315088960,

Geschäftsführer: Sascha Thiergart und Prof. Dr. Andreas Welling

Bitte beachten Sie: Im Zuge der E-Mail-Korrespondenz werden persönliche Daten gespeichert und verarbeitet. Näheres entnehmen Sie bitte unserer Datenschutzerklärung https://embever.com/privacy-policy/.

Die Embever GmbH wird durch das Ministerium für Wirtschaft, Wissenschaft und Digitalisierung des Landes Sachsen-Anhalt und die Europäische Union  gefördert.

gilbertwong96 commented 5 years ago

Hi, @pritstift, emqx-3.2-rc.1 has been released now. Welcome to try it.