How to install on Angstrom (beaglebone)?

Asked by Anton Venediktov

Hi,
I am trying to get uinput working on a Beaglebone running angstrom distro. I installed libudev0 (I assume an angstrom version of libudev-dev package), but when trying to do
python setup.py install --prefix=/usr/local

I get the fatal error: libudev.h: No such file or directory error.

Any advice on what I am doing wrong?

Thanks,
Anton

Question information

Language:
English Edit question
Status:
Solved
For:
python-uinput Edit question
Assignee:
a Edit question
Solved by:
Anton Venediktov
Solved:
Last query:
Last reply:
Revision history for this message
a (tuomasjjrasanen) said :
#1

Hi

libudev0 provides just the library, but you need also the development files (headers in this case). It seems that udev-dev package provides those ( http://www.angstrom-distribution.org/repo/?pkgname=udev-dev ). Install udev-dev and you should be fine.

BR,
Tuomas

Revision history for this message
Anton Venediktov (antonv-2) said :
#2

Thanks for the quick response. After installing the udev-dev package I am now getting the following error:

libsuinput/src/suinput.c:19:19: fatal error: errno.h: No such file or directory
compilation terminated.

However, errno.h is present in /usr/include directory... as well as /usr/include/asm directory

Revision history for this message
a (tuomasjjrasanen) said :
#3

Hi and sorry for answering so slowly

The error you are encountering seems a bit strange, suggesting that your c-compiler does not look inside /usr/include for header-files..

However, you could try to pass it explicitly with:

CFLAGS=-I/usr/include python setup.py build

Revision history for this message
Anton Venediktov (antonv-2) said :
#4

OK, it looks like it finally installed.

Just a note, I had to remove
--sysroot=/OE/angstrom-v2012-05/build/tmp-angstrom_v2012_05-eglibc/sysroots/beaglebone
from the Makefile in /usr/lib/python2.7/config

Now... trying to run keyboard.py example - getting the following:

Traceback (most recent call last):
  File "keyboard.py", line 25, in <module>
    main()
  File "keyboard.py", line 11, in main
    device = uinput.Device(events)
  File "/usr/lib/python2.7/site-packages/uinput/__init__.py", line 108, in __init__
    self.__uinput_fd = _libsuinput.suinput_open()
  File "/usr/lib/python2.7/site-packages/uinput/__init__.py", line 65, in _error_handler
    raise OSError(code, os.strerror(code))
OSError: [Errno 2] No such file or directory

Any ideas?

:-/ ... Thanks for your help.

Anton

Revision history for this message
Anton Venediktov (antonv-2) said :
#5

OK, it works now. I needed to do a "modprobe uinput" before running the code. now the mouse.py example works fine, however the keyboard example worked once and stopped :-/ will look into further, but at least there is a light at the end of the tunnel.

Thanks for your help.
Anton

Revision history for this message
a (tuomasjjrasanen) said :
#6

Regarding the keyboard example issue, try to add time.sleep(1) just after the line device = uinput.Device(events). Does it help?

Revision history for this message
Anton Venediktov (antonv-2) said :
#7

Yes - everything works beautifully - thanks for your help! I was able to make a standard 4x4 keypad driver for beagle bone that works like a charm.

Revision history for this message
a (tuomasjjrasanen) said :
#8

Cool!

The reason why the keyboard example might require the magical sleep is that in most scenarios the example code is executed so fast that it reaches the end before X11 manages to assign a proper handler for the device and hence all events are lost. This ofcourse impacts only this kind of very short example devices. In normal cases, devices created with uinput live much longer than 1 second and do not suffer from this kind of race condition.