Skip to content

Commit

Permalink
add udev rules files
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyIvan359 committed Oct 11, 2020
1 parent bd70fe4 commit 39bddbe
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ automation setup much in order to interface with this version of MQTTany.
* Config option flag `secret` to obfuscate values in the log for passwords, etc.
* **I2C** If `bus` is a number, checks for path `/dev/i2c{bus}` as well as
`/dev/i2c-{bus}` now.
* `udev` rule files to help with hardware permissions.

* **Changed**
* Convert all string formatting to use *f-strings*. This change means you must be using
Expand Down
8 changes: 8 additions & 0 deletions udev/98-gpio.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", \
RUN="/bin/sh -c ' \
chown -L root:gpio /sys/${DEVPATH}/active_low \
/sys/${DEVPATH}/direction \
/sys/${DEVPATH}/edge \
/sys/${DEVPATH}/uevent \
/sys/${DEVPATH}/value \
'"
1 change: 1 addition & 0 deletions udev/98-i2c.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
13 changes: 13 additions & 0 deletions udev/98-w1.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SUBSYSTEM=="w1", DRIVER=="w1_master_driver", ACTION=="add", \
RUN="/bin/sh -c ' \
chown -L root:wire /sys${DEVPATH}/w1_* \
/sys${DEVPATH}/uevent \
'"
SUBSYSTEM=="w1", DRIVER=="w1_slave_driver", ACTION=="add", \
RUN="/bin/sh -c ' \
chown -L root:wire /sys${DEVPATH}/id \
/sys${DEVPATH}/name \
/sys${DEVPATH}/rw \
/sys${DEVPATH}/uevent \
/sys${DEVPATH}/w1_slave \
'"

0 comments on commit 39bddbe

Please sign in to comment.