emqx-sn icon indicating copy to clipboard operation
emqx-sn copied to clipboard

SEARCHGW should always be answered by gateway

Open jmpmscorp opened this issue 6 years ago • 0 comments

Hi.

I'm developing wireless sensor network through Xbee, so I have developed xbee-udp forwarder (without forwarder encapsulation 0xFE, at the moment) to bridge xbee with emqx broker. I have problems if a connected node sends SEARCHGW packet. An error like below is launched:

23:52:36.533 [error] MQTT-SN(192.168.1.38:63251): asleep UNEXPECTED Event: {mqtt_sn_message,1,0}

or

23:56:13.700 [error] MQTT-SN(192.168.1.38:63251): connected UNEXPECTED Event: {mqtt_sn_message,1,0}

depending on sleep or non-sleep node.

I think that every SEARCHGW packets should be answered. Why? Sometimes a node can be restarted manually or maybe it suffers an operation/hardware error and it's restared accidentally. When they turn on again and, in the case nodes haven't set gateway address on firmware or software config, they should ask for gateway id before they can connect to GW again.

Now, I can't reconnect wireless nodes if they are restared due to SEARCHGW is not reply unless I force disconnection on xbee-udp forwarder.

Thank and regards.

jmpmscorp avatar Sep 24 '18 22:09 jmpmscorp