On Wed, Jun 17, 2020 at 2:26 AM Mark A. Yoder <[email protected]> wrote: > > I'm trying to use the encoders via Python: > > from Adafruit_BBIO.Encoder import RotaryEncoder, eQEP2 > import time > > > # Instantiate the class to access channel eQEP2, and initialize > # that channel > myEncoder = RotaryEncoder(eQEP2) > > > # Get the current position > > > while True: > cur_position = myEncoder.position > print(cur_position) > time.sleep(1) > > But I get the following error: > > Traceback (most recent call last): > File "./eQEP.py", line 8, in <module> > myEncoder = RotaryEncoder(eQEP2) > File > "/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/Encoder.py", > line 195, in __init__ > self._eqep = _eQEP.fromdict(_eQEP_DEFS[eqep_num]) > File > "/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/Encoder.py", > line 126, in fromdict > return cls(**df) > File > "/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/Encoder.py", > line 150, in __init__ > self.node = Node(sys_path) > File > "/usr/local/lib/python3.7/dist-packages/Adafruit_BBIO-1.1.1-py3.7-linux-armv7l.egg/Adafruit_BBIO/sysfs.py", > line 78, in __init__ > self.__dict__.update(dict.fromkeys(listdir(self._path_))) > FileNotFoundError: [Errno 2] No such file or directory: > '/sys/devices/platform/ocp/48304000.epwmss/48304180.eqep' > > > I'm running a current image: > > cat /ID.txt > BeagleBoard.org Debian Buster IoT Image 2020-04-06 > name -a > Linux pocket 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 > armv7l GNU/Linux > > Any suggestions on how to make it work? > > --Mark
I think the problem is /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep is missing. It is possible the eQEP driver is not being loaded. I've not tried to use it in a long time. Which image are you using? I can try to replicate. thanks, drew -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAEf4M_AkNN%3Dy0G86a6v5HijkGg7WgQ7hCctemqXQDAFqumbKwQ%40mail.gmail.com.
