This object is in archive! 

Use HTTP requests on local network

Marius shared this question 9 years ago
Need Answer

I'm having problems reaching my Synology NAS on my LAN from an HTTP request. Do the HTTP calls originate from the cloud server or from the Zipabox itself?


I'm trying to control my Samsung TV with a PHP script running on my NAS webserver. The webserver is not exposed to the internet.


In my rule, I have tried calling the PHP script with the NAS host address, the IP address and with and without http prefix, without success. Will I need to expose the NAS webserver to the internet?

Replies (5)

photo
1

You definitely can send local http requests using zipabox.

Did you try to access the url of your script directly from your web browser?

photo
2

My bad, I did not include the http:// prefix in the request URL... It all works now.


For those of you having a Samsung model 2011 or newer (with network connection of course), this PHP script works really well for controlling the TV:


https://github.com/avtehnik/samsung-smart-tv-php-udp-control/blob/master/samsungremote.php


Place it on your webserver (Synology NAS in my case), and call it with URLs like this:


http://myserver/samsungremote.php?key=POWEROFF


http://myserver/samsungremote.php?key=VOLUP


I'm not sure what to use it for yet, but I read about a guy who managed to get his front door camera show up in picture-in-picture when movement was detected.


the POWERON command does not work, because the TVs nic goes to sleep while the TV is shut off. Someone mentioned that it was possible to work-around this by connection a power switch to the TV. When power becomes available, the TV nic is (supposedly) listening to network traffic for 30 seconds, making POWERON possible.

photo
1

I have a samsung smart tv, want to execute some commands using HTTP requests, In the rule you created in PHP have to modify only what is marked in the attachment below? Sorry for asking I do not have much knowledge and PHP language.

Files: PHP.png
photo
photo
1

can you use this to turn the tv of whit a http request?

photo
1

can you send the commands whitout the web server option??

photo
2

Unfortunately, no. The TV interface does not speak http, it is a socket stream connection to port 55000.


After opening a stream to the TV, the script writes this to the stream to POWEROFF:

iphone..iapp.samsungHdMTkyLjE2OC4xLjE1MDAtMTEtMzItMTEtZGYtNTI=cGhwIFNhbXN1bmcgUmVtb3Rliphone..iapp.samsung�iphone.UE40D6325.iapp.samsungS0VZX1BPV0VST0ZG


The iApp and iphone references are there because the script imitates the output of the Samsung iphone remote app. The actual command is base64 encoded.

Leave a Comment
 
Attach a file