logfile = 'logfile'
mqtt_broker = '192.168.1.120' # default: 'localhost'
mqtt_port = 1883 # default: 1883
mqtt_clientid = 'mqtt-launcher-1'
mqtt_username = ''
mqtt_password = ''
topiclist = {
# topic payload value program & arguments
"dak/screen" : {
'off' : [ '/home/pi/ir_scripts/rpi-hdmi.sh', 'off' ],
'on' : [ '/home/pi/ir_scripts/rpi-hdmi.sh', 'on'],
},
}
I start mqtt-launcher from the command line as user pi.
Then I send (from Node-Red) Topic: dak/screen Payload: on (QoS 2, Retain false) which works ok.
Then I send Topic: dak/screen Payload: off which usually works too (but not always) but then no other commands are accepted. No matter what I send, it is just ignored. Nothing shows up in the log.
But obviously the commands I send are stored somewhere because when I stop mqtt-launcher and start it again, all the previous commands are executed immediately.
2018-02-24 12:16:03,827 Starting
2018-02-24 12:16:03,829 DEBUG MODE
2018-02-24 12:16:03,848 Connected to MQTT broker, subscribing to topics...
2018-02-24 12:16:11,637 dak/screen 2 on
2018-02-24 12:16:11,645 Running t=dak/screen: ['/home/pi/ir_scripts/rpi-hdmi.sh', 'on']
--- This time only one command was executed
2018-02-24 12:18:33,811 Starting
2018-02-24 12:18:33,813 DEBUG MODE
2018-02-24 12:18:33,830 Connected to MQTT broker, subscribing to topics...
2018-02-24 12:18:33,925 dak/screen 2 off
2018-02-24 12:18:33,931 Running t=dak/screen: ['/home/pi/ir_scripts/rpi-hdmi.sh', 'off']
2018-02-24 12:18:34,063 display_power=0
2018-02-24 12:18:34,072 dak/screen 2 on
2018-02-24 12:18:34,075 Running t=dak/screen: ['/home/pi/ir_scripts/rpi-hdmi.sh', 'on']
---After restart all the previously sent commands are executed