Skip to content

Commit 710332d

Browse files
authored
Merge pull request eschava#74 from digitlength/patch-2
Update README.md
2 parents 0c34ae4 + c3f2386 commit 710332d

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ From the newly created *broadlink-mqtt* folder, install the required Python mod
2525
`pip install -r requirements.txt`
2626

2727
## Configuration
28-
By default, *broadlink-mqtt* will configure using parameters from `mqtt.conf`. This configuration file may be altered during a repository update, so another configuration file is provided for editing: `custom.conf`
28+
By default, *broadlink-mqtt* will configure using parameters from `mqtt.conf`. This configuration file may be altered during a repository update, so another configuration file is provided for editing: `custom.conf`. This will not be overwritten when updating *broadlink-mqtt*.
2929

3030
`custom.conf` overrides `mqtt.conf`. Copy the contents of `mqtt.conf` into `custom.conf` and continue editing only `custom.conf`.
3131

@@ -47,7 +47,43 @@ Format supports next placeholders:
4747

4848

4949
## Start
50-
Just start `mqtt.py` script using Python interpreter
50+
Just start `mqtt.py` script using Python interpreter. You may have to use `python3`.
51+
52+
### Auto-startup (Linux)
53+
(From https://github.com/eschava/broadlink-mqtt/issues/29#issuecomment-630254666)
54+
55+
sudo nano /lib/systemd/system/broadlink-mqtt.service
56+
57+
Copy and paste the following, then save:
58+
59+
`[Unit]`
60+
`Description=Broadlink MQTT Service`
61+
`After=multi-user.target`
62+
63+
64+
`[Service]`
65+
`Type=simple`
66+
`ExecStart=/usr/bin/python3 /home/pi/broadlink-mqtt/mqtt.py`
67+
`StandardInput=tty-force`
68+
69+
`[Install]`
70+
`WantedBy=multi-user.target`
71+
72+
Reload the daemon:
73+
`sudo systemctl daemon-reload`
74+
75+
To start the service:
76+
`sudo systemctl start broadlink-mqtt.service`
77+
78+
To see the service status:
79+
`sudo systemctl status broadlink-mqtt.service`
80+
81+
To stop the service:
82+
`sudo systemctl stop broadlink-mqtt.service`
83+
84+
To restart the service:
85+
`sudo systemctl restart broadlink-mqtt.service`
86+
5187

5288
# RM2/RM3/RM4
5389
### MQTT commands to control IR/RF

0 commit comments

Comments
 (0)