Skip to content

Commit

Permalink
usb device binding and services status
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Nov 20, 2021
1 parent f59ef46 commit 93c2256
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
7 changes: 4 additions & 3 deletions containers/zigbee2mqtt/bind device to static name.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB1)
```
* edit the file
```
sudo nano /etc/udev/rules.d/10-local.rules
sudo nano /etc/udev/rules.d/99-usb-serial.rules
```
* add
* symlink
```
ACTION=="add", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="/dev/ttyUSB1"
KERNEL=="ttyUSB*", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE="0666", SYMLINK+="usbzigbee"
```

references
* [reactivated.net - guide](http://www.reactivated.net/writing_udev_rules.html)
* [stackexchange - post](https://unix.stackexchange.com/questions/66901/how-to-bind-usb-device-under-a-static-name)
* [UDEV rules for zigbee controller](https://zigbee2mqtt.discourse.group/t/udev-rules-for-zigbee-controller/919)
2 changes: 1 addition & 1 deletion containers/zigbee2mqtt/data/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mqtt:
base_topic: lzig
server: 'mqtt://localhost'
serial:
port: /dev/ttyUSB1
port: /dev/usbzigbee
advanced:
channel: 11
rtscts: false
Expand Down
3 changes: 2 additions & 1 deletion setup_border_router.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ git clone https://github.com/openthread/ot-br-posix
cd ot-br-posix
./script/bootstrap
INFRA_IF_NAME=eth0 ./script/setup
#config in /etc/default/otbr-agent `OTBR_WEB_OPTS="-p 8020"`
#config in /etc/wpantund.conf
popd

25 changes: 25 additions & 0 deletions status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
check_service () {
STATUS="$(systemctl is-active $1)"
if [ "${STATUS}" = "active" ]; then
echo "$1 is running"
else
echo "$1 is dead"
fi
}

check_service "nrf_mesh"
check_service "hue"
check_service "telegraf"
check_service "zigbee2mqtt"
check_service "bathroom"
check_service "influx_mqtt"
check_service "lifx"
check_service "roll"
check_service "watch_bots"
check_service "heat_cut"
check_service "home_status"
check_service "pc_power"
check_service "lapse"

#check now the Docker Compose containers
dc ps

0 comments on commit 93c2256

Please sign in to comment.