Private MQTT broker

123 views
Skip to first unread message

Ahmed Al-haddad

unread,
Oct 27, 2015, 9:45:10 PM10/27/15
to MQTT
I am a university student, and normally universities tend to block certain ports in their internet network. So now if I am using their network, I can't connect to the test server to test my MQTT network unless I change connection to mobile data which is not always available. How can I make my laptop (or raspberry pi or anything) as a broker that I can use freely? I am currently using Python Paho MQTT project. 

Thanks for your help. 

Paul Fremantle

unread,
Oct 28, 2015, 3:20:23 AM10/28/15
to mq...@googlegroups.com
Ahmed 

Its very simple on Raspberry Pi or another Linux system. 

Great instructions here:


Paul

On 28 October 2015 at 01:45, Ahmed Al-haddad <itsh...@gmail.com> wrote:
I am a university student, and normally universities tend to block certain ports in their internet network. So now if I am using their network, I can't connect to the test server to test my MQTT network unless I change connection to mobile data which is not always available. How can I make my laptop (or raspberry pi or anything) as a broker that I can use freely? I am currently using Python Paho MQTT project. 

Thanks for your help. 

--
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 http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.



--
Paul Fremantle
Part-time PhD student - School of Computing
twitter: pzfreo / skype: paulfremantle / blog: http://pzf.fremantle.org
Co-Founder, WSO2
Apache Member and Committer
07740 199 729

Ahmed Al-haddad

unread,
Oct 28, 2015, 5:59:32 AM10/28/15
to MQTT

Sir. Paul Fremantle,

Thank you so much for your help, this looks so promising. Can't wait to implement it. But at the moment I only have windows machine. I found out later that mosquitto is also available on windows, but I was trying for hours and it didn't work out for me (kept on downloading many dll files but no hope.. :( )
 
I have one question, after I set up the private server (laptop/pc/raspberrypi), will I be able to contact the server from sensors connected to the internet through different networks? Or does it have to be the same internet network that the private server is connected to?!

Thanks a lot.
Ahmed.

Hans Jespersen

unread,
Oct 28, 2015, 9:12:32 PM10/28/15
to MQTT
Another option would be to connect to a public mqtt broker that supports mqtt over websockets or secure websockets. These ports are less likely to get blocked.

Ahmed Al-haddad

unread,
Oct 29, 2015, 11:13:45 AM10/29/15
to MQTT
Hi Hans,

I tried different test servers with all the different ports available but all of them didn't work out. I think the ports were blocked by default and that's why I can't connect. 

I have one question, after I set up the private server (laptop/pc/raspberrypi), will I be able to contact the server from sensors connected to the internet through different networks? Or does it have to be the same internet network that the private server is connected to?! 

Hans Jespersen

unread,
Oct 29, 2015, 11:44:56 AM10/29/15
to MQTT
Comments inline below

On Thursday, October 29, 2015 at 8:13:45 AM UTC-7, Ahmed Al-haddad wrote:
Hi Hans,

I tried different test servers with all the different ports available but all of them didn't work out. I think the ports were blocked by default and that's why I can't connect. 

Did any of the public brokers use port 443 or port 80? These are the least likely to be blocked ports because they are the same ports used for web browsing (HTTP and HTTPS)
 

I have one question, after I set up the private server (laptop/pc/raspberrypi), will I be able to contact the server from sensors connected to the internet through different networks? Or does it have to be the same internet network that the private server is connected to?! 

You are likely to have an even bigger problem getting sensors to connect back through the same firewall that is blocking your outbound connections. These firewalls are even more restrictive for inbound connections. If you want to avoid betting blocked you have to put all the sensors and servers on the same network or find a port that is already open like 80 or 443. That is why I suggested mqtt over web sockets (80 default port) or secure web sockets (443 default port). See https://en.wikipedia.org/wiki/WebSocket for more details on websocket.
Reply all
Reply to author
Forward
0 new messages