Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

airsonos on Synology #22

Open
ghost opened this issue May 12, 2014 · 109 comments
Open

airsonos on Synology #22

ghost opened this issue May 12, 2014 · 109 comments
Labels

Comments

@ghost
Copy link

ghost commented May 12, 2014

A great tool, I enjoy day by day, but the mac needs to run all the time.
My Synology is running 24/7, so why not running there?
as node.js can be installed on the synology, can airsonos run on that one as well?

@stephen
Copy link
Owner

stephen commented May 15, 2014

Synology runs a linux-variant I believe, so theoretically yes. AirSonos has a few dependencies that you will need to find packages for, or compile yourself on Linux.

For reference, I know that on a clean Ubuntu box, you need to install at least: libavahi-compat-libdnssd-dev, and libasound2-dev to get AirSonos working.

Let me know how it goes and we can documents steps for others to use.

@dinomite
Copy link

dinomite commented Jul 3, 2014

@Skyryser Did it work on your Synology?

If not, another low power option is to use a Raspberry Pi or Beagle Bone. Someone even has a tutorial for running AirSonos on Raspberry Pi.

@hanssens
Copy link

Indeed, Synology runs on a stripped, bare-boned version of Debian. The main problem seems to be the lack of having apt-get, ipkg or similar package managers. Considering we're also missing some other vital stuff on a basic DiskStation instance, I've managed to do the following to perhaps get us a step further:

  1. Enable SSH on the DiskStation
  2. Install Python 2.7 (through the SynoCommunity Packages)
  3. Install Debian Chroot (through the SynoCommunity Packages)
  4. Reboot (= important)
  5. SSH with root onto your DiskStation using: ssh root@your_synology_ip

Now, in theory we should have access to chroot and therefor have access to apt-get. Unfortunately, on my Synology this is where I'm stuck on, up on to this moment. According to the Debian Chroot documentation (for Synology), I should be able to chroot using:

/var/packages/debian-chroot/scripts/start-stop-status chroot

This works. But running aptitude update or apt-get update doesn't really work.

Perhaps others can give some tips to extend these steps a bit further?

@dejongrr
Copy link

@hanssens, I was able to get it working using this site: https://github.com/SynoCommunity/spksrc/blob/develop/spk/debian-chroot/src/app/help/enu/index.html

I managed to use apt-get udpate and upgrade. Also, libavahi-compat-libdnssd-dev, and libasound2-dev are installed. But when I try to install airsonos, I am getting the error below:

DiskStation> npm install airsonos -g

ursa@0.8.0 install /usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/ursa
node-gyp configure build && node install.js

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python2", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:103:14)
gyp ERR! stack at /volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:42:11
gyp ERR! stack at F (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/which/which.js:43:25)
gyp ERR! stack at E (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (evalmachine.:107:15)
gyp ERR! System Linux 3.2.40
gyp ERR! command "node" "/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /volume1/@appstore/Node.js/usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/ursa
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! Error: ENOENT, open '/usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/build/Release/obj.target/dns_sd_bindings/src/mdns_utils.o'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

etc. etc.


Any help would be very appreciated!

@stephen
Copy link
Owner

stephen commented Sep 30, 2014

gyp ERR! stack Error: Can't find Python executable "python2", you can set the PYTHON env variable.

@dejongrr - I believe node-gyp requires python installed in order to build some packages

@dejongrr
Copy link

I took a look at: https://github.com/TooTallNate/node-gyp/
And based on the info, I used the following command:

DiskStation> npm config set python /volume1/@appstore/python/bin/python2.7

After some minutes I got the following:

ursa@0.8.0 install /usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/ursa
node-gyp configure build && node install.js

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.30"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/ursa/.node-gyp"
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (evalmachine.:107:15)
gyp ERR! System Linux 3.2.40
gyp ERR! command "node" "/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /volume1/@appstore/Node.js/usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/ursa
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm WARN deprecated static-favicon@1.0.2: use serve-favicon module

mdns@2.2.0 install /usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns
node-gyp rebuild

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: ENOENT, no such file or directory
gyp ERR! stack at process.cwd (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:8:19)
gyp ERR! stack at Object.exports.resolve (path.js:309:52)
gyp ERR! stack at configure (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:26:23)
gyp ERR! stack at Object.self.commands.(anonymous function) as configure
gyp ERR! stack at run (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:72:30)
gyp ERR! stack at process._tickCallback (node.js:419:13)
gyp ERR! System Linux 3.2.40
gyp ERR! command "node" "/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:8
cwd = origCwd.call(process)
^
Error: ENOENT, no such file or directory
at process.cwd (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:8:19)
at errorMessage (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:119:28)
at issueMessage (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:125:3)
at process. (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:109:3)
at process.emit (events.js:95:17)
at process._fatalException (node.js:272:26)

lame@1.0.3 install /usr/lib/node_modules/airsonos/node_modules/nicercast/node_modules/lame
node-gyp rebuild

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: ENOENT, no such file or directory
gyp ERR! stack at process.cwd (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:8:19)
gyp ERR! stack at Object.exports.resolve (path.js:309:52)
gyp ERR! stack at configure (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:26:23)
gyp ERR! stack at Object.self.commands.(anonymous function) as configure
gyp ERR! stack at run (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:72:30)
gyp ERR! stack at process._tickCallback (node.js:419:13)
gyp ERR! System Linux 3.2.40
gyp ERR! command "node" "/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:8
cwd = origCwd.call(process)
^
Error: ENOENT, no such file or directory
at process.cwd (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:8:19)
at errorMessage (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:119:28)
at issueMessage (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:125:3)
at process. (/volume1/@appstore/Node.js/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:109:3)
at process.emit (events.js:95:17)
at process._fatalException (node.js:272:26)
npm ERR! ursa@0.8.0 install: node-gyp configure build && node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ursa@0.8.0 install script.
npm ERR! This is most likely a problem with the ursa package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build && node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls ursa
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.40
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /root
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE

lame@1.1.1 install /usr/lib/node_modules/airsonos/node_modules/lame
node-gyp rebuild

Btw, I used a node.js package for my ds214play (evansport): Node.js-evansport-0.10.29-0003

@knusprig55
Copy link

@dejongrr try running the npm command with sudo or as root.

@dejongrr
Copy link

I am connected to my Synology with SSH using root@DiskStation.local, so in my understanding every command is already run as root. Could it be that somehow the ownership got changed, and therefore needs to be changed by chown on .node-gyp folder?

@stephen
Copy link
Owner

stephen commented Oct 1, 2014

gyp ERR! stack Error: not found: make

is make in your path?

@dejongrr
Copy link

dejongrr commented Oct 1, 2014

I used: apt-get install build-essential
Packages like 'make' and 'g++' were installed witch were apparently essential to node-gyp, but I still getting to same error.

@stephen
Copy link
Owner

stephen commented Oct 1, 2014

@dejongrr - Can you verify that make can be found? (which make)

Though installed, it seems node-gyp can't access the build tools it needs - that might be a more conducive place to look.. (i.e. I'm assuming other packages like npm install ursa also fail because your build env is still lacking something..)

@dejongrr
Copy link

dejongrr commented Oct 3, 2014

Oke, so I started again and I think all is good now. It turned out that I installed node on my Synolody OS instead of debian chroot. These are the steps I took:

- Install debian package
- After the install, it will continue to install in the background, so check the cpu.
- When the CPU is down again, restart your synology Nas
- Login using SSH as root
- Type: 
/var/packages/debian-chroot/scripts/start-stop-status chroot
- Type: echo "deb htpp://ftp.nl.debian.org/debian stable main non-free" > /etc/apt/source.list
- Type: apt-get update
- Type: apt-get upgrade
- You might get some errors ragarding Locales.
- Type: apt-get install locales
- Type: dpkg-reconfigure localese
- Choose your locales with space and enter (I used en_US en_GB and nl_NL)
- Type: dpkg-reconfigure tzdata
- Choose your timezone
- Type: apt-get install build-essential
- Type: apt-get install curl
- Type: curl -sl https://deb.nodesource.com/setup | bash -
- Type: apt-get install nodejs
- Type: apt-get install libavahi-compat-libdnssd-dev libasound2-dev
- Type: npm install airsonos -g
- Type: airsonos

Do only error I get now is:
*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
*** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister

I googled around a bit and don't think it will cause any issues.
I can see my sonos systems, but since I am not at home at the moment, I can't check if it really works. I'll post an update.

@dejongrr
Copy link

dejongrr commented Oct 3, 2014

I can confirm it works! Thanks for the feedback! Next step for me will be to auto start debian chroot and airsonos when I reboot my Synology nas.

@coolcatiger
Copy link

Thanks for detailed instructions. I got it running on synology from SSH (using this i need to keep my mac running all the time).

I am trying to use debian chroot console to start airsonos. Has any one tried it ? If yes please share detailed instructions.

It could be useful to know instructions to start airsonos on synology automatically but it is totally fine to run it in background manually.

@stephen
Copy link
Owner

stephen commented Oct 26, 2014

@dejongrr - nice work on this! I'll have to see about putting together guides for these in some central manner (and incl. your work) - maybe under the github wiki, or as markdown file in the project?

@dejongrr
Copy link

Don't know when the issue started, but I'm getting the following error:

root@DiskStation:/# airsonos
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
Searching for Sonos devices on network...
Setting up AirSonos for Living Room {192.168.2.102:1400}

Error: dns service error: unknown
    at new Advertisement (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/lib/advertisement.js:56:10)
    at Object.create [as createAdvertisement] (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/lib/advertisement.js:64:10)
    at NodeTunes.<anonymous> (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/server.js:65:21)
    at Server.g (events.js:180:16)
    at Server.EventEmitter.emit (events.js:92:17)
    at net.js:1055:10
    at process._tickCallback (node.js:419:13)

I am running the latest version of airsonos. It seems that airsonos is able the find all my sonos devices, but they doesn't show up under output devices on my mac.

See the diagnostics below:

AirSonos Diagnostics
node version     v0.10.28
operating sys    linux (ia32)

Searching for Sonos devices on network...

Device  {"host":"192.168.2.101","port":1400} (ZPS1)
`- attrs:   {"CurrentZoneName":"Play:1",
        "CurrentIcon":"x-rincon-roomicon:living",
        "CurrentConfiguration":"1"}
`- info:    {"SoftwareVersion":"27.2-80271",
        "DisplaySoftwareVersion":"5.1",
        "HardwareVersion":"1.8.3.7-2",
        "IPAddress":"192.168.2.101",
        "MACAddress":"XX:XX:XX:XX:XX:BA",
        "CopyrightInfo":"© 2004-2014 Sonos, Inc. All Rights Reserved.",
        "ExtraInfo":"OTP: ",
        "HTAudioIn":"0"}
`- topology:    [{"group":"RINCON_000E582D6D2C01400:1",
        "coordinator":"true",
        "wirelessmode":"0",
        "channelfreq":"2437",
        "behindwifiext":"0",
        "location":"http://192.168.2.102:1400/xml/device_description.xml",
        "version":"27.2-80271",
        "mincompatibleversion":"26.0-00000",
        "legacycompatibleversion":"24.0-0000",
        "bootseq":"95",
        "uuid":"RINCON_000E582D6D2C01400",
        "name":"Living Room"},{"group":"RINCON_B8E93753DABA01400:7",
        "coordinator":"true",
        "wirelessmode":"0",
        "channelfreq":"2437",
        "behindwifiext":"0",
        "location":"http://192.168.2.101:1400/xml/device_description.xml",
        "version":"27.2-80271",
        "mincompatibleversion":"26.0-00000",
        "legacycompatibleversion":"24.0-0000",
        "bootseq":"31",
        "uuid":"RINCON_B8E93753DABA01400",
        "name":"Play:1"}]


Device  {"host":"192.168.2.102","port":1400} (ZP90)
`- attrs:   {"CurrentZoneName":"Living Room",
        "CurrentIcon":"x-rincon-roomicon:living",
        "CurrentConfiguration":"1"}
`- info:    {"SoftwareVersion":"27.2-80271",
        "DisplaySoftwareVersion":"5.1",
        "HardwareVersion":"1.1.16.4-2",
        "IPAddress":"192.168.2.102",
        "MACAddress":"XX:XX:XX:XX:XX:2C",
        "CopyrightInfo":"© 2004-2014 Sonos, Inc. All Rights Reserved.",
        "ExtraInfo":"r8: 16.0-7",
        "HTAudioIn":"0"}
`- topology:    [{"group":"RINCON_B8E93753DABA01400:7",
        "coordinator":"true",
        "wirelessmode":"0",
        "channelfreq":"2437",
        "behindwifiext":"0",
        "location":"http://192.168.2.101:1400/xml/device_description.xml",
        "version":"27.2-80271",
        "mincompatibleversion":"26.0-00000",
        "legacycompatibleversion":"24.0-0000",
        "bootseq":"31",
        "uuid":"RINCON_B8E93753DABA01400",
        "name":"Play:1"},{"group":"RINCON_000E582D6D2C01400:1",
        "coordinator":"true",
        "wirelessmode":"0",
        "channelfreq":"2437",
        "behindwifiext":"0",
        "location":"http://192.168.2.102:1400/xml/device_description.xml",
        "version":"27.2-80271",
        "mincompatibleversion":"26.0-00000",
        "legacycompatibleversion":"24.0-0000",
        "bootseq":"95",
        "uuid":"RINCON_000E582D6D2C01400",
        "name":"Living Room"}]

@stephen
Copy link
Owner

stephen commented Nov 16, 2014

Don't know when the issue started, but I'm getting the following error:

I think the Error: dns service error: unknown signals that there's a problem with avahi attempting to use mdns to broadcast that the device is available. Have you upgraded those packages recently?

One thing you might be able to try is doing a rebuild (or perhaps uninstalling/installing) if the bindings no longer match up.

@dejongrr
Copy link

Reinstall of the debian-chroot package did the trick!

Here is an update of the steps I took:

  • Install debian package from the synology community
  • After the install, it seems continue to install or configure in the background, so check the cpu.
  • When the CPU is down again, restart your synology Nas and make sure Debian Chroot is running.
  • Login using SSH from your pc as root (From mac terminal: ssh root@DiskStation.local -p22)
  • Type: /var/packages/debian-chroot/scripts/start-stop-status chroot
  • Type: apt-get update
  • Type: apt-get upgrade
  • You might get some errors ragarding Locales.
  • Type: apt-get install locales
  • Type: dpkg-reconfigure locales
  • Choose your locales with space and enter (I used en_US en_GB and nl_NL)
  • Type: dpkg-reconfigure tzdata
  • Choose your timezone with the arrow keys
  • Type: apt-get install build-essential
  • Type: apt-get install nodejs
  • Type: ln -s /usr/bin/nodejs /usr/bin/node
  • Type: apt-get install npm
  • Type: apt-get install libavahi-compat-libdnssd-dev libasound2-dev
  • Type: npm install airsonos -g
  • Type: airsonos

I used "airsonos &" to make sure airsonos keeps running after closing the terminal window. If someone knows how to set-up a proper start-stop script in debian chroot, please reply! My airsonos script path is: usr/local/bin/airsonos

@dejongrr
Copy link

@stephen - Does airsonos even have start and stop arguments? otherwise that would be a nice feature, in addition to a refresh or something.

@pcr23
Copy link

pcr23 commented Nov 25, 2014

First, I would like to say thanks to @stephen for airsonos and @dejongrr for the detailed instructions on how to install it. I wish I was knowledgeable enough to contribute something to this conversation.

Per @dejongrr instructions earlier in the conversation, airsonos was up and running on my synology until I closed terminal. Then a few days later I ran into the same "Error: dns service error: unknown" problem. So, I checked back every couple of days to see if there were any updates and sure enough, today I see new instructions. I uninstalled debian-chroot, restarted server, reinstalled debian-chroot, restarted server. Confirmed debian-chroot was running. Followed the rest of the steps to the letter. However, when I type the final step "airsonos" it says "/usr/bin/env: node: No such file or directory". I can see that it was installed. Any idea what I am doing wrong?

Thanks again.

@stephen
Copy link
Owner

stephen commented Nov 25, 2014

@dejongrr - no, but adding support for library-like usage would make sense. Could open an issue or PR for it.

@dejongrr
Copy link

@pcr23 - I might have forgotten to add that to the instructions, but this should fix it:

@pcr23
Copy link

pcr23 commented Nov 25, 2014

Thank you very much for the help and the info, @dejongrr. Greatly appreciated.

@pcr23
Copy link

pcr23 commented Nov 25, 2014

Ok, everything is working great now. However, when I type "airsonos #" it still stops working when I close terminal. Do I type "airsonos #" as the last step.

BTW-thanks for taking the time to help me understand this. I'm learning slowly but surely.

@RustyDust
Copy link

I'm pretty sure that should read "airsonos &" instead of "aisonos #". the "&" tells your system to put the task in the background where it should keep running even when you close the terminal session.

-Stefan=

@pcr23
Copy link

pcr23 commented Nov 25, 2014

@RustyDust That did the trick. Thanks!

@digiveit
Copy link

Hello,
first of all thank you for the great installation manual. It worked very well for me.
I still have one problem: After I did the last update on my DS411+II and restarted it, I got hte following error message from airsonos:
root@DiskStation:/# airsonos &
[1] 337
root@DiskStation:/# *** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
*** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
Searching for Sonos devices on network...
Setting up AirSonos for Wohnzimmer {192.168.0.36:1400}

Error: dns service error: unknown
at new Advertisement (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/lib/advertisement.js:56:10)
at Object.create as createAdvertisement
at NodeTunes. (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/server.js:74:21)
at Server.g (events.js:180:16)
at Server.emit (events.js:92:17)
at net.js:1055:10
at process._tickCallback (node.js:419:13)

Any suggestions what I can do about it?

With thanks,
Veit

@karelmartens
Copy link

Awesome guide, kudos to dejongrr and stephen!

I do experience the same issue as digiveit, I'm running DSM 5.1-5004 Update 2 on a DS212+

It worked fine after the install from dejongrr but after a reboot I did this from SSH:

root@....>/var/packages/debian-chroot/scripts/start-stop-status chroot
root@.....:/# airsonos &

and I get this:

*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
*** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
Searching for Sonos devices on network...
Setting up AirSonos for Living Room {192.168.2.251:1400}

Error: dns service error: unknown
at new Advertisement (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/lib/advertisement.js:56:10)
at Object.create as createAdvertisement
at NodeTunes. (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/server.js:74:21)
at Server.g (events.js:180:16)
at Server.emit (events.js:92:17)
at net.js:1055:10
at process._tickCallback (node.js:419:13)

Let me know if you want me to troubleshoot anything.

@mrclst
Copy link

mrclst commented Jul 11, 2015

I have the same problem. Everything is installed without any errors and after starting airsonos no speakers can be found. I have a DS212j with DSM 5.2-5592. Airsonos is 0.1.1 and Node is 0.10.29 an everything runs under debian chroot.

After starting airsonos I get the following:
*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
*** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
Searching for Sonos devices on network...

Any suggestions?

@mattlima
Copy link

I had a similar problem; the dockerized version worked for me.

@mrclst
Copy link

mrclst commented Jul 11, 2015

dockerized version does not work on DS212j :-(

@mattlima
Copy link

That's odd because it's mentioned in the release notes for your OS.

@Tatster
Copy link

Tatster commented Jul 15, 2015

Docker isn't available for that hardware model - despite what it says on the release notes for DSM 5.2
https://www.synology.com/en-us/dsm/app_packages/Docker

@Tatster
Copy link

Tatster commented Jul 15, 2015

I ended up forsaking the NAS route and this evening installed on a Raspberry Pi and that works great. Followed the instructions posted by webfuz in this issue #117. Cheaper than upgrading the NAS. The j-series Synology NAS's just don't have the compute power in their processor (won't make that mistake again!)

@kami2011
Copy link

Hi, i have a problem with the installation of the airsonos from github:

root@NAS:/# npm install airsonos -g
npm ERR! git clone git://github.com/stephen/node-sonos.git undefined
npm ERR! git clone git://github.com/stephen/node-sonos.git undefined
npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ENOGIT
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0
root@NAS:/#

Steps before was the procedure of "dejongrr".
Can anyone help me?

@davidmatas
Copy link

@kami2011 Fist of all you need to install git in your Synology: npm ERR! not found: git Take a look if the Git package is available from Package Center.

Then, probably you will also need ipkg for the build. Check what ipkg you need for your Synology model http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc

@kami2011
Copy link

@davidmatas Thank you very much for the quick response.
The PackageCenter (Community package) serves Git, but it look like the git server however i installed it and i also installed in debian chroot git "apt-get install git".

Now if i run the npm airsonos installation routine i run into a new error:
root@NAS:/# npm install airsonos -g
npm WARN engine nodetunes@0.2.1: wanted: {"node":"0.12.x"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN deprecated static-favicon@1.0.2: use serve-favicon module
npm WARN optional dep failed, continuing fsevents@1.0.2

mdns@2.2.10 install /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns
node-gyp rebuild

make: Entering directory '/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/build'
CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
In file included from ../src/mdns.hpp:12:0,
from ../src/dns_sd.cpp:1:
../node_modules/nan/nan.h:316:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
dns_sd_bindings.target.mk:131: recipe for target 'Release/obj.target/dns_sd_bindings/src/dns_sd.o' failed
make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 2.6.32.12
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/mdns
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/forge/node_modules/reactify/node_modules/react-tools/src/browser/server/tests/ReactServerRendering-test.js'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/forge/node_modules/reactify/node_modules/react-tools/src/browser/server/tests/ReactServerRendering-test.js
npm ERR! fstream_path /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/forge/node_modules/reactify/node_modules/react-tools/src/browser/server/tests/ReactServerRendering-test.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/forge/node_modules/jshintify/node_modules/jshint/src/cli.js'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/forge/node_modules/jshintify/node_modules/jshint/src/cli.js
npm ERR! fstream_path /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/forge/node_modules/jshintify/node_modules/jshint/src/cli.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/airsonos/node_modules/babel/node_modules/lodash'
npm ERR! error rolling back airsonos@0.2.4 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/airsonos/node_modules/babel/node_modules/lodash']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/airsonos/node_modules/babel/node_modules/lodash' }
npm ERR! mdns@2.2.10 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mdns@2.2.10 install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/icecast-stack/test/dumps/4EverFloyd-3-8192.mp3'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/icecast-stack/test/dumps/4EverFloyd-3-8192.mp3
npm ERR! fstream_path /usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/icecast-stack/test/dumps/4EverFloyd-3-8192.mp3
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/node-forge/nodejs/ui/test.min.js'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/node-forge/nodejs/ui/test.min.js
npm ERR! fstream_path /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/node-forge/nodejs/ui/test.min.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/lame/deps/lame/configure'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/lame/deps/lame/configure
npm ERR! fstream_path /usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/lame/deps/lame/configure
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/express/node_modules/connect/node_modules/multiparty/test/fixture/multi_video.upload'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/express/node_modules/connect/node_modules/multiparty/test/fixture/multi_video.upload
npm ERR! fstream_path /usr/local/lib/node_modules/airsonos/node_modules/nicercast/node_modules/express/node_modules/connect/node_modules/multiparty/test/fixture/multi_video.upload
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/airsonos/node_modules/babel/node_modules/babel-core/browser.js'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 2.6.32.12
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "airsonos" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/airsonos/node_modules/babel/node_modules/babel-core/browser.js
npm ERR! fstream_path /usr/local/lib/node_modules/airsonos/node_modules/babel/node_modules/babel-core/browser.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /npm-debug.log
npm ERR! not ok code 0
root@NAS:/#

I also tried to install ipkg, should i have to install some packages with ipkg ?
Thanks in advance

@Finariel
Copy link

Did everything intended - everything works fine except of installing Airsonos.
npm install airsonos -g leads to "Illegal Instruction" - Please Help!

@bjeanes
Copy link

bjeanes commented Jan 28, 2016

apt-get kept installing NodeJS 0.10.x for me, even after adding the 0.12.x series sources. I had to explicitly request the right version (which I got from apt-cache policy nodes) with apt-get install nodejs=0.12.9-1nodesource1~jessie1. Unfortunately I couldn't get airsonos to install properly.

In the end I got Airsonos working on my NAS just through docker, using:

$ docker run -d --restart=always --net="host" --name="airsonos" -p 5000-5050:5000-5050/tcp leachbj/airsonos

@ben-germany
Copy link

I have a DS214 and docker does not work on this NAS. So i need to go with debian chroot (can be installed via the packet manager of synology, included in their gui) and used the guide from dejongrr in this thread.

Most of the guide worked for me, only thing I missed in the guide was to install git. If you do not, its not possible to install airsonos via npm command. With git installed, i can install airsonos with npm command. When trying to run airsonos i got some error-messages, that my nodejs was wrong version (to old). I updated nodejs to the newest version (got it direct from nodejs)……voila…..airsonos runs with some warnings, but worked perfect.

Last thing to do was run airsonos automatically and for that i used the script from HenkvdM in this thread. Voila….everything worked now. I can reboot NAS and airsonos starts automatically and worked. Only thing u need to do was "airsonos restart" if you add some more Sonos speaker into your environment.

If you have the possibility to run docker on your NAS (e.g. you have a DS414 oder bigger NAS) I would recommend to go this way. Docker can be installed via Synology packet manager and you find a airsonos docker container have all things on board you need to run it with one click.

Thx a lot to dejongrr and HenkvdM, you did a great job !!!!

@FpazHn
Copy link

FpazHn commented Jan 30, 2016

I got pretty close to install it.

I was never able to update nodejs. I tried everything but it seems the compiled versions available were never compatible with the DS211.

At the end i bought a raspberry 2 and that did it for me.

Sent from my iPhone

On Jan 30, 2016, at 5:23 AM, ben-germany notifications@github.com wrote:

I have a DS214 and docker does not work on this NAS. So i need to go with debian chroot (can be installed via the packet manager of synology, included in their gui) and used the guide from dejongrr in this thread.

Most of the guide worked for me, only thing I missed in the guide was to install git. If you do not, its not possible to install airsonos via npm command. With git installed, i can install airsonos with npm command. When trying to run airsonos i got some error-messages, that my nodejs was wrong version (to old). I updated nodejs to the newest version (got it direct from nodejs)……voila…..airsonos runs with some warnings, but worked perfect.

Last thing to do was run airsonos automatically and for that i used the script from HenkvdM in this thread. Voila….everything worked now. I can reboot NAS and airsonos starts automatically and worked. Only thing u need to do was "airsonos restart" if you add some more Sonos speaker into your environment.

If you have the possibility to run docker on your NAS (e.g. you have a DS414 oder bigger NAS) I would recommend to go this way. Docker can be installed via Synology packet manager and you find a airsonos docker container have all things on board you need to run it with one click.

Thx a lot to dejongrr and HenkvdM, you did a great job !!!!


Reply to this email directly or view it on GitHub.

@ben-germany
Copy link

Hi FpazHn,

the nodejs version which was included in debian chroot was v0.10.29 and does not work because airsonos need something > v0.12.0. So you get a lot of errors and warnings with the result airsonos does not work.

If you look into your sources.list (chroot) you will see that you can find in the section "testing" of your debian sources a newer version. (Other way: Its possible to go to the web page of node.js and you find in the download section "latest" a version 5.x.x for the arm processor which you need for the Synology NAS)

I make it short…..you need a newer nodejs and due to some dependencies to other packages like "gym" you should install newer versions. I installed 5 packages.

To see what software I have installed you can use the following command without any danger (it will not install something):

apt-get install -d nodejs/testing npm/testing node-gyp/testing nodes-dev/testing gym/testing

You will see, that e.g. for nodejs the version 4.2.4 compiled for arm cpu will be selected. And much more info. (If someone do that at later date…the version could be newer….)

Now use the command without "-d" and it will install the packages. Then you can install airsonos (you get some warnings, but thats no problem) and it should work without any problems.

I did it on raspberry before…and yes, its a little easier if you have no good knowledge about chroot. But my NAS runs 24/7 and has enough CPU power. I don't want to operate additional hardware 24/7 only for a small help, which could be done by my NAS easily.

Hope that helps and hope you get it work.

@Cameron82
Copy link

Hi @ben-germany - i think I am getting a similar error message on the nodejs with not an up to date version. But I am struggling to update. Can you walk me through how you did this please?

@ben-germany
Copy link

Hi Cameron82
have you tried the command within chroot and not busy box:
apt-get install -d nodejs/testing npm/testing node-gyp/testing nodes-dev/testing gym/testing
and if yes…what was the result?

First lines should (for node.js) look like the following:
Reading package lists… Done
Building dependency tree
Reading state information… Done
nodejs is already the newest version.
Selected version '4.2.4~dfsg-2' (Debian:testing [armhf]) for 'nodejs'
The following packages were automatically installed and are no longer required:
libc-ares-dev libc-ares2 libv8-3.14-dev libv8-3.14.5
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded
.

@Cameron82
Copy link

Hi @ben-germany, thanks for the quick response. This is the read out I get...

@Cameron82
Copy link

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Release 'testing' for 'nodejs' was not found
E: Release 'testing' for 'npm' was not found
E: Release 'testing' for 'node-gyp' was not found
E: Unable to locate package nodes-dev
E: Unable to locate package gym

@ben-germany
Copy link

Cameron82, either you was not in chroot or your system looks totally different (e.g. you have other version of chroot). Sorry, i can't not help you with this information (this would end in a endless ping pong communictation), for real help i need to log in into your system. If you were not expert enough to know what to do with the information i wrote before some days I propose to ask a friend with Linux knowledge who can support you.

@esstheevau
Copy link

@Cameron82, I ran into the same problems on my Synology DS715 and found a working solution for it: Without digging into it any further I assume certain DiskStation models won't install current versions of nodejs via apt-get (probably due to the Annapurna Alpine architecture they use).

However, you can build and install a current version manually:

  1. Clone the Node repository: git clone https://github.com/nodejs/node.git
  2. Checkout a release tag (e.g. git checkout tags/v0.12.9) as building from the master repo will result in issues when building libalac later
  3. Build Node:
    ./configure --prefix=/usr/local/bin
    make
    make install
  4. Install airsonos: npm install airsonos -g

@macmatt43
Copy link

Despite following all of the instructions above, I still do not have access to apt-get. I.e. when I type in apt-get update I get the "Illegal instruction" error. I have tried adding all sorts of stable and unstable mirrors to the sources file, however this has not fixed the problem. Any ideas?

@Finariel Were you able to fix your problem?

@gmon3y
Copy link

gmon3y commented Mar 18, 2016

I had issues with this setup and while I got it partially working, I ended forgetting about it. I decided to check back in and saw a solution using Docker, which my NAS supports. I was able to gracefully install using the command in @bjeanes's post but noticed under the logs that it hangs on Searching for sonos devices. It will never find any devices. I did a little digging and found that it could be an issue with the sonos.js file and it utilizing multicast. I tried adjusting the settings to reflect that of my subnet's broadcast address, despite confirming that multicast works just fine on my network, and it resulted in the same thing.

Does anyone have suggestions? Any help appreciated!

@mettix
Copy link

mettix commented Jul 7, 2016

Is this working yet on Synology? Greetings! Ive got my 2 Sonos play 5's, I want to use my sonos as output source.. wirelessly.. What do I need? ^^

@bjeanes
Copy link

bjeanes commented Jul 9, 2016

@mettix SSH into it and run the command in #22 (comment)

@ryanlaux
Copy link

Hey @HenkvdM , I'm trying to use your startup script to run Homebridge on autostart on the synology (just changed all the airsonos references to home bridge) but i cant seem to get it to startup. how can I run and confirm that the script worked? I installed the script but when I reboot the system my home bridge doesnt seem to be working. (fyi home bridge is an apple home kit emulator)

Thanks!

@jehanalvani
Copy link

jehanalvani commented Apr 14, 2017

After considerable fighting, I did manage to get Airsonos installed on my Synology, however I'm getting some error output when I run the daemon. See below:

/root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/bluebird/js/main/promise.js:680
			throw e;
			^
Error: Internal Server Error
	at maybeWrapAsError (/root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/bluebird/js/main/util.js:70:12)
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/bluebird/js/main/promise_resolver.js:41:50
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/lib/logicalDevice.js:112:20
	at done (/root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:126:15)
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:32:16
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/lib/logicalDevice.js:106:22
	at done (/root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:126:15)
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:32:16
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:251:17
	at done (/root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:126:15)
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:32:16
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:248:21
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:572:34
	at /root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/lib/events/volumeListener.js:24:14
	at Listener.<anonymous> (/root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/lib/events/listener.js:123:9)
	at Request.self.callback (/root/.nvm/versions/node/v4.8.2/lib/node_modules/airsonos/node_modules/sonos/node_modules/request/request.js:129:22)

Sonos players on the network never do enumerate. This is in Debian Chroot, but I'm guessing that some differences between systems probably related to dependent package/library updates is the culprit. Any other ideas?

@Serifenlos
Copy link

I got it to work! Hurra!
After I ran this docker-comment, I had to allow the ports 1400,1410,1443 in the firewall of my Synology Discstation. Just for the IP-range of the Sonos and my devices.
Now everything is fine – I’m happy.

@narganf
Copy link

narganf commented Dec 5, 2017

I just got this running on a DS214+ running DSM6.1 after a couple hours of trial and error.

I generally followed @dejongrr 's instructions (thank you!).

I wasn't being particularly scientific, and installed nodejs from the Synology Community repository as well as through apt-get. I think I also had to install git separately through apt-get. I received a few install errors about dependencies, but npm launched and I can now stream to my Sonos.

One note--I had to tweak @HenkvdM 's script because, for whatever reason, my location for airsonos is /usr/bin/airsonos, not /usr/local/bin/airsonos. I also had to rename the script to something other than airsonos.sh, as the pkill command in the restart argument would kill the script half-way through completion (after stopping the service but before restarting it). Finally, I was having some issues where the script was running at boot too early in the process and was throwing errors, so I added a 2 minute sleep timer to it (1 minute wasn't enough) that only runs on the start argument. I have this setup in Task Manager to run at boot using the start argument (although perhaps it's running automatically because of its location in /usr/local/etc/rc.d/ -- I'm not sure, but I can confirm that it works. I also have it setup to run once a day to restart the airsonos process in case the daemon dies.

The service was a little flaky this morning (it played for 2 minutes then crashed), but it has been running without issue the last couple of hours.

Here's the script as modified (many thanks for the original):

#
# Put this file in /usr/local/etc/rc.d/airplay.sh

case "$1" in

stop)
    echo "Stop AirSonos ..."
    chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/etc/init.d/dbus stop"
    chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/etc/init.d/avahi-daemon stop"
    pkill -f airsonos
;;

start)
    echo "Starting AirSonos ..."
    sleep 2m
    echo "Waking from sleep!"
    chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/etc/init.d/dbus restart"
    echo "dbus restarted"
    chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/etc/init.d/avahi-daemon start"
    echo "avahi started"
    nohup chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/usr/bin/airsonos" >>/dev/null 2>>/dev/null &
    echo "airsonos should have started"
    ;;

restart)
    echo "Stop AirSonos via Restart Command ..."
    $0 stop

    sleep 1

    echo "Start AirSonos via Restart Command ..."
    chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/etc/init.d/dbus restart"
    chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/etc/init.d/avahi-daemon start"
    nohup chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/usr/bin/airsonos" >>/dev/null 2>>/dev/null &
;;

status)
    ps ax | grep airsonos
    return $?
;;

*)
    echo "usage: $0 { start | stop | restart | status}" >&2
    exit 1
;;

esac

P.S. If you don't know vi very well, this is a great cheat sheet: http://www.lagmonster.org/docs/vi.html

@Karting06
Copy link

I did like @narganf, but needed to install Git & Python 2.7 manually.

Thank you guys!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests