Installing Cwiid python library on Angstrom

102 views
Skip to first unread message

jordan....@gmail.com

unread,
Jan 27, 2015, 4:24:06 PM1/27/15
to beagl...@googlegroups.com
Hi all,
          I'm having trouble installing Cwiid on my beaglebone black running Angstrom. Ideally I'd like to install cwiid-python with opkg but can't seem to find the right repo. I've found debian packages for cwiid-python, but no angstrom ones. I've found cwiid-dbg in the angstrom debug repo, but that just seems to be the C library. If I try to import cwiid into python I get this error: 
ImportError: No module named cwiid.
         I tried compiling from source but get this error:

configure: error: flex missing yypop_buffer_state - upgrade to version 2.5.33 or later

         I'm also reading that cwiid would have to be cross-compiled for Arm, and I don't know how to do that. Does anyone know where I can get Cwiid precompiled for angstrom?

        Thanks--

jordan....@gmail.com

unread,
Feb 2, 2015, 7:11:15 PM2/2/15
to beagl...@googlegroups.com, jordan....@gmail.com
I took me several days but I was able to figure this out:
in cwiid/wminput/Makefile:
I had to add the path to python in the cflags:

CFLAGS += -I/usr/include/python2.7/ -I../libcwiid \

include it in the LDLIBS:

LDLIBS += -lpython -lcwiid -lbluetooth -ldl -lpthread

add it to the LDLIBS:

LDFLAGS += -L/usr/include/python2.7/ -L../libcwiid -rdynamic

And comment these lines out in ifdef PYTHON section:

#       CFLAGS += -I/usr/include/python^[[?1034h2.7

#       LDLIBS += -lpython^[[?1034h2.7

if I try and import cwiid from python, I get this error:

ImportError: libcwiid.so.1: cannot open shared object file: No such file or directory

But if I run 

LD_PRELOAD=/usr/local/lib/libcwiid.so python wiimotetest.py

then it works. I've tried running ldconfig, I'm not sure how I can get the library properly installed, but this works as a workaround.

jordan....@gmail.com

unread,
Feb 2, 2015, 7:12:26 PM2/2/15
to beagl...@googlegroups.com, jordan....@gmail.com
Oh yeah and I had to compile an earlier version of flex that supported yypop_buffer_state and replace it in /usr/bin.


On Tuesday, January 27, 2015 at 1:24:06 PM UTC-8, jordan....@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages