[How-To] Remote Control Signal Over Lan?

Here are software that related with Samsung B series TVs. Like hex editors, new version of BusyBox or internal software, app programs that will run in your TV hardware.:!:This forum is NOT FOR USER QUESTIONS or Problems.

moras86
Official SamyGO Developer
Posts: 180
Joined: Sun Feb 21, 2010 3:18 pm
Location: Poland
Contact:

SOAP for set volume level

Post by moras86 »

If you would like to get or set volume level you can use SOAP future integrated with Samsung TV (B-series and up). You need to send xml schema.
Example for set volume (33) at IP (192.168.0.10):

Code: Select all

POST /upnp/control/RenderingControl1 HTTP/1.1
SOAPACTION: urn:schemas-upnp-org:service:RenderingControl:1#SetVolume
CONNECTION: close
CONTENT-LENGTH: 368
CONTENT-TYPE: text/xml
HOST: http://192.168.1.10:52235
USER-AGENT: Http/1.1

<?xml version='1.0' encoding='utf-8'?>
<s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
  <s:Body>
    <ns0:SetVolume xmlns:ns0='urn:schemas-upnp-org:service:RenderingControl:1'>
      <InstanceID>0</InstanceID>
      <DesiredVolume>33</DesiredVolume>
      <Channel>Master</Channel>
    </ns0:SetVolume>
  </s:Body>
</s:Envelope>
Similar way you can read and set: volume mute, brightness, contrast, sharpness, color temperature.

I use this in my Remote LAN Control app. Maybe it's possible to make script for work with PRV+ (or myButtons).
Image . Image
TV LCD: Samsung LE40B651T3W (CI) | Internet@TV | fw: 2005 (patched: SamyGO v0.24 + GMT2, ArFIX2, ADFIX) | matrix: SQ04
BluRay: Samsung BD-D5300-ZF | SamsungApps | fw: 1013
Android-Box: Zidoo X8 | Realtek RTD1295 64bit (QuadCore), Mali-T820 GPU, 2 GB RAM, HDMI IN record, Android 6.0 | ZDMC 17.1
my projects: Remote LAN Control - Desktop app (v0.8) | Signal checker for DVB-T (v0.3)
rinaldinicri
Posts: 27
Joined: Tue Oct 04, 2011 12:12 am

Re: [How-To] Remote Control Signal Over Lan?

Post by rinaldinicri »

Is there a way to send remote command from a shell script running on the tv?
Thanks
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: [How-To] Remote Control Signal Over Lan?

Post by juusso »

create script setvol.sh, chmod it to 755.
copy netcat (nc) to /mtd_rwarea/netcat/nc
Execute this script with required volume value at the end:

Code: Select all

/mtd_rwarea/setvol.sh 10& 

Code: Select all

#!/bin/sh

nc=/mtd_rwarea/netcat/nc
allow_loud=0

vol=$1


if [ ! -f $nc ] ; then
	echo "\"$nc\" not found!"
	exit
fi

if [ -z $vol ] ; then
	echo "Add desired volume as parameter!"
	exit
fi

if [ $vol -lt 0 ] ; then
	echo "Volume out of range! [0-99]"
	exit
fi

if [ $vol -gt 99 ] ; then
	echo "Volume out of range! [0-99]"
	exit
fi

if [ $vol -gt 15 ] ; then
	if [ $allow_loud != 1 ] ; then
		echo "Not allowed to set volume higher then 15 per default! Set \"allow_loud\" to 1 in this script."
		exit
	fi
fi

content_len=366
if [ $vol -ge 10 ] ; then
	content_len=367
fi


echo -n 'POST /upnp/control/RenderingControl1 HTTP/1.0
User-Agent: Twisted PageGetter
Host: 127.0.0.1
Content-Length: '$content_len'
SOAPACTION: "urn:schemas-upnp-org:service:RenderingControl:1#SetVolume"
content-type: text/xml ;charset="utf-8"
connection: close

<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><ns0:SetVolume xmlns:ns0="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel><DesiredVolume>'$vol'</DesiredVolume></ns0:SetVolume></s:Body></s:Envelope>' | $nc localhost 52235 | grep HTTP/1.
Don`t remember who is the script author, but the method to send soap message in that way works.

p.s. Original posted by flo-ogb.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
rinaldinicri
Posts: 27
Joined: Tue Oct 04, 2011 12:12 am

Re: [How-To] Remote Control Signal Over Lan?

Post by rinaldinicri »

Hi fdelahuz thanks for your reply.
I need to do it directly on a script running on the tv.
As far as I know telnet client is not available on the tv.

Onother question:
Is there a way to get current information (channel, volume, ...) of the running status of tv?
is it possible to get thsi info from a shell?

Thanks a lot

Post Reply

Return to “[B] Software”