RAK7249 MQTT-Bridge

I have setup a 7249 gateway and a number of nodes. Everything works wonderfully. Can see the data from the nodes on the TTN console. Now I want to get the data into my Arduino application.

I have read and read and read, and I think I’ve suddenly got it! I have set up MQTT.fx on a RPi and it appears to work, though I haven’t got it to interface to the 7249. Pretty sure I’m across that. I have an application set up on an Arduino Mega + Ethernet shield and I’m pretty sure I’ve sus’d how to get the application to talk to the MQTT.fx.

My q is:- can my Arduino application interface directly to the 7249 MQTT-bridge or do I have to go via the MQTT.fx RPi MQTT to the Arduino application?

I think it’s obvious and the answer is “Yes” but the doc talks about the need for the 7249 bridge to connect to an MQTT and then the application.

Thanks.

Hei @Oldfield,

What I would do is use the Built-in Server to create an application and add the devices.
Use the MQTT global integration to forward the decrypted data to an MQTT broker. So as long as you have a broker somewhere running that has a valid IP and port this should work.
Does this make sense ?

Regards
Vladislav

There are a variety of MQTT libraries for Arduino and as it’s a standard, I’d expect them to connect directly to the gateway.

I’m curious what you are going to do with data created in one small microcontroller that then ends up in another one!

I’m not sure I understand you’re last sentence. I Have nodes (Dragino, soon to be RAK) measuring the level of water in a 5x (soon to be 7x) 33,000 litre tanks. That data goes back to the 7249 gateway. I want to get that data off and into an Arduino Mega which essentially says:-

if tank 1 = empty, then open motorised valve 1 to deliver water to tank 1.

When tank 1 = full, close motorised valve 1

The same Mega loop checks moisture levels from other nodes (via the gateway) and operates irrigation pumps, ditto tree-watering system.

So you’re recommending I don’t use the built-in 7249 MQTT-Bridge??

Hei @Oldfield

I am in-fact recommending to use it.

Gateway->Built-in Server->Application/device->Built-in MQTT Bridge->Broker on the Arduion.

Regards
Vladislav

I think my q is can the 7249 MQTT-Bridge be used as simply a bridge. The doc seems to say that the Bridge has to connect to an external standalone MQTT.

Oh, okay. Then we’re on the same page. That is exactly what I think I’m doing. Thanks

I meant to say:-

I think my q is can the 7249 MQTT-Bridge be used as simply an MQTT. The doc seems to say that the MQTT-Bridge has to connect to an external standalone MQTT.

… and then -> my application which cld be hosted on the same Arduino?

Yeah, assuming that by application you mean something taking the already decrypted and decoded data, for example actual sensor values and doing something with it, for example triggering a switch when the value drops below a certain level.

Yes, thats exactly what I mean. So, just to confirm, the MQTT-Bridge has to connect to a separate and external MQTT-Broker eg MQTT.fx running on a RPi, and the “application” (as I described It Triggering a switch) running on an Arduino talks to the RPi

Or you can run a broker on the arduino I guess

1 Like

Which circles us back to my answer. John, there’s no obvious reason for your Arduino to not talk directly to the MQTT on the gateway.

1 Like