B4J Question MQTT accessed from outside

walterf25

Expert
Licensed User
Longtime User
Hi All, i'm working on a project which requires a device to send data over to a PC. I came across the MQTT library and I thought I would give it a try, i'm really amazed at how simple it is to set this up, whether running the MQTT Broker on a local P.C. or using one of the cloud host servers.

The question I have is the following:

Is it possible for a device outside the local network to communicate with the MQTT broker running on my PC, if so, what are the steps i need to follow to allow this?

Thanks,
Walter
 

DonManfred

Expert
Licensed User
Longtime User
MQTT broker running on my PC, if so, what are the steps i need to follow to allow this?
The Port (or ports of there are more needed) needs to be opened at your firewall and forwarded to your local pcs ip (on your router).
I´m not of big help here. It´s not my strong part.

I would ask google for mqtt open port as a first try.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
The Port (or ports of there are more needed) needs to be opened at your firewall and forwarded to your local pcs ip (on your router).
I´m not of big help here. It´s not my strong part.

I would ask google for mqtt open port as a first try.
Hi Don, yeah i just read about that, I guess the best way would be to deploy the broker in a VPS, or use one of the paid cloudhosts, thanks, i'll keep doing some research, i'd like something that can run on my machine.

Walter
 
Upvote 0

BillMeyer

Well-Known Member
Licensed User
Longtime User
I run mosquito on my Win Server with a public IP. It was very easy to install and from day 1 I have had no problem.

I have discovered that I can send json, images, medium pdf's etc without a problem.

I have also found a way to publish to just one client without a problem as well by creating a unique number, subscribing to it, send it to the server and then let the server publish to that number and then destroy it on both the server and client. I use this principal for retrieving medical prescriptions from a server.

There are many possibilities with some clever programming.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
i run mosquito MQTT Broker at my raspberry pi3 at home :) it have low energy consumption costs and can be managed via remote desktop from pc.
the fun starts if u need a secure connection ..
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I run mosquito on my Win Server with a public IP. It was very easy to install and from day 1 I have had no problem.

I have discovered that I can send json, images, medium pdf's etc without a problem.

I have also found a way to publish to just one client without a problem as well by creating a unique number, subscribing to it, send it to the server and then let the server publish to that number and then destroy it on both the server and client. I use this principal for retrieving medical prescriptions from a server.

There are many possibilities with some clever programming.
Interesting, i'd have to research how to set up Win Server on my machine.

Thanks,
Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
i run mosquito MQTT Broker at my raspberry pi3 at home :) it have low energy consumption costs and can be managed via remote desktop from pc.
the fun starts if u need a secure connection ..
This is for a client of mine, i don't really think running it on a Raspberry pi will be suitable, but I guess i can try it to prove the concept.

Regards,
Walter
 
Upvote 0
Top