script.tubecast: Empty response from SSDP discovery - doesn't show up in Youtube device list

Tubecast doesn’t show up in my Youtube device list. This stopped working a few weeks ago.

Running a simple SSDP discovery script, I get one successful and one empty response from the Kodi IP.

import socket

msg = \
    'M-SEARCH * HTTP/1.1\r\n' \
    'HOST:239.255.255.250:1900\r\n' \
    'ST:urn:dial-multiscreen-org:service:dial:1\r\n' \
    'MX:5\r\n' \
    'MAN:"ssdp:discover"\r\n' \
    '\r\n'

# Set up UDP socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
s.settimeout(2)
s.sendto(msg, ('239.255.255.250', 1900) )

try:
    while True:
        data, addr = s.recvfrom(65507)
        print addr, data
except socket.timeout:
    pass

Result

('192.168.178.35', 1900) 248 HTTP/1.1 200 OK
LOCATION: http://192.168.178.35:8008/ssdp/device-desc.xml
CACHE-CONTROL: max-age=1800
CONFIGID.UPNP.ORG: 7337
BOOTID.UPNP.ORG: 7337
USN: uuid:007d00ac-8b1f-52e0-80d0-4e4b736ae194
ST: urn:dial-multiscreen-org:service:dial:1


('192.168.178.35', 1900) 0 

I assume the empty response is the reason why it doesn’t show up in Youtube app.

Could it be that Tubecast is sending an empty response?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I confirm your fix #22 is working for me.

I changed the SSDP discovery response:

HTTP/1.1 200 OK\r
LOCATION: http://{{ ip }}:8008/ssdp/device-desc.xml\r
CACHE-CONTROL: max-age=1800\r
EXT: \r
SERVER: UPnP/1.0\r
BOOTID.UPNP.ORG: 1\r
USN: uuid:{{ uuid }}\r
ST: urn:dial-multiscreen-org:service:dial:1\r
  • EXT and SERVER was missing
  • BOOTID.UPNP.ORG 7337 doesn’t make sense
  • CONFIGID.UPNP.ORG not necessary

My reference was https://embeddedinn.wordpress.com/tutorials/upnp-device-architecture/ and the SSDP response from my LG TV.

And I removed the service list in the XML device description and changed the name:

<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:r="urn:restful-tv-org:schemas:upnp-dd">
    <specVersion>
    <major>1</major>
    <minor>0</minor>
    </specVersion>
    <URLBase>{{ path }}</URLBase>
    <device>
        <deviceType>urn:schemas-upnp-org:device:dail:1</deviceType>
        <friendlyName>{{ friendlyName }}</friendlyName>
        <manufacturer>Kodi</manufacturer>
        <modelName>Kodi</modelName>
        <UDN>uuid:{{ uuid }}</UDN>
    </device>
</root>

It looks like this is working now but I will observe a few days and give feedback again.