MQTT Connection between BRX PLC and Amazon AWS using a Digi Transport WR11 Router

36 views
Skip to first unread message

Josh

unread,
Feb 5, 2019, 8:41:46 PM2/5/19
to MQTT
Hey Everyone,
Iʻve been struggling trying to figure out how to connect a BRX PLC from Automation Direct to the Amazon AWS broker. 

The BRX supports MQTT but does not support certificates, which Amazon requires. It seems like it should be possible to use the Digi Transportʻs certificates to connect the PLC to Amazon, I am just struggling with how.

I am using a slightly modified paho python library provided by Digi (https://github.com/digidotcom/python-mqtt) and have the router connected to AWS and publishing and subscribing successfully. 

Naive me though I could just turn the router into a broker of sorts that subscribed to the PLC on its LAN and then published the data it received up to AWS. However as I am figuring out, it doesnʻt work that way since the PLC is a client and the python library is implemented as a client. This leaves me needing to somehow grab the data from the PLC and then move it up to AWS via MQTT.

This all seems very complicated, which make sme think I am missing something, or going about this in the wrong way. I hope that you guys can offer some insight. Thanks in advance.

Josh

Joel J. Bender

unread,
Feb 5, 2019, 9:31:36 PM2/5/19
to Josh, mq...@googlegroups.com
Naive me though I could just turn the router into a broker of sorts that subscribed to the PLC on its LAN and then published the data it received up to AWS. However as I am figuring out, it doesnʻt work that way since the PLC is a client and the python library is implemented as a client. This leaves me needing to somehow grab the data from the PLC and then move it up to AWS via MQTT.

It sounds like you need an application that can be a broker for the PLC, subscribe to itself as a client, and then publish the data.  Perhaps the HBMQTT package [1] is a solution, I'm working on a similar problem bridging to/from Redis PUB/SUB, MQTT, and web sockets.


Joel

Josh

unread,
Feb 5, 2019, 11:49:43 PM2/5/19
to MQTT
Thanks for the response Joel,

I agree with you. Unfortunately HBMQTT requires python 3 to run and the Digi Transport series uses Python 2. Does anyone know of nay libraries that can run on Python2 and do something similar?

Andy Stanford-Clark

unread,
Feb 6, 2019, 6:27:17 AM2/6/19
to mq...@googlegroups.com
is there space to run mosquitto on the router?

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" 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 https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

Josh

unread,
Feb 6, 2019, 9:16:21 PM2/6/19
to MQTT
Thanks for the response Andy,
There is room on the router for Mosquito. It runs on a linux kernel, not exactly sure the exact kind. That could be a great solution. Is there any tips you have for me before I go down the path of trying to install it on the router?

Thanks,
Josh

Andy Stanford-Clark

unread,
Feb 7, 2019, 8:18:52 AM2/7/19
to mq...@googlegroups.com
You probably won’t have room to build mosquitto from source on the router, so you’ll most likely need to cross compile it on another machine. All possible, of course, but it increases the pain and learning curve for doing this.
If you’re very lucky, there will be a build for the router’s CPU architecture already (so you can just apt-get install, or yum install, or whatever the incantation is for that flavour of linux. Definitely try that first before you get into cross compilation!

Good luck :)
Andy

Karl Palsson

unread,
Feb 7, 2019, 11:41:07 AM2/7/19
to mq...@googlegroups.com

Have you tried speaking to BRX?

Honestly, supporting MQTT, but without any security options would
lead me to select another PLC vendor.

Failing that, running mosquitto on an openwrt supported router is
trivial, and would indeed workaround this.

A final option would be ignore the MQTT options on the BRX, and
use one of it's other interfaces, (like modbus et al) Then you
have your existing client code running on your router to talk to
AWS, and the "other" interface to get data in/out of the PLC.

Cheers,
Karl P

Josh <joshuaks...@gmail.com> wrote:
> Thanks for the response Andy,
> There is room on the router for Mosquito. It runs on a linux
> kernel, not exactly sure the exact kind. That could be a great
> solution. Is there any tips you have for me before I go down
> the path of trying to install it on the router?
>
> Thanks,
> Josh
>
> On Wednesday, February 6, 2019 at 1:27:17 AM UTC-10, andysc
> wrote:
> >
> > is there space to run mosquitto on the router?
> >

> > On 6 Feb 2019, at 04:49, Josh <joshuaks...@gmail.com <javascript:>> wrote:
> >
> > Thanks for the response Joel,
> >
> > I agree with you. Unfortunately HBMQTT requires python 3 to run and the
> > Digi Transport series uses Python 2. Does anyone know of nay libraries that
> > can run on Python2 and do something similar?
> >
> > On Tuesday, February 5, 2019 at 4:31:36 PM UTC-10, Joel Bender wrote:
> >>
> >> Naive me though I could just turn the router into a broker of sorts that
> >> subscribed to the PLC on its LAN and then published the data it received up
> >> to AWS. However as I am figuring out, it doesnʻt work that way since the
> >> PLC is a client and the python library is implemented as a client. This
> >> leaves me needing to somehow grab the data from the PLC and then move it up
> >> to AWS via MQTT.
> >>
> >>
> >> It sounds like you need an application that can be a broker for the PLC,
> >> subscribe to itself as a client, and then publish the data. Perhaps the
> >> HBMQTT package [1] is a solution, I'm working on a similar problem bridging
> >> to/from Redis PUB/SUB, MQTT, and web sockets.
> >>
> >>
> >> Joel
> >> [1] https://hbmqtt.readthedocs.io/en/latest/
> >>
> >>
> > --
> > To learn more about MQTT please visit http://mqtt.org
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "MQTT" group.
> > To unsubscribe from this group and stop receiving emails from it, send an

> > email to mqtt+uns...@googlegroups.com <javascript:>.
> > To post to this group, send email to mq...@googlegroups.com <javascript:>.

signature.html
Reply all
Reply to author
Forward
0 new messages