PythonAnywhere Forums

Need Mosquitto or any equivalent MQTT broker

Hi Team,

Is there any provision available to get Mosquitto or any other mqtt broker server installed in pythonanywhere for our use? I just now installed the paho-mqtt client for my user but then it clicked to me that i need a private broker server in cloud(so that i don't expose my data to the bad guys).

Besides it'll be a cool thing to implement as a pythonanywhere IOT ready feature .

-Thanks.

We don't currently support apps that use custom protocols -- it's all HTTP(S) only at the moment, and python-wsgi versions of that too, so an MQTT server currently wouldn't work.

We're working on letting people run more arbitrary services, but it's a ways off.

That sums it up ... Thanks Harry

hahahaha we will definitely look into it.

I personally don't really know much about mosquitto- would this be something where each user spins up a mosquitto broker server or would it be possible to say have one single server which everyone uses? (somehow doing some sort of auth?)

and is the main blocking point right now that pythonanywhere only opens the ports for http/https type protocols for webapps and thus the mosquitto broker won't work?

Hi Conrad,

Well a single installation of mosquitto does allow multiple instances based on username/pwd. we can set it up that way / bind it with their login user password, or like any typical s/w distributions we can wait for the users to specifically ask for it and allow them to install it.

This thing runs on the port 1883 by default but the server puts no restriction on configuring it, so we can either leave that upto the user or restrict it to a specific port as a point of entry to the pythonanywhere server.

Btw I think asking you folks to do it for free would be totally unfair so I looked into the different pricing models(azure & Aws) and realized if you look into it, you can earn a good chunk of money just by letting these devices talk using your server...

(Well this info above serves no real purpose, i'm just trying to bait you folks ... here kitty kitty..or something like that).

But frankly thanks for re-posting, showing interest, giving hope ... etc etc. :)

Take care.

+1 for Mosquitto support please.

Jim

upvoted!

Thanks!

I see that AWS allows access to MQTT via WebSockets (e.g. http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html ) - is there any likelihood of PA supporting WebSockets in the next 12 months please?

Thanks,

Jim

I don't know much about MQTT, but if what they're saying is that you can run a server on their infrastructure and use WebSockets to connect to it, then that would work right now. On PythonAnywhere we don't support WebSocket servers, but code that uses a WebSocket client should work just fine.

Ah, thanks for the clarification Giles. It is indeed accessing an MQTT server on the AWS infrastructure, via WebSockets rather than the MQTT protocol - easier for small 'devices', e.g. 8 bit embedded, and for environments not allowing MQTT itself.

I'll try it and report back.

@jgmdavies I am in need of using MQTT over GSM for one of my tasks, Could you please share if you had any progress with this on Pythonanywhere ?

Since it was told that MQTT wont work here, i went ahead and tried out AWS and I was able to do it successfully.

@voyagers as @jgmdavies mentioned you can get an instance in AWS, a small one like a T2 micro or similar. I'd say use linux and not windows as due to some reason, installing MQTT gave me a hard time in the windows that they have.

One key thing to remember to open the port that you want to use for MQTT while creating the instance. Else you may wonder why it's not working even though you did everything within the S/w

@voyagers I'm sorry, I didn't proceed with this. Anyone else?

@iamsandeep thanks for update , would you mind sharing some more details to me on this front ? you can drop me a mail on balaji.kulkarni92@gmail.com

My mail id is laik.sandeep@gmail.com. Send me your questions and I'll respond asap.