Samsung Smart TV Plus

Questions and comments specific to a particular plugin should go here.
User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Sun Dec 02, 2018 8:20 pm

you do not need to add anything. everything is included in the plugin. i have made the new samsungctl python 2 and python 3 compatible.
let me adjust the timeout values and see if that helps.

also there are 3 responses you will get from the TV using the device sniffer that i need to know.

well specifically 3 UPNP class names. I need to know if they are the same or if they have changed.

these are the 3 upnp classes that I have the plugin looking for. I need to know if they show up in the device sniffer.
urn:samsung.com:device:RemoteControlReceiver:1
urn:schemas-upnp-org:device:MediaRenderer:1
urn:samsung.com:device:MainTVServer2:1
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Sun Dec 02, 2018 8:41 pm

ok i increased the timeout time. there are also a couple of bug fixes in this one. I added some excessive logging.

THE LOGGING IS ENABLED BY DEFAULT IN THIS VERSION

if it does not detect the TV or if there are any errors please send me a copy of the output from your log in EG.
Attachments
SamsungSmartTVPlus-0.3.1b.egplugin
(223.63 KiB) Downloaded 4 times
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 41
Joined: Sun Apr 28, 2013 12:25 pm

Re: Samsung Smart TV Plus

Post by george tirebuyer » Sun Dec 02, 2018 11:22 pm

Still no TV detection. Nothing in the log. The Device spy sees the TV and the sniffer is sending packets as you listed.

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Mon Dec 03, 2018 8:49 am

No detection or anything in EG log for me either.

For both my TVs, 2017 and 2018 models, Device Sniffer shows only: urn:samsung.com:device:RemoteControlReceiver:1 and urn:schemas-upnp-org:device:MediaRenderer:1 and not urn:samsung.com:device:MainTVServer2:1.

In Device Spy, both TVs show up OK (4K Monitor is 2017 4K TV, TV is 2018 4K TV) but strangely the TV shows the wrong IP address, it is connected on 192.168.1.229 but Device Spy shows it as 192.168.1.135. There is also a different class name for the 2018 TV: IPControlService
Attachments
Device Spy.jpg
Device Sniffer2.jpg
Device Sniffer.jpg

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Mon Dec 03, 2018 9:55 am

ok so you have a completely different set up UPNP classes.

I am going to write a program that will scavenge all of the bits and pieces from your UPNP data and I will have it output the information to a set of log files. this way I can create the classes that are needed.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Mon Dec 03, 2018 9:56 am

screw it I will write a generic program that will scavange all of your UPNP data. we might be able to get some control over that sound bar as well

the 3 UPNP classes that i listed in a previous post are the only classes that my TV supports. so that is all I had to go by.

Not a big deal. we will get this working.
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Mon Dec 03, 2018 11:08 am

Cool.

The soundbar is Samsung too

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Mon Dec 03, 2018 11:55 pm

ok so attached is a program that will give me a printout of all of the UPNP devices on your network. it is going to break the devices down. it will output all functions, they arguments, default values, data types, min, max, the whole enchilada. it will handle nested devices.

the output log is going to be big.

instructions:

unzip onto a folder. to your desktop will work for sake of being easy. the directions will be for that location
open the SamsungSmartTVPlus folder on your desktop.

the next set of instruction is going to sound wacky. but follow along.
click on the test.py file a single time.
then click on the empty white space below the listed files.
you will notice the test.py file is no longer highlighted, but now it has a box around it.

now hold down your left shift key and right click on that same white space.
you will see a menu option for "open command window here" you want to click on that.
this is going to open a command prompt in that folder.

the above is the only way to get that option in the menu to appear. some idiot at Microsoft decided to code that option that way. don't know why

in the command window run this command
"%PROGRAMFILES(x86)%\EventGhost\py.exe" test.py

if this command fails then use
"%PROGRAMFILES(x86)%\EventGhost\py27.exe" test.py

and if that fails then you will have to key out the location to EG manually

this should spit out a crap load of information to the command window. but what I am interested in is the file it made. if you go back to the window that you opened the command prompt from. there will be a new file. if it is not there then simply refresh the screen.

zip up that file and send it to me in a PM. (don't know 100% what is going to be in it so we do not want everyone's eyes looking at it)
Attachments
SamsungSmartTVPlus.NOT_A_PLUGIN.zip
(355.95 KiB) Downloaded 3 times
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Tue Dec 04, 2018 9:29 am

OK will do, it'll have to be tomorrow now as I've had to come to the office

Thanks

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Wed Dec 05, 2018 6:28 am

I wanted to let you know that if the previous attachment does not work properly I have already made a whole UPNP discovery library. that is universal to all UPNP devices. It sure will make things a bunch easier if having to make any kind of a plugin able to work with UPNP. It does all of the heavy lifting.

At this point all i need to have is the layout of all of the classes and methods. I could use the screen shots. and dig my way through the UPNP specs locating each of the classes. reading a whole bunch ad probably make something that will work. But I would much rather go the easy route. :D
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Thu Dec 06, 2018 6:28 pm

Got an invalid syntax error so replaced the if statement (line 688) with:

class UPNPMetaBase(object):
__metaclass__ = UPNPTVSingleton

Then needed to add requests library to the folder, them it started spitting out data.

Got an error with the writing so had to delete (indent=' ') and replace with () (line 763)

Then seemed OK but stopped with this but can't figure this out:

SSDP: 192.168.1.215 creating UPNPTV class
Traceback (most recent call last):
File "py.py", line 29, in <module>
File "C:\Users\SIMON\Desktop\SamsungSmartTVPlus\test.py", line 36, in <module>
for device in discover(10, logging.DEBUG):
File "C:\Users\SIMON\Desktop\SamsungSmartTVPlus\samsungctl\upnp\discover.py", line 381, in discover
yield UPNPTV(key, value)
File "C:\Users\SIMON\Desktop\SamsungSmartTVPlus\samsungctl\upnp\__init__.py", line 681, in __call__
UPNPTVSingleton._tvs[ip] = super(UPNPTVSingleton, cls).__call__(ip, classes)
File "C:\Users\SIMON\Desktop\SamsungSmartTVPlus\samsungctl\upnp\__init__.py", line 718, in __init__
servce_cls = UPNPControlBase(url, location)
File "C:\Users\SIMON\Desktop\SamsungSmartTVPlus\samsungctl\upnp\__init__.py", line 518, in __init__
services = device.find(device_xmlns('serviceList')) or []
AttributeError: 'NoneType' object has no attribute 'find'

The output.log file is incomplete I think, only has one device, the soundbar, I'll PM you with it

Cheers

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Tue Dec 11, 2018 3:01 am

ok so here goes. Give this one a shot and see what happens.

This version has a modified discovery process. it now also supports IPV6
Attachments
SamsungSmartTVPlus-0.3.5b.egplugin
(3.29 MiB) Downloaded 1 time
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Tue Dec 11, 2018 9:11 am

Gave this a try, it was missing the module ipaddress, but found it online.

Got the discovery window up but got this error in the log

Thanks

09:10:43 Exception in thread Thread-10:
09:10:43 Traceback (most recent call last):
09:10:43 File "threading.pyc", line 801, in __bootstrap_inner
09:10:43 File "threading.pyc", line 754, in run
09:10:43 File "C:\ProgramData\EventGhost\plugins\SamsungSmartTVPlus\samsungctl\upnp\UPNP_Device\discover.py", line 171, in found_thread
09:10:43 sock = send_to(ip, timeout)
09:10:43 File "C:\ProgramData\EventGhost\plugins\SamsungSmartTVPlus\samsungctl\upnp\UPNP_Device\discover.py", line 126, in send_to
09:10:43 sock.sendto(ssdp_packet.encode('utf-8'), (destination, 1900))
09:10:43 TypeError: coercing to Unicode: need string or buffer, int found

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Tue Dec 11, 2018 11:08 am

ha! i forgot to include that module.
now sure as hell I know i fixed that traceback.. hmmmm....
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Tue Dec 11, 2018 11:11 am

oh do me a favor please made sure you do not have any old UPNP stuff in your site packages folder
If you like the work I have been doing then feel free to Image

Post Reply