Code Monkey home page Code Monkey logo

Comments (4)

allenbina avatar allenbina commented on May 30, 2024

I think the permissions issue can be fixed by adding your user to uinput group. I copied this from the readme. This assumes you are using the pi username.

Run the code as a non root user

You must first create the uinput group

sudo addgroup uinput

Then add the pi user to the uinput group

sudo adduser pi uinput

from es-cec-input.

evbernardes avatar evbernardes commented on May 30, 2024

Having the same problem, Raspi 3B+ with the latest retropie. Created the group and added pi to it, still have the same problem

from es-cec-input.

Markisen avatar Markisen commented on May 30, 2024

I found the solution here: tuomasjjrasanen/python-uinput#6 (comment)
I also needed to do the following:

Change group ownership and permissions on /dev/uinput:

sudo chmod g+rw /dev/uinput
sudo chgrp uinput /dev/uinput

from es-cec-input.

Kenarude avatar Kenarude commented on May 30, 2024

Hello,
I'm not an expert on linux but by using what was said in this thread and made some search, I would like to share my 2 cents knowledge.
I think there was some changes in the way the access right are assigned to /dev/uinput. I figured out how to make it working as it was previously.
First, as I fell into the trap I give a clue :), the udev rules are in 3 lines and not on one line only (the magic of copy/paste)
So I added GROUP to the uinput device otherwise it is assigned to the root.

ACTION=="add|change", KERNEL=="event[0-9]*", ENV{ID_VENDOR_ID}=="012a", ENV{ID_MODEL_ID}=="034b", ENV{ID_INPUT_KEYBOARD}="1", ENV{ID_INPUT_TABLET}="1"
SUBSYSTEM=="input", ATTRS{name}=="python-uinput", ENV{ID_INPUT_KEYBOARD}="1"
KERNEL=="uinput", GROUP="uinput", MODE:="0660"

What can be done also is instead of using a crontab rule to start the script we can use a user systemd service.
Create the folder ~/.config/systemd/user if it doesn't exist.
Create a file named for example cec.service into that folder.
add the following information (take care to set correctly the path to your script)

[Unit]
Description=CEC to keyboard input converter

[Service]
ExecStart=python /path/to/the/script/es-cec-input.py

[Install]
WantedBy=default.target

When done, enable the service

systemctl --user enable cec.service

Now you can reboot and test if it works.

I think this could also be done with a systemd system service so as not to change the uinput group but I haven't tried it yet.

from es-cec-input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.