Home automation

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2
Author Message
strobes
DD-WRT Novice


Joined: 17 Aug 2007
Posts: 38

PostPosted: Mon Jan 27, 2025 18:27    Post subject: Reply with quote
Hi, yes startup was configured per your advise and full path was used to run these commands.
And because of little experience I did something to the router, it's unstable now - occasional reboots. So I restored it from back up. And will try to find a different one for testing.
Will be back with more questions for sure.
Thank you.
Sponsor
strobes
DD-WRT Novice


Joined: 17 Aug 2007
Posts: 38

PostPosted: Sat Feb 08, 2025 5:15    Post subject: Reply with quote
@lexridge, thank you for help, mosquitto.conf and startup commands!
Hope this summary will help others: Note: it is still work in progress. And May be I don't have broker running yet as I had to use "test.mosquitto.org". Please correct and add missing info.

Install Entware: directions on web. Install Mosquitto: 1.opkg update 2. opkg install mosquitto mosquitto-client libmosquitto

You can start mosquitto manually, observe messages: /opt/sbin/mosquitto -c /opt/etc/mosquitto/mosquitto.conf

The config file:
_______________________
#pid_file /opt/var/run/mosquitto.pid

persistence true
persistence_location /opt/var/lib/mosquitto/

#log_dest file /opt/var/log/mosquitto.log

#include_dir /opt/etc/mosquitto/conf.d

allow_anonymous true
#password_file /etc/mosquitto/pwfile
listener 1883
# user xxxx
_____________________________
Mosquitto will use nobody.

you can use ps | grep mosquitto to verify that the process is running.

and test:
first console : mosquitto_sub -h test.mosquitto.org -t /ddwrt/system
second: mosquitto_pub -h test.mosquitto.org -t /ddwrt/system -m 'welcome!'


Startup: (note that I used test.mosquitto.org for testing

#For Entware
sleep 10
/opt/etc/init.d/rc.unslung start
sleep 5
/opt/sbin/mosquitto -c /opt/etc/mosquitto/mosquitto.conf&
sleep 2
#Announce the router has been rebooted. This prob. depends on local broker.
/opt/bin/mosquitto_pub -h 192.168.xxx.xxx -t ddwrt/system -m "`date` DD-WRT Rebooted"
~
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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