Closed brusc closed 6 years ago
It looks like you're trying to build against python 3, but this library is written as a C extension for python 2.7. It looks like the extension API for python 3 has changed.
It looks like the port to python3 isn't too difficult, but it's not going to be quick. In particular module initialization has changed a lot: https://docs.python.org/2/howto/cporting.html
I've started the port on the https://github.com/trainman419/python-cec/tree/devel branch, and ported everything except the module init.
If you want to work on porting the module init, that would be helpful; otherwise I'll get around to it at some point.
Thanks for the info! So when I install via pip2 it installs fine. I have no issue with using python2.7, but python-cec isn't working as I'm getting the CEC failed to open
statement. Is that related to this python issue?
Installing with python2 / pip2 should work. I don't have a machine with libcec3 and an adapter, so I can't confirm that the recent patches to support libcec3 actually work.
I'm also not sure if the raspberry Pi 2 has CEC hardware, or if it's supported by libcec. If you can confirm that the CEC hardware works with the default cec-client
command that comes with libcec, that establishes a baseline and indicates that the bug is in this python wrapper.
The rpi supports cec-client
.
Ping on this issue. Depending on what distro you've got installed, libcec will be compiled without Raspberry Pi support (!).
Double check that cec-client -s
works correctly. I can confirm that the Raspberry Pi 2 has the same Pulse8 CEC adapter onboard.
What else is required for this issue to be closed?
@voltagex thanks for confirming that the hardware on the Pi 2 is supported!
And yes, one of the reasons that I provided binaries of libcec for the raspbian on the Pi 1 is precisely because the originals were built without Raspberry Pi support.
There are three different issues wrapped up here
You've clearly addressed (1); if you're using libcec3 that would also confirm (2).
I should probably open a separate ticket for (3)
@voltagex if you have specific notes about which distros do and don't have Raspberry Pi support compiled in, I can also include that in my README.
@trainman419 thanks for the quick response. Unfortunately I'm not sure what distros do and don't have Pi support compiled in. I'm fairly sure I had to compile libcec et al for Debian Jessie armhf - Raspbian should be set up properly though.
The correct way to find out if it's compiled with Pi support is:
$ cec-client -i
libCEC version: 3.1.0, compiled on Linux-4.1.17-v7+ ... , features: P8_USB, DRM, P8_detect, randr, RPi
(also confirming I'm using libcec 3 from Jessie backports - 3.1.0+dfsg1-4~bpo8+2)
I'm now using libcec 4, compiled on a Raspberry Pi 2 successfully with your library. Ping on Python 3 support, it's blocking me using this with 0mq (Python 3.5+ is all kinds of broken on Jessie, but oh well)
I've compiled some .deb packages for rpi3 by following these steps:
I couldn't follow them exactly, since they gave some issues. Maybe I'll write a guide sometime. You could use my binaries from here https://github.com/michaelarnauts/cec-mqtt-bridge/tree/master/libcec if you don't want to do all the compiling. It's based on the latest libcec4 code (https://github.com/Pulse-Eight/libcec/commit/12fa2750f9fae944956ba0adc2d0298165f975fb). The python3 library seems to work fine.
Thanks for the info, seems we've been trying to do something very similar.
On 29 December 2016 at 22:43, Michaël Arnauts notifications@github.com wrote:
I've compiled some .deb packages for rpi3 by following these steps:
- https://github.com/Pulse-Eight/libcec/blob/master/docs/ README.debian.md and
- https://github.com/Pulse-Eight/libcec/blob/master/docs/ README.raspberrypi.md
I couldn't follow them exactly, since they gave some issues. Maybe I'll write a guide sometime. You could use my binaries from here https://github.com/michaelarnauts/cec-mqtt-bridge/tree/master/libcec if you don't want to do all the compiling. It's based on the latest libcec4 code (Pulse-Eight/libcec@12fa275 https://github.com/Pulse-Eight/libcec/commit/12fa2750f9fae944956ba0adc2d0298165f975fb). The python3 library seems to work fine.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trainman419/python-cec/issues/12#issuecomment-269618899, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJvT9RLPRpImICPgaJgVP7FQ82w8NOLks5rM5zLgaJpZM4H9UHa .
I've got a fork going which completes the Python3 upgrade that @trainman419 started last year. I haven't fully tested it yet but it seems to be working for me (tested on a RP3): https://github.com/tmcneal/python-cec/tree/devel
Python3 support has merged with #20.
I'm running on a RP2 running Raspbian Jessie. I'm getting an error when I try to use the command
sudo pip install cec
command.If I try
sudo pip2 install cec
, it installs correctly, but when calling a python script it fails withLibcec3.0 is installed and working correctly.
Any ideas?