jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Installing #878

Open MarkP63 opened 8 months ago

MarkP63 commented 8 months ago

Still can't find adequate or easy instructions to set this api up. Clone doesn't work directory doesn't exist etc. I'm not a coder but have a successful HB set working with many plugins but Sonos has me beaten. Any assistance appreciated. Have greyed out icons in Home App but they don't seem to control anything. The ZP plugin I can see works in HB terminal window in that it sees tracks from Sonos radio stations but nothing in Home App. image

Was also getting this from log re api plugin "[24/10/2023, 11:38:04] [Sonos] fail Error: connect ECONNREFUSED ‡1:5005 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '::1 port: 5005"

jsiegenthaler commented 8 months ago

What is your Homebridge running on? I have an install script for a Raspberry Pi.

MarkP63 commented 8 months ago

Yes HB running on Raspberry Pi 4. It was installed as image from an SD card if I recall so most of my interaction with the pi is via the HB UI and the Terminal Consol (sudo hb-config). Having said that I do believe I also managed to install Wireguard which I assume is outside of the HB container.

Many thanks

Mark

From: jsiegenthaler @.> Reply to: jishi/node-sonos-http-api @.> Date: Tuesday, 24 October 2023 at 20:38 To: jishi/node-sonos-http-api @.> Cc: Hide My Email @.> Subject: Re: [jishi/node-sonos-http-api] Installing (Issue #878)

What is your Homebridge running on? I have an install script for a Raspberry Pi.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

jsiegenthaler commented 8 months ago

OK, your setup is same as mine. Here's my install script, nicely documented: Install script for sonos-http-api.txt

You need to install it from an admin user, not as the homebridge user. So don't use the Homebridge Console to install (as the Console runs under the Homebridge user). Standard admin user is "pi" (prompt shows pi@raspberrypi:)

MarkP63 commented 8 months ago

Thank you very much, appreciate it. Sorry to be dim (and I need to read through again) but have a few questions if I may;1) Does this run outside of HB say as a separate server/application?2) what is PM2?3) what kind of file (empty) is needed to be created?4) the .json file mentions that changes to txt file what is this for?5) whilst I will backup HB from its UI I am trying to ensure I dont corrupt the installation/image or its own json file…..Sorry if this is 101 Linux but I am generally a logical person but don’t claim to be coder. Basic Linux commands I can master if i look them up but it’s not native me. Dos yes, Mac GUI etc but Linux is not my strength.CheersMark   On 24 Oct 2023, at 20:57, jsiegenthaler @.***> wrote: OK, your setup is same as mine. Here's my install script, nicely documented: Install script for sonos-http-api.txt

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

jsiegenthaler commented 8 months ago

The sonos http api is completely separate to Homebridge and does not need Homebridge. Homebridge is not relevant. The sonos http api is a separate program (a server program) that installs on the raspberry pi. Logon to your pi as the pi user. This is the main user of the pi. Then run the script. Use only the commands relevant to your installation. If you don't have or want pm2, leave those steps out. PM2 is ProcessMonitor2 (https://pm2.keymetrics.io/). You don't need this but it helps a lot as keeps the sonos http api server running and restarting after pi reboots.