I changed the first parameter of the select() function from "1" to _fd+1.
For above change, I can get data from ZigBee clients to the MQTT-SN Gateway on raspberry pi 2, but I still cannot run the gateway on raspberry pi 3. After changing the below code, MQTT-SN Gateway is properly worked on both raspberry pi 2 and raspberry pi 3.
Hello,
I have used Tomoaki yamaguchi's old MQTT-SN Gateway (https://github.com/ty4tw/MQTT-SN/tree/master/Gateway#mqtt-sn-gateway) on raspberry pi, and I recently know that Eclipse Paho project supports MQTT-SN Gateway.
So, I just tried to change old MQTT-SN Gateway to new Paho one.
During migration, I noticed that there are some issues for using the current Paho MQTT-SN Gateway with XBee on raspberry pi.
I cannot run the MQTT-SN Gateway with XBee on raspberry pi which is uploaded on the master, so I modified some codes in SensorNetwork.cpp.
The main issue is that I cannot get any data from ZigBee clients such as arduinos, so I just changed the below code in SensorNetwork.cpp.
I changed the first parameter of the select() function from "1" to _fd+1.
For above change, I can get data from ZigBee clients to the MQTT-SN Gateway on raspberry pi 2, but I still cannot run the gateway on raspberry pi 3. After changing the below code, MQTT-SN Gateway is properly worked on both raspberry pi 2 and raspberry pi 3.
I added flag CREAD which is also used in Tomy's old gateway to open serial port.
I'm not sure it is a right way to fix the problem, but at least I need to fix these codes to run on my raspberry pi.