Skip to content

Commit 11e0837

Browse files
authored
Encoder: added a note about permissions
1 parent 3d7fba9 commit 11e0837

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

Adafruit_BBIO/README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This module enables access to the Beaglebone Black enhanced Quadrature Encoder P
44

55
## Usage
66

7-
On a recent Beaglebone Debian image, access to the eQEP0 and eQEP2 channels should work out of the box:
7+
On a recent Beaglebone Debian image, access to the eQEP0 and eQEP2 channels should work out of the box, at least as root user. To ensure you can run the code as a regular user, read on the prerequisites section below.
88

99
```python
1010
from Adafruit_BBIO.Encoder import RotaryEncoder, eQEP2
@@ -64,6 +64,8 @@ If you need to use further channels, read on the prerequisites in the following
6464

6565
## Prerequisites
6666

67+
### Kernel and packages
68+
6769
These instructions are based on:
6870

6971
- Linux kernel: 4.4.x or later
@@ -77,6 +79,23 @@ sudo apt update
7779
sudo apt upgrade bb-cape-overlays bb-customizations
7880
```
7981

82+
### User permissions
83+
84+
In order to be able to run code that accesses the eQEP modules as a regular user, as opposed to root, that user must be part of the `eqep` group.
85+
86+
To check which users are part of the `eqep` group:
87+
88+
```
89+
cat /etc/group | grep eqep
90+
```
91+
92+
To add user `userName` to the `eqep` group (run this command as root):
93+
```
94+
usermod -a -G eqep userName
95+
```
96+
97+
### Capes
98+
8099
In order to use all eQEP pins the BeagleBone must boot with the [cape-universal](https://github.com/beagleboard/bb.org-overlays/tree/master/tools/beaglebone-universal-io) enabled, and load the `cape-universal` overlay.
81100

82101
This is the default, thus **no further steps are initially required to use eQEP0 and eQEP2**. Simply double-check that the following line is present and not commented out on your `/boot/uEnv.txt` file:
@@ -87,7 +106,7 @@ enable_uboot_cape_universal=1
87106

88107
Note: Some older documentation recommends using the `cmdline` and `cape_enable` options instead. They are meant to load deprecated kernel-based overlays and it's not recommended to use them. Use the new way of [loading overlays via uboot](https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays) instead, as instructed above.
89108

90-
### Enabling additional eQEP modules
109+
#### Enabling additional eQEP modules
91110

92111
The `cape-universal` overlay will enable access to the eQEP0 and eQEP2 modules. As it does not expose pins that are shared with the HDMI interface, eQEP1 and eQEP2b will **not** be available.
93112

0 commit comments

Comments
 (0)