Skip to content

Commit 4ad87f9

Browse files
committed
docs: add guidance for name conflicts
1 parent e6b3747 commit 4ad87f9

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,27 @@ I assume that you have a Mango PI Pro-Q.
9898
* for [actor configuration](./server/config-sample-sml.yaml)
9999
* for [a smart meter with modbus connection](./server/config-sample-modbus.yaml)
100100

101+
## Stabilizing device names
102+
103+
It is the recommended way to connect devices via USB. However, this usually
104+
leads to non-deterministic distribution of device names (e.g. `/dev/ttyUSB0`).
105+
This can be fixed simply by creating symlinks for the devices based on the
106+
serial numbers.
107+
108+
A file `10.hackdose.rules` might contain the following entries:
109+
```
110+
SUBSYSTEMS=="usb", ATTRS{serial}=="5432", KERNEL=="ttyUSB*", SYMLINK+="smartmeter"
111+
SUBSYSTEMS=="usb", ATTRS{serial}=="1234", KERNEL=="ttyUSB*", SYMLINK+="marstek"
112+
```
113+
114+
You can find the serial number of your device (assumed to be named `ttyUSB0`)
115+
udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0)
116+
using the somewhat clunky command:
117+
118+
```bash
119+
udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0)
120+
```
121+
101122
# Deploy
102123

103124
You can use the deploy script `install.sh` to deploy.

0 commit comments

Comments
 (0)