EvDev & EINVAL Error

I’m trying to get the evdev device to work with lv_micropython and I’m getting an EINVAL error when the driver tries to read from the /dev/input/event1 device.

Just trying:

dv = open("/dev/input/event2")
dv.read(1)

I get the EINVAL error.

print(dv ) says: <io.FileIO 3>, which seems fine.

Changing the device path to a file name works file.

Any thoughts?

This is running on a Seeed Re:Terminal.

Running the same simple read from normal python works fine.

Hi @purpledread !

It’s probably related to the device permissions.

Try running lv_micropython with sudo, or try to chmod the device.
I tested it now on ubuntu 20.04 and it works fine:

sudo ports/unix/micropython-dev -i lib/lv_bindings/examples/fb_test.py