05-20-2024, 03:13 PM
(05-20-2024, 02:25 AM)TheOldPresbyope Wrote: @thestreamdigger
I have no suitable hardware encoder to connect to a moOde player, but...
With moOde r900 running on a Pi3A+, when I enable the Rotary Encoder I see in the journal that the rotenc service has started
Code:xxx@m900pi3ap:~ $ journalctl -g rotenc
-- Boot ba831770f74b4de29376b5a84ae21e63 --
-- Boot d7a17260dc3d4ea0b6f15534bce1b489 --
May 19 22:06:14 m900pi3ap systemd[1]: Configuration file /lib/systemd/system/rotenc.service is marked executable. Please re>
May 19 22:06:14 m900pi3ap systemd[1]: Configuration file /lib/systemd/system/rotenc.service is marked executable. Please re>
May 19 22:06:14 m900pi3ap systemd[1]: Configuration file /lib/systemd/system/rotenc.service is marked executable. Please re>
May 19 22:06:17 m900pi3ap systemd[1]: Configuration file /lib/systemd/system/rotenc.service is marked executable. Please re>
May 19 22:06:17 m900pi3ap systemd[1]: Started rotenc.service - Moode Rotary Encoder Driver.
As well, pgrep rotenc.py returns the process number 3212.
Curious that you don't see it running. What do you get when you search the journal as I did above?
Regards,
Kent
@Tim Curtis --- Note that another service unit marked executable has slipped in. Not relevant to the OPs problem, but spams the journal.
Also, Do we know rotenc.py will run on a Pi5? I have no first hand knowledge of this piece of code but any Python code which deals with gpio is suspect (a matter of the correct library being loaded and used).
This my journalctl result:
Code:May 19 18:42:40 breaka systemd[1]: Configuration file /lib/systemd/system/rotenc.service is marked executable. Please r>
May 19 18:42:40 breaka systemd[1]: Started rotenc.service - Moode Rotary Encoder Driver.
May 19 18:42:40 breaka rotenc.py[1285]: File "/var/www/daemon/rotenc.py", line 170, in <module>
May 19 18:42:40 breaka rotenc.py[1285]: File "/var/www/daemon/rotenc.py", line 61, in main
May 19 18:42:41 breaka systemd[1]: rotenc.service: Main process exited, code=exited, status=1/FAILURE
May 19 18:42:41 breaka systemd[1]: rotenc.service: Failed with result 'exit-code'.
Consulting the status of the service I get:
Code:
pi@breaka:~ $ sudo systemctl status rotenc.service
× rotenc.service - Moode Rotary Encoder Driver
Loaded: loaded (/lib/systemd/system/rotenc.service; disabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2024-05-20 11:49:36 -03; 1s ago
Duration: 222ms
Process: 2088 ExecStart=/var/www/daemon/rotenc.py 100 2 3 24 23 (code=exited, status=1/FAILURE)
Main PID: 2088 (code=exited, status=1/FAILURE)
CPU: 215ms
May 20 11:49:36 breaka systemd[1]: Started rotenc.service - Moode Rotary Encoder Driver.
May 20 11:49:36 breaka rotenc.py[2088]: Traceback (most recent call last):
May 20 11:49:36 breaka rotenc.py[2088]: File "/var/www/daemon/rotenc.py", line 170, in <module>
May 20 11:49:36 breaka rotenc.py[2088]: main()
May 20 11:49:36 breaka rotenc.py[2088]: File "/var/www/daemon/rotenc.py", line 61, in main
May 20 11:49:36 breaka rotenc.py[2088]: GPIO.add_event_detect(pin_a, GPIO.BOTH, callback=encoder_isr) # NOTE: bounc>
May 20 11:49:36 breaka rotenc.py[2088]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 20 11:49:36 breaka rotenc.py[2088]: RuntimeError: Failed to add edge detection
May 20 11:49:36 breaka systemd[1]: rotenc.service: Main process exited, code=exited, status=1/FAILURE
May 20 11:49:36 breaka systemd[1]: rotenc.service: Failed with result 'exit-code'.
It's strange that this issue occurs for me on a fresh install and not for everyone.