Configuring to work with MQTT broker with user name and password
Home › Forums › Lora Network Server › Configuring to work with MQTT broker with user name and password
- This topic has 4 replies, 2 voices, and was last updated 7 years, 8 months ago by
Brian Roberts.
-
AuthorPosts
-
July 27, 2017 at 1:25 pm #20379
Brian Roberts
ParticipantI have my LoRa Network Server configured to publish messages to the Mosquitto MQTT broker. Currently this only works if I have “allow_anonymous true” set in the mosquitto.conf file. Is their a way to tell the LoRa Network Server to use a user name and password when connecting to the MQTT broker? I’m wondering if I can set this in the lora-network-server.conf file.
My lora-network-server.conf file:
{ "lora": { "netID": "010203", /* netID for beacon packets */ "frequencyBand": "915", /* US="915", EU="868" */ "frequencySubBand": 7, /* Sub-band for US operation, 1-8 */ "rx1DatarateOffset": 0, /* Datarate offset for mote rx window 1 sent in join response (0-3) */ "rx2Datarate": 8, /* Datarate for mote rx window 2 sent in join response (7-12) */ "maxTxPower": 26, /* Max Tx power (dBm), -6 to 26 */ "frequencyEU": 867500000 /* center freq for extra EU channels (Hz) */ }, "udp": { "appPortUp": 1784, /* port for user-developed application use */ "appPortDown": 1786 /* port for user-developed application use */ }, "addressRange": { "start": "00:00:00:01", /* address range used for mDots */ "end": "FF:FF:FF:FE" }, "network": { "public": true, /* set to false for private LoRa network with mDots + Conduit */ "leasetime": 0, /* time until mDot join expires (minutes) or 0 for no expiration */ "name": "YOUR-NETWORK-NAME", /* configure network security */ "passphrase": "YOUR-NETWORK-PASSPHRASE" }, "log" : { "console" : true, "syslog" : false, "level" : 30, /* error=10, warn=20, info=30, debug=50, trace=60, max=100 */ "path": "/var/log/lora-network-server.log" }, "mqtt": { "enabled": true }, "test": { /* "disableDutyCycle": true */ } }
July 27, 2017 at 1:49 pm #20381Jason Reiss
KeymasterMQTT Name and password are not currently supported in network server. 🙁
July 27, 2017 at 2:06 pm #20382Brian Roberts
ParticipantThanks for the fast response.
I’m mainly concerned with not letting anyone from the outside connect and publish to the MQTT broker running on the Multitech gateway. I have the MQTT broker on the gateway bridged to another MQTT broker running on a server, so I can’t block the port.
I haven’t look much at the packet forwarder. Could I write my own packet forwarder that takes the LoRa data packets and publishes them to the MQTT broker using credentials? I’m not sure if that would be the right path.
July 27, 2017 at 2:26 pm #20383Jason Reiss
KeymasterSo you have enabled the MQTT broker on Conduit to use the public interface and bridge that connection using the mosquitto.conf file?
I would write an app that consumes the MQTT messages from the local broker and forwards the desired messages to the remote server using name/pass credentials.
You are probably only interested in “joined” and “up” messages.
July 27, 2017 at 3:58 pm #20388Brian Roberts
ParticipantYea, I updated the mosquitto.conf to bridge to another Mosquitto Broker running on a server. I’m currently pushing up all lora/+/up messages.
I like your suggestion. I’ll disable the bridge, and just implement a script to do the bridging myself. In fact I already have a script that should be easy to modify to do that.
Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.