sebbo2002 / pyatv-mqtt-bridge

Bridge which allows you to control your Apple TV via MQTT
MIT License
37 stars 8 forks source link

syntax error #337

Closed darkside9009 closed 6 months ago

darkside9009 commented 6 months ago

Hello,

I have installed the pyatv and then your pyatv-mqtt-bridge in a LXC container in proxmox. I can connect to my Apple TV with pyatv. Now I'm trying to get your bridge working, but first question is, where should I locate the config.json file? When I start pyatv-mqtt-bridge with pyatv-mqtt-bridge --debug /home/eve/pyatv-mqtt-bridge.json then I get this MSG:

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@sebbo2002/pyatv-mqtt-bridge/node_modules/mqtt/build/lib/topic-alias-send.js:3:21)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

I really don't know how to solve this issue.

sebbo2002 commented 6 months ago

Hello @darkside9009, unfortunately I cannot provide any support for the use in an LXC container. The config.json can be located anywhere. The only important thing is that pyatv-mqtt-bridge can read this file. The home directory is therefore perfectly fine. Your stacktrace suggests that the error message comes from the mqtt module. Please check whether your environment (node version, dependencies, etc.) is correct for this module by testing a small example in this container. If you have any questions regarding this module, please contact us again or open a new ticket.

darkside9009 commented 6 months ago

Hi, thanks for your fast reply. I'm using node v12.22.12. Do you think I can check for more details? How can I check the mqtt module? I also saw in a German forum, that few people got similar problem with LXC container, but nobody was able to fix it. I'm sure they would like to use it too.

darkside9009 commented 6 months ago

Hi, I saw in the installation, that the node version required is V18. I have updated the node to V20. Now, there is no error:

root@pyatv-apple-tv:~# pyatv-mqtt-bridge /home/eve/pyatv-mqtt-bridge.json
# pyatv-mqtt-bridge
----------------------------
Usage: pyatv-mqtt-bridge [--debug] ~/pyatv-mqtt-bridge-config.json

Is this correct? Problem is I cannot see any msg on my MQTT explorer.

sebbo2002 commented 6 months ago

If you see the Usage message, it means that the specified path is not correct (see implementation: https://github.com/sebbo2002/pyatv-mqtt-bridge/blob/develop/src/bin/cli.ts#L14). Please check that the path was passed as the last argument and that the permissions are correct.