Hello everybody, since I'm moving (or at least I'm willing to do) from my Digital Ocean VPS to a local hosted home server behind a Cloudflare Zero tunnel, I'm going to loose a fixed ip address for my Mosquitto MQTT Broker I've been using for years.
Googling around...I'm lost in the number of free or paid solution for MQTT brokers, to be reachable outside my home network (pointing to an IP or DNS, it doesn't matter).
Any suggestions ?
I have something like 15 IOT modules laying around, and I have conducted a test on average messages over my MQTT Broker, we are talking of about 2 milion msgs/month; I can work on them to greatly reduce if necessary, most of them are just telemetry msgs from my Tasmotas.
I can stand with a suitable free reliable service, or paid if necessary, if it is not more than the base DO VPS subscription fee (more or less 7$/month).
Many thanks !!!
I've used the FREE plan on BeeBotte for a number of years as a remote MQTT broker.
I think the FREE limit is 50K messages per day.
Couple of years ago I took out a FREE subscription to the Oracle Cloud and installed Mosquitto and Node-RED, which provides me with a private remote MQTT broker.
And of course there is Hive MQTT that you might want to consider.
Me too, and it's been very resilient and performed well over the years.
Also, no cost whatsoever.
It also can be used to support your home server, such as storing backups, acting as a watchdog, and other admin functions.
I haven't done it, but I believe that you can do mqtt across the cloudflare tunnel if you use the mqtt websockets access method. (wss://...). See this post for how to do it. https://community.cloudflare.com/t/mqtt-trough-cloudflare-tunnel/503599
I know it is possibile via Websocket , but my devices (Tasmotas) aren’t capable of doing this.
I could overcome using http commands via api, but MQTT has lot of advantages and is easier to implement.
Thanks for the comment though
Oh, are your tasmota devices remote but communicating directly through the internet?
I use both HiveMQ and EMQX cloud free tiers.
EMQX has the better UI and features it's hosted in the USA but hasn't been an issue.
https://www.hivemq.com/company/get-hivemq/
https://www.emqx.com/en/cloud
You’re right.
They require a fixed ip to connect to.
They can be configured with a domain name can they not, rather than a fixed IP? But you are right that apparently tasmota does not support mqtt over wss, so my suggestion won't work.
Perhaps not, a quick search did not give me a direct answer to that.
I think that might be problematic with public MQTT servers. I suspect that they may not be guaranteed to have a fixed IP.
I can also insert a Domain name server
So where are these 15 IOT modules ? Are they all on your local network ? If so then it may be easier to just run a broker locally on your home server as well.
They are on two different nets in my two houses, and none of them (the two houses) have public IP reachable one from each other , because they are managed via 4g connections SIM with CgNat.
I have Cloudflare tunnels, they allow only Websockets , but Tasmota don’t.
So my choice is either run an MQTT broker by myself as today with Digital Ocean VPS with public IP or find a public service.
Because the VPS is expensive to just run Mosquitto…I am looking for alternatives.
As you have tunnels set up already then I would run a local broker at both sites and then use MQTT's broker to broker bridge to connect the two to share topics (being careful not to set up a loop). But yes you will need to open another port to use as the bridge can only use native MQTT transport (AFAIK).
EG see - Mosquitto MQTT Bridge-Usage and Configuration
or https://cedalo.com/blog/mosquitto-bridge-configuration/
or mosquitto.conf man page | Eclipse Mosquitto
I am quite sure bridging involves having at least one public IP address in between; I don't have anywhere.
Maybe, but my networking knowledge is very little, MQTT protocol can be "hacked" with something like this:
The local Server >> MQTT Broker >> a translation to Http >> an Http server >> Cloduflare tunnel >> the Internet >> Cloiudflare Tunnel >> An Http client >> a translation from Http >> MQTT Broker >> the other local server
But I don't know if this is feasible/secure.
You would get a fixed public IP address with a 'Free Forever Oracle server', mentioned above
I'll certainly give it a try !
Thanks to all of you guys, you're incredibly nice and patient !
If you run mosquitto locally at both sites then you should be able to bridge between then using wss through the tunnel. Or if mosquitto bridge does not support wss then run node-RED at each site and use node red to bridge the topics, using wss and mqtt.
You should be able to use a sub-domain name rather than an IP address. Then you should have no problems. Especially if you let Cloudflare handle your DNS for you as well.