Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT-SN subscriptions dropped out #3275

Closed
martinezcp opened this issue Feb 28, 2020 · 2 comments
Closed

MQTT-SN subscriptions dropped out #3275

martinezcp opened this issue Feb 28, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@martinezcp
Copy link

martinezcp commented Feb 28, 2020

Environment

  • OS: Raspbian 4.19.97
  • Erlang/OTP: 22/10.6
  • EMQ: 4.02

Description

I have some devices connected through MQTT-SN which require to keep the subscriptions after they are disconnected from the gateway. I am pretty sure I have something not configured but I cannot find it.

I am trying with command line clients in order to see if everything is working or not. It works fine with the MQTT but it is not with MQTT-SN.

This works and keep subsription after disconnecting the client (Client receives messages after reconnecting)

mosquitto_sub -h 127.0.0.1 -p 11883 -q 1 -t "topic/test" -i "test_mqtt" -c

This works and client receives messages while it is connected but broker does not keep the subscription after disconnected. Neither it receives messages after reconnecting.

./mqtt-sn-sub -h 127.0.0.1 -p 5224 -q 1 -t "topic/test" -i "test_sn" -c

I think I need to update something in order to keep subscriptions for the SN part.

If I connect both clients, disconnect them and publish a message with:

mosquitto_pub -h 127.0.0.1 -p 11883 -q 1 -t "topic/test" -m "hello"

After reconnecting both clients, the mqtt is the only one receiving the message.

Whenever I connect a SN client, the log shows the following:

2020-02-28 09:59:51.492 [error] <<"test_sn">> MQTT-SN(127.0.0.1:35358): StateName: idle, Unexpected Event: {cast,
                                                          {event,
                                                           connected}}
2020-02-28 09:59:51.499 [error] <<"test_sn">> MQTT-SN(127.0.0.1:35358): StateName: connected, Unexpected Event: {cast,
                                                               {event,
                                                                updated}}
@HJianBo HJianBo self-assigned this Mar 5, 2020
@HJianBo HJianBo added this to the 4.0.4 milestone Mar 5, 2020
@HJianBo HJianBo pinned this issue Mar 6, 2020
@HJianBo HJianBo unpinned this issue Mar 6, 2020
@HJianBo HJianBo added the BUG label Mar 6, 2020
@HJianBo HJianBo modified the milestones: 4.0.4, 4.1-beta.1 Mar 6, 2020
@HJianBo
Copy link
Member

HJianBo commented Mar 6, 2020

Hi, @martinezcp It is a bug to handle the Clean Session mechanism. We are very sorry to bring trouble to you.

We plan to fix it at next next version (may 4.1.beta.1 or 4.0.5

Thanks for your report here :)

@HJianBo
Copy link
Member

HJianBo commented Mar 17, 2020

Hi, @martinezcp We have fixed it in v4.0.5

@HJianBo HJianBo closed this as completed Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants