eclipse / paho.mqtt-sn.embedded-c

Paho C MQTT-SN gateway and libraries for embedded systems. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
315 stars 178 forks source link

mqtt-sn-gateway cross-compiled and it seems crased on the startup #148

Closed ranjitsinh-rathod closed 5 years ago

ranjitsinh-rathod commented 5 years ago

Hi I am new for the mqtt-sn-gateway and have cross compiled this package for my gateway. Now when I am trying to run this application it is not able to start and crashed into startup only.

I have used the default config files only.

I am getting below prints on the start:

terminate called after throwing an instance of 'MQTTSNGW::Exception' what(): Can't open the sensor network.

Can you please suggest what can be the issue?

Many thanks.

ranjitsinh-rathod commented 5 years ago

One update: When I have enabled debug prints from the MQTTSNGWDefined.h files, I got the output as below: error Multicast IP_ADD_MEMBERSHIP in UDPPort::open terminate called after throwing an instance of 'MQTTSNGW::Exception' what(): Can't open the sensor network.

Aborted (core dumped)

ty4tw commented 5 years ago

Hi ranjitsinh,

Sorry for the late reply. Dose your environment allow to use Multicast UDP?

ranjitsinh-rathod commented 5 years ago

Thanks, Tomoaki.

When I have done further debugging, I have resolved the issue with increasing multicast group count from using below.

$ echo 20 > /proc/sys/net/ipv4/igmp_max_memberships

As a default, in my systerm, this variable is set to zero and so it is unable to add an entry in a multicast group.