MQTT? / Home automation?

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
Rob_wrt
DD-WRT User


Joined: 25 Apr 2012
Posts: 56

PostPosted: Mon Apr 10, 2017 22:45    Post subject: MQTT? / Home automation? Reply with quote
Hi All, I have not been here for a while.
My Buffalo and Linksys have been running build 23919 with no problems, and I did not feel the need to upgrade.


Anyway, I have a question about MQTT on dd-wrt. I googled around and search forum - did not find much, so I think I know my answer. But anyway, still posting the question.

Are there any implementations of MQTT broker on dd-wrt?
Anyone successfully using it (on dd-wrt, if exists, or any other flavour of WRT)?
Or anyone using dd-wrt in any diy home automation setup?

Thanks,
Rob
Sponsor
carloher
DD-WRT Novice


Joined: 26 Aug 2014
Posts: 12

PostPosted: Mon Jun 18, 2018 13:47    Post subject: Reply with quote
Maybe is too late, but it can be useful anyway...

I've installed mosquitto MQTT broker in DD-WRT by using entware. Instructions to install entware can be found here: https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

Then you can isntall mosquitto --or any other entware package-- by typing:

Code:
opkg install mosquitto
mjforan
DD-WRT Novice


Joined: 07 Feb 2020
Posts: 11

PostPosted: Wed Feb 19, 2020 0:11    Post subject: MQTT? / Home automation? Reply with quote
Sorry to necro this thread, but it's one of the top search results so maybe I can save someone else some frustration.

The Entware package of Mosquitto runs out of the box on OpenWRT, but for DD-WRT it's not as easy. I added some additional startup commands to create a user for Mosquitto and start the process. You could also change the user in the mosquitto.conf file to be root if you want. Here is my working startup script:
Code:
grep -q FTPuser /tmp/etc/passwd || echo "mosquitto:*:1100:1160:mosquitto:/opt/etc/mosquitto:/bin/false" >> /tmp/etc/passwd
sleep 10
/opt/etc/init.d/rc.unslung start
/opt/sbin/mosquitto
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 960
Location: WV, USA

PostPosted: Fri Oct 16, 2020 17:50    Post subject: Re: MQTT? / Home automation? Reply with quote
mjforan wrote:
Sorry to necro this thread, but it's one of the top search results so maybe I can save someone else some frustration.

The Entware package of Mosquitto runs out of the box on OpenWRT, but for DD-WRT it's not as easy. I added some additional startup commands to create a user for Mosquitto and start the process. You could also change the user in the mosquitto.conf file to be root if you want. Here is my working startup script:
Code:
grep -q FTPuser /tmp/etc/passwd || echo "mosquitto:*:1100:1160:mosquitto:/opt/etc/mosquitto:/bin/false" >> /tmp/etc/passwd
sleep 10
/opt/etc/init.d/rc.unslung start
/opt/sbin/mosquitto


I just got this working myself, albeit a bit differently. First I created a Samba user, then used that user to run mosquitto. This way I don't have to recreate the user on every boot. Then in Startup I just added this:

/opt/sbin/mosquitto -c /opt/etc/mosquitto/mosquitto.conf&

Works like a charm.

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r53562
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r53562

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port.

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 960
Location: WV, USA

PostPosted: Tue Oct 20, 2020 2:04    Post subject: Reply with quote
After a few days of using this, I am quite impressed with the EA8500 and Entware. The CPU load on the router is minimal and I have a dozen sensors speaking to it via MQTT.

Even though I already have OpenVPN set up, I wonder how safe it would be to open this MQTT service up on the WAN side of the router. It would be quite handy to be able to communicate with some of my cloud servers. Any recommendations here?

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r53562
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r53562

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port.

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum