michaelarnauts / cec-mqtt-bridge

A HDMI-CEC to MQTT bridge for connecting HDMI-CEC-devices to your Home Automation system.
145 stars 48 forks source link

"No module named 'cec'" on latest OSMC #17

Closed sunnythaper closed 2 years ago

sunnythaper commented 5 years ago

After following all the instructions related to CEC (including the "install libcec" step) on your guide, I am getting the following error when trying to run bridge.py:

osmc@osmc:/opt/cec-mqtt-bridge$ python3 bridge.py
Initialising CEC...
ERROR: Could not initialise CEC: No module named 'cec'

On this machine (Raspberry Pi) I can run cec-client commands just fine to turn on/off the connected devices (just a TV in my case). It also shows up on my Samsung as any Anynet+ device and can be controlled by my stock TV remote.

Any ideas? I love the project concept and would absolutely love to get this going!

sunnythaper commented 5 years ago

A little further digging, I decided to compile libcec directly using your instructions once again in the wiki. This time I am getting a new error:

osmc@osmc:/opt/cec-mqtt-bridge$ python3 bridge.py
Initialising CEC...
ERROR: Could not initialise CEC: /usr/local/lib/python3.5/dist-packages/_cec.so: undefined symbol: _ZN11StringUtils6FormatB5cxx11EPKcz
mjcumming commented 5 years ago

I am seeing the same error per your second post.

thecrane commented 5 years ago

I get the same error as your first message. Any joy in getting this solved?

thecrane commented 5 years ago

And then again, same error as per your second post. :-(

sunnythaper commented 5 years ago

@thecrane I personally haven't figured it out yet :/

michaelarnauts commented 5 years ago

Sorry all, I'm running this on a raspberry pi with raspbian. I also have a Vero4K+ box with OSMC, but I had no luck in getting it to run on it since it conflicts with the CEC integration of Kodi itself.

thecrane commented 5 years ago

Ah. Thanks @michaelarnauts - that's actually what I suspected, but was hoping wasn't the case.

It would be brilliant if the Kodi CEC integration would allow the recording of CEC events - or even the logging of them. Then we could watch the log and publish the events for others that are interested in them on the network.

michaelarnauts commented 5 years ago

I made progress with CEC of running it together with Kodi.

I've added instructions for compiling on a Vero4K+ on the wiki here. I'm not using the rpi anymore to run OSMC, so I can't test the rpi instructions, but they should be mostly the same...

It's important that the cmake-command of libcec gives this output.

...
-- AOCEC support:                          yes
-- Python support:                         version 3.5.3 (3.5)
thecrane commented 5 years ago

I made progress with CEC of running it together with Kodi.

I've added instructions for compiling on a Vero4K+ on the wiki here. I'm not using the rpi anymore to run OSMC, so I can't test the rpi instructions, but they should be mostly the same...

It's important that the cmake-command of libcec gives this output.

...
-- AOCEC support:                          yes
-- Python support:                         version 3.5.3 (3.5)

Thanks @michaelarnauts - I've tried this, but when I run bridge.py it still gives the error: ERROR: Could not initialise CEC: /usr/local/lib/python3.5/dist-packages/_cec.so: undefined symbol: _ZN11StringUtils6FormatB5cxx11EPKcz

Am I doing something wrong re: running the bridge?

michaelarnauts commented 5 years ago

It seems I get some related results when Googling for b5cxx11, you might want to explore that.