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

Please provide example config files for the gateway #12

Closed ralight closed 7 years ago

ty4tw commented 8 years ago

see https://github.com/ty4tw/paho.mqtt-sn.embedded-c/wiki

/usr/local/etc/mqttsnGateway/config/param.conf Contents are follows:

BrokerName=test.mosquitto.org
BrokerPortNo=1883
SecureConnection=NO
#BrokerPortNo=8883
#SecureConnection=YES
ClientAuthorization=NO
GatewayID=1
GatewayName=PahoGateway-01
KeepAlive=900
#LoginID=
#Password=
BroadcastIP=225.1.1.1
GatewayPortNo=2000
BroadcastPortNo=1883

BrokerName to specify a domain name of the Broker, and BrokerPortNo is a port No of the Broker. If the Broker have to connected via TLS, set BrokerPortNo=8883 and SecureConnection=YES.

ralight commented 8 years ago

Yes that's good thanks, but could there be something in the repository as well please? And with detailed explanations of each parameter - what does GatewayID influence, for example? What is the difference between GatewayPortNo and BroadcastPortNo?

ty4tw commented 8 years ago

BroadcastIP and BroadcastPortNo is a multicast address for ADVERTISE, GWSEARCH and GWINFO messages. Gateway is waiting GWSEARCH multicast message and when receiving it send GWINFO message via Broadcast address. Clients can get the gateway address (Gateway IP address and GatewayPortNo) via GWINFO message by means of std::recvfrom(), Client should know the BroadcastIP and PortNo to send a SEARCHGW message.

GatewayId is defined by GWSEARCH message.

KeepAlive is a duration of ADVERTISE message in seconds.

when ClientAuthorization is YES, see MQTTSNGWClient.cpp line53, /usr/local/etc/mqttsnGateway/config/clientList.conf file is required. this file defines connect able clients by IPaddress and PortNo.

ty4tw commented 8 years ago

I made a pull request of conf files.

ty4tw commented 7 years ago

I did not answer the question, what does GatewayID influence, for example? GWINFO message has Length, MsgType, GwId and GwAdd. GatewayID is the GwId.

ty4tw commented 7 years ago

Hi Roger Light, Please close this issue.