Greetings,
I was wondering if anyone has had experience with a Tronsmart or similar device, through uPnP? Oddly enough, wireshark capture shows that when streaming a video file, it doesn't send XML over HTTP uPnP. However, I got some interesting info over network from going to configure the device: <?xml version="1.0" encoding="utf-8"?> <root xmlns="urn:schemas-upnp-org:device-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType> <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC> <friendlyName>Tronsmart-(IDNUMBER)</friendlyName> <manufacturer>Actionsmicro</manufacturer> <manufacturerURL>www.actions-micro.com</manufacturerURL> <modelDescription>Actionsmicro DMR</modelDescription> <modelName>ACTIONSMICRO Digital Media Renderer</modelName> <modelNumber>0001</modelNumber> <modelURL>www.actions-micro.com</modelURL> <serialNumber>Actionsmicro DMR v0001</serialNumber> ..... <serviceList><service> <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType> <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId> <SCPDURL>AVTransport/scpd.xml</SCPDURL> <controlURL>AVTransport/control</controlURL> <eventSubURL>AVTransport/event</eventSubURL> </service> <service><serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType> <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId> <SCPDURL>ConnectionManager/scpd.xml</SCPDURL> <controlURL>ConnectionManager/control</controlURL> <eventSubURL>ConnectionManager/event</eventSubURL> </service> <service><serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType> <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId> <SCPDURL>RenderingControl/scpd.xml</SCPDURL> <controlURL>RenderingControl/control</controlURL> <eventSubURL>RenderingControl/event</eventSubURL> </service> </serviceList> The script below almost works at the first time, but doesn't seem to send the packets separate, as EZCast does. Is this a standard uPnP streaming protocol that GUPNP could help with, or is this some proprietary EZCast handshake GUPNP won't help with? It looks like it sends packets ending with 0:0, 0:101, or 0:102 at times, I don't know if this is part of dlna/uPnP specification, or some proprietary protocol? import socket import threading import time Addr = None; StartLock = threading.Lock() def DoUDP(): global Addr; global StartLock; s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #Internet, UDP s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) while 1: #s.bind(('', 64000)) s.sendto('0:0',('192.168.0.255',63630)) #s.connect(('192.168.0.255',63630)); #s.send('0:0') #s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) #s.listen(1) data,addr = s.recvfrom(1024) print data print 'from', addr Addr = addr try: StartLock.release() except: pass time.sleep(1) return StartLock.acquire() print 'starting...' udpthread = threading.Thread(target=DoUDP) udpthread.start(); StartLock.acquire() print 'ok starting tcp' tcp = socket.socket(socket.AF_INET,socket.SOCK_STREAM) print 'Accessing',Addr tcp.connect((Addr[0],63630)) tcp.send('\x05\x00\x00\x001:100') #That's 4 hex numbers, 1:100 print '<'+tcp.recv(1024)+'>' #Why doesn't it recv? tcp.send('\x05\x00\x00\x001:100') print '<'+tcp.recv(1024)+'>' #TODO what is sending of the same ^ but 1:101 ? volume? #Intro sent to port 2425, then video: vidtcp = socket.socket(socket.AF_INET,socket.SOCK_STREAM) vidtcp.connect((Addr[0],2425)) vidtcp.send( '\x00\x00'+'\x00\x00\x18\x00\x00\x00\x06\x00'+ '\x00\x00\x00\x10\x00\x00\x01\x00'+'\x00\x00\x00\x00\x00\x00\x00\x00'+ '\x00\x00\x00\x00\x00\x00') print 'A:',vidtcp.recv(1024); vidtcp.send( '\x01\x00'+'\x00\x00\x18\x00\x00\x00\x08\x00'+ '\x00\x00\x00\x10\x00\x00\x01\x00'+'\x00\x00\x00\x00\x00\x00\x00\x00'+ '\x00\x00\x00\x00\x00\x00') print 'B:',vidtcp.recv(1024); #vidtcp.send( '\x02\x00'+'\x00\x00\x18\x00\x00\x00\x04\x00'+ #'\x00\x00\x00\x18\x00\x00\x00\x00'+'\x00\x00\x00\x00\x00\x00\x00\x00'+ #'\x00\x00\x00\x00\x00\x00')#necessary? replaced by other? #print 'C:',vidtcp.recv(1024); vidtcp.send( '\x01\x00'+'\x00\x00\x20\x00\x00\x00\x08\x00'+ '\x00\x00\x00\x18\x00\x00\x00\x00'+'\x00\x00\x02\x00\x00\x00\x08\x00'+ '\x00\x00\x00\x00\x00\x00\x01\xac'+'\x5d\x00\x00\x00\x00\x00')#thing with ]..... print 'D:',vidtcp.recv(1024); vidtcp.send( '\x02\x00'+'\x00\x00\x1c\x00\x00\x00\x08\x00'+ '\x00\x00\x00\x00\x00\x00\x04\x00'+'\x00\x00\x01\x00\x00\x00\x04\x00'+ '\x00\x00\x00\x00\x00\x00\x01\x00'+'\x00\x00') print 'E:',vidtcp.recv(1024); vidtcp.send( '\x04\x00'+'\x00\x00\x20\x00\x00\x00\x08\x00'+ '\x00\x00\x00\x00\x00\x00\x05\x00'+'\x00\x00\x02\x00\x00\x00\x08\x00'+ '\x00\x00\x00\x00\x00\x00\x00\x00'+'\x00\x00\x00\x00\x00\x00') print 'F:',vidtcp.recv(1024); vidtcp.send( '\x03\x00'+'\x00\x00\x18\x80\x00\x00\x02\x00'+ '\x00\x00\x00\x10\x00\x00\x06\x00'+'\x00\x00\x00\x00\x00\x00\x00\x00'+ '\x00\x00\x00\x80\x00\x00')#^ starts with 02 sometimes? print 'G:',vidtcp.recv(1024); f = file('(filename)') vidtcp.send(f.read()) |