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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20379
    Brian Roberts
    Participant

    I 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 */
            }
    }
    #20381
    Jason Reiss
    Keymaster

    MQTT Name and password are not currently supported in network server. 🙁

    #20382
    Brian Roberts
    Participant

    Thanks 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.

    #20383
    Jason Reiss
    Keymaster

    So 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.

    #20388
    Brian Roberts
    Participant

    Yea, 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!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.