RSMB as a MQTT-SN Gateway

1284 views
Skip to first unread message

daniel.n...@devexmining.com

unread,
Feb 17, 2014, 3:49:14 PM2/17/14
to mq...@googlegroups.com
Hi all,

I'am trying to use the recently published RSMB[1], as a MQTT-SN gateway to a MQTT broker[2].

I tried to achieve that setting RSMB as a bridge and connecting it in ActiveMQ. 
Since it connect they don't exchange messages between them.

What im trying to do is possible with the current code available? 
If don't someone could give me instructions about how to implement this feature in rsmb?

Above follow the broker.cfg that I used:
# connection rsmb
# try_private false
# address 10.1.10.43 1883
# topic "" both tst /tst/local


Thanks,
Daniel

Roger Light

unread,
Feb 17, 2014, 3:58:13 PM2/17/14
to mq...@googlegroups.com
Hi Daniel,

On test.mosquitto.org I have an instance of rsmb running bridged to
the mosquitto broker there.

The config I use is:


connection mqtts
protocol mqtt
address 127.0.0.1
topic # both

listener 1883 0.0.0.0 mqtts


Cheers,

Roger
> --
> To learn more about MQTT please visit http://mqtt.org
> ---
> You received this message because you are subscribed to the Google Groups
> "MQ Telemetry Transport" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mqtt+uns...@googlegroups.com.
> To post to this group, send email to mq...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mqtt.
> For more options, visit https://groups.google.com/groups/opt_out.

Andy Piper

unread,
Feb 17, 2014, 3:58:19 PM2/17/14
to mq...@googlegroups.com
Hi Daniel

As far as I know, ActiveMQ doesn't support MQTT bridges (which are not a formal part of the MQTT spec anyway).

Andy


On Mon, Feb 17, 2014 at 8:49 PM, <daniel.n...@devexmining.com> wrote:

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQ Telemetry Transport" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/groups/opt_out.



--
Andy Piper | Kingston upon Thames, London (UK)
blog: http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images: http://www.flickr.com/photos/andypiper

Daniel Oliveira Nascimento

unread,
Feb 17, 2014, 4:09:54 PM2/17/14
to mq...@googlegroups.com
Hi Andy, 

so try to fix ActiveMQ could be the way to go?

thx,
Daniel

Nicholas O'Leary

unread,
Feb 17, 2014, 4:16:10 PM2/17/14
to mq...@googlegroups.com
ActiveMQ supports inbound MQTT client connections, that's all you need to bridge.

Yes, RSMB/Mosquitto bridges try to do something a bit different, but they fall back to regular client connections if needed - and you can see 'try_private false' in the config, which disables the bridge-specific bits anyway.

Daniel - on what topics are the messages being published on RSMB? Is it 'tst'?

To rule out any issues with ActiveMQ, you could of course try bridging to another RSMB instance running on another port.

Nick

Daniel Oliveira Nascimento

unread,
Feb 18, 2014, 1:09:45 PM2/18/14
to mq...@googlegroups.com
Thanks all,

I got my system working. The problem was the configuration, changing the broker.cfg to:
# listener 1883 127.0.0.1 mqtt
# listener 1883 127.0.0.1 mqtts
#
# connection rsmb
# try_private false
# address 10.1.10.43 1883
# topic /tst/# both

Now I'm able to publish MQTT and MQTT-SN messages in both ActiveMQ and RSMB, and my clients subscribed in topic "/tst/#" are able to receive the messages.

The only problem now is that when I publish a message in RSMB the clients subscribed in it receive this message duplicated. 
Probably a RSMB bug.

I'll continue investigating it.

Daniel

Nicholas O'Leary

unread,
Feb 18, 2014, 1:35:02 PM2/18/14
to mq...@googlegroups.com

Hi Daniel,

That is not a bug with rsmb but is a result of your bridge configuration.

Your config is publishing all messages on /tst/# to the remote broker. It is also subscribed to /tst/# on the remote broker.

When you publish a message locally it is received by local subscribers and also sent over the bridge. The message is published on the remote broker and, as your bridge is subscribed to the topic, it receives a copy - hence what you perceive as a duplicate.

This is where you should make use of the local/remote prefix options to ensure you don't get this overlap of topics.

Nick

Daniel Oliveira Nascimento

unread,
Feb 18, 2014, 3:01:04 PM2/18/14
to mq...@googlegroups.com
Correct!

using this line in broker.cfg:
# topic # both /tst/local/ /tst/remote/

Now I can publish:
# mosquitto_pub -h <remoteip> -t "/tst/remote/app" -m "tst"

And listen it with a client:
# mosquitto_sub -h <localip> -t "/tst/local/#"

Without problems.
Reply all
Reply to author
Forward
0 new messages