NorthernMan54 / homebridge-cmd-television

20 stars 1 forks source link

Getting architecture error in Homebridge. Is the issue with my Python or my pyatv install or something else? #24

Closed slurpera closed 1 year ago

slurpera commented 1 year ago

Hi, ultra noob here but pretty good at following instructions.

Any idea what is wrong with my install? I can get atvremote commands to work in terminal, but keep getting architecture errors in homebridge using the plugin. Thanks for the help.

[10/28/2022, 2:30:36 AM] [cmd-television] getPowerState error: Error: Command failed: /Users/XXX/pyatv_venv/bin/atvremote --id 58:D3:49:E7:61:B3 --airplay-credentials `cat /Users/XXX/Documents/Homebridge/Credentials/atv_airplay.cred` --companion-credentials `cat /Users/XXX/Documents/Homebridge/Credentials/atv_companion.cred` power_state
Traceback (most recent call last):
  File "/Users/XXX/pyatv_venv/bin/atvremote", line 5, in <module>
    from pyatv.scripts.atvremote import main
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/pyatv/__init__.py", line 18, in <module>
    from pyatv.core.scan import (
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/pyatv/core/scan.py", line 32, in <module>
    from pyatv.helpers import get_unique_id
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/pyatv/helpers.py", line 6, in <module>
    import miniaudio
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/miniaudio.py", line 22, in <module>
    from _miniaudio import ffi, lib
ImportError: dlopen(/Users/XXX/pyatv_venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so, 0x0002): tried: '/Users/XXX/pyatv_venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))`
NorthernMan54 commented 1 year ago

This is the command line the plugin is executing that is triggering the error

/Users/XXX/pyatv_venv/bin/atvremote --id 58:D3:49:E7:61:B3 --airplay-credentials `cat /Users/XXX/Documents/Homebridge/Credentials/atv_airplay.cred` --companion-credentials `cat /Users/XXX/Documents/Homebridge/Credentials/atv_companion.cred` power_state

Can you try that from the command line. Also I believe it needs to be executable by the user account running homebridge

slurpera commented 1 year ago

I got it to work by reinstalling pyatv in x86_64 using the command “arch -x86_64 pip3 install pyatv”

Thanks for the response!