Zepheus / esp8266-sonos-rfid

A RFID-controlled embedded Sonos controller
MIT License
6 stars 0 forks source link

discover not working #1

Closed bopeterson closed 8 years ago

bopeterson commented 8 years ago

Thank you for your great project. I had most of it workning on my wemos.cc when I enter my sonos IP manually, but discoverSonos() didn't work. It kept saying "Sending M-SEARCH multicast" over and over again. I tried a php program from https://github.com/DjMomo/sonos/blob/master/sonos.class.php doing basically the same and it worked fine. Any ideas what can be wrong?

Zepheus commented 8 years ago

Hello Bo,

This is definitely worth investigating. I see two reasons this might happen:

  1. I made the incorrect assumption that UDP has to bind on port 1901 (https://github.com/Zepheus/esp8266-sonos-rfid/blob/24a15904125d8e7a77f7e6dd889a8a423fd309b1/esp8266-sonos-rfid.ino#L51) but Sonos does not reply to the src udp as well in all cases.
  2. These packets do not travel across subnets, so could it be that the esp8266 is on a different subnet within your network by explicitly splitting e.g. wired vs. wireless?

Can you provide a Wireshark UPnP discovery response when using the PHP script? This could at least rule out 1.

Kind regards, Cedric

bopeterson commented 8 years ago

Thank you for your quick reply!

Both devices are wireless on the same subnet, I don't think that is the issue. I see that the PHP script uses

HOST: {$ip}:reservedSSDPport

rather than

HOST: 239.255.255.250:1900

I will do some experiments and let you know.

/Bo

29 mars 2016 kl. 10:00 skrev Cedric Van Goethem notifications@github.com:

Hello Bo,

This is definitely worth investigating. I see two reasons this might happen:

• I made the incorrect assumption that UDP has to bind on port 1901 (https://github.com/Zepheus/esp8266-sonos-rfid/blob/24a15904125d8e7a77f7e6dd889a8a423fd309b1/esp8266-sonos-rfid.ino#L51) but Sonos does not reply to the src udp as well in all cases. • These packets do not travel across subnets, so could it be that the esp8266 is on a different subnet within your network by explicitly splitting e.g. wired vs. wireless? Can you provide a Wireshark UPnP discovery response when using the PHP script? This could at least rule out 1.

Kind regards, Cedric

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

bopeterson commented 8 years ago

Update: I have it working now, and it was my mistake. I wasn't using the rfid stuff and deleted those lines but accidentaly also deleted the Udp.begin(1901) line. put it back and started experimenting, and found out that the portnumber for Udp.begin() seems to be irrelevant. I tried port 1900 and even Udp.begin(1) and they all worked. I guess Udp.begin(1900); would be the least confusing to use. Sorry for bothering you with this and again thank you very much for the discovery code.

/Bo

29 mars 2016 kl. 10:00 skrev Cedric Van Goethem notifications@github.com:

Hello Bo,

This is definitely worth investigating. I see two reasons this might happen:

I made the incorrect assumption that UDP has to bind on port 1901 (https://github.com/Zepheus/esp8266-sonos-rfid/blob/24a15904125d8e7a77f7e6dd889a8a423fd309b1/esp8266-sonos-rfid.ino#L51 https://github.com/Zepheus/esp8266-sonos-rfid/blob/24a15904125d8e7a77f7e6dd889a8a423fd309b1/esp8266-sonos-rfid.ino#L51) but Sonos does not reply to the src udp as well in all cases. These packets do not travel across subnets, so could it be that the esp8266 is on a different subnet within your network by explicitly splitting e.g. wired vs. wireless? Can you provide a Wireshark UPnP discovery response when using the PHP script? This could at least rule out 1.

Kind regards, Cedric

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/Zepheus/esp8266-sonos-rfid/issues/1#issuecomment-202768252

Zepheus commented 8 years ago

Hello Bo,

Glad you figured it out! If there are any other issues, feel free to open a new ticket.

Kind regards Cedric