Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add udev rules files #63

Merged
merged 1 commit into from
Oct 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 \
'"