WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Device not found on deployed site using node-sonos #520

@felixdasgupta

Description

@felixdasgupta

DeviceDiscovery doesn't work for a deployed web application. No Sonos Device is found on the network.

Expected Behavior

A Device should be discovered when searching for the Device in this instance using DeviceDiscovery.

Current Behavior

Currently works in my local environment, but I've deployed my application. When I run this on a chrome browser the device is never discovered.

My application uses a Next.JS + React stack with express.

Possible Solution

Not 100% clear on how this works and I am definitely new to this. Do I need to set an environment variable here? How would I configure the production version to properly discover devices connected to an account etc.

This is more of a question, not a proposed solution, but I would appreciate all the help I can get here. Not clear on how DeviceDiscovery is actually working without being tied to any account or auth.

Sample code or executed example

This piece of code never works in the production instance.

const findDevice = DeviceDiscovery({ timeout });

findDevice.on("DeviceAvailable", async sonosDevice => {
      ....
})

Versions (and Environment)

Node version: "14.x"
node-sonos version: "^1.14.1"
OS: MacOS

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions