AEP and MQTT
Home › Forums › Conduit: AEP Model › AEP and MQTT
- This topic has 5 replies, 4 voices, and was last updated 7 years, 4 months ago by Jason Reiss.
-
AuthorPosts
-
June 22, 2017 at 10:40 am #19621Benjamin NingParticipant
Hello.
I am trying to connect to the MQTT broker within the AEP conduit (1.3.2) and am having no luck.
In the webpage section:
Setup -> LoRa Network Server -> Show Advanced Settings -> Payload Broker
I have the checkbox checked, hostname of 127.0.0.1 and port of 1883.
Using these details I cannot connect to the broker with a MQTT client (I’ve tried MQTTLens and MQTT.fx). I’ve tried with and without username and password (which I assume would be the same credentials as I use to login to the webpages and SSH).
Am I wrong in assuming the Conduit has a broker and instead these settings are looking for a broker to connect to?
Does the broker need to be enabled somewhere else? From what I can gather anonymous clients are permitted by default?
Does the AEP version not allow clients to connect? I notice if I SSH into the Conduit that the mosquitto_sub command is not found.
I’m new to MQTT so it may be something obvious I am missing.
One last question not concerning MQTT, but in the following page:
it lists a few Server Ports. Can I please be pointed to the protocols that these ports are expecting?
Thanks for any help, really run into a wall here.
Ben.
June 22, 2017 at 3:04 pm #19634Ajay KParticipantHi Ben,
Are you trying to connect to the MQTT broker via node-red workflows or are your writing a custom application to connect to the broker? I am not sure about if there were any restrictions on 1.3.2 of AEP, but I currently connect to the mqtt broker both via node-red and a custom nodejs app.
Here is the configured MQTT input node in node-red flow that subscribes to the topic for nodes joining the lora network.
[{"id":"6055ed4f.b43264","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":""},{"id":"75f5e3e1.22c47c","type":"mqtt in","name":"Look for Nodes Joining LORA Network","topic":"lora/+/joined","broker":"6055ed4f.b43264","x":189,"y":110,"z":"b70e5bb9.38ab48","wires":[["6e3f40c.a7bafc"]]}]
Thanks,
Ajay.June 23, 2017 at 6:39 am #19637Benjamin NingParticipantHi Ajay.
Thanks for your reply.
Ideally I wish to write an application which will connect to the Conduit MQTT broker and subscribe/publish to the broker. For now I am testing with various existing MQTT Clients and failing at connecting to the Conduit broker.
I have setup a MQTT input node using your kindly provided information, and the node connects to the Conduit broker no problem and I can see endnodes joining ok when the input node is connected to a debug node.
So it seems as though the Conduit MQTT broker is accepting local clients OK, but not remotes ones?
This is probably a Firewall issue, but I *think* I have allowed incoming connections with the following active Input Filter Rule:
Allow Inbound ANY 1024-65535 TCP/UDP ACCEPT
Thanks again,
Ben.
June 23, 2017 at 7:21 am #19639Jason ReissKeymasterOn Conduit MQTT has listener setup for localhost only.
Username and password is not supported by network server.
Systems on Conduit have been designed to use MQTT locally to report data from Lora Network Server to a Local Application without username/password or overhead of SSL connections to be secure.
That application may be used to connect to a remote MQTT broker using username/password and SSL to create a secure bridge.To open the broker to public interfaces the /etc/mosquitto/mosquitto.conf file can be changed and broker restarted.
# /etc/init.d/mosquitto restart
However the software components have not been tested in this configuration, there maybe issues if you wish to experiment.Creating bridge application is suggested as it can maintain the security of the system.
July 4, 2017 at 3:45 am #19831lorawan2016ParticipantHi Ben,
In addition to what Jason is suggesting, you could check that you have internet connection in your Conduit gateway by pinging a site, try in Tera Term login to your Conduit gateway if you are using Windows and then just ping http://www.google.com from the command line and check what’s the response.
Note that MQTT in Node-RED is working properly for me in Conduit firmware version
1.4.1.Jason, in case of Conduit AEP as packetforwarder when writing custom application with MQTT support using Nodejs or javascript, which interface is available to access the received and sent packets through the gateway?
July 4, 2017 at 8:31 am #19832Jason ReissKeymasterThe packet forwarder uses only UDP to communicate to the network server.
https://github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT
There is no local port providing packets other than logging.If forwarding to a network server the data in packets traveling through the Conduit will be encrypted. Only header information will be available.
A UDP bridge between packet forwarder and network server would be able to provide packet info.
-
AuthorPosts
- You must be logged in to reply to this topic.