Home AMX User Forum NetLinx Studio

Sony Proj control over IP

Jeff BJeff B Junior MemberPosts: 37
I am working with a Sony VPL PX 15 projector that has only IR or IP control. I would like to control it over IP from the web server in the projector. To turn the projector on from a standard web browser I can put:

"http://192.168.1.112/appli/ir.dll/Sircs?0x4054+46+ONESHOT+0"

in the url.

How do you translate this in to a string I can send to the projector over IP from the controller?

Would this be a get command or a put command and how does this get formated. I am not clear on HTTP requests.

Thanks for any help that can be provided.

Comments

  • NMarkRobertsNMarkRoberts Junior Member Posts: 455
    Just a guess

    Try telnetting to the projector and typing in "help".
  • Jeff BJeff B Junior Member Posts: 37
    I did try that. Connections on port 23 refused. I need to understand how to format the string for HTTP put/get witch ever is applicable.

    But thanks
  • Jeff BJeff B Junior Member Posts: 37
    Did some research. Dose anyone know if this would be correct?

    For "http://192.168.1.112/appli/ir.dll/Sircs?0x4054+46+ONESHOT+0"

    GET /appli/ir.dll/Sircs?0x4054+46+ONESHOT+0 HTTP/1.0 CR LF CR LF
  • Marc ScheibeinMarc Scheibein Junior Member Posts: 669
    Jeff B wrote:
    Did some research. Dose anyone know if this would be correct?

    For "http://192.168.1.112/appli/ir.dll/Sircs?0x4054+46+ONESHOT+0"

    GET /appli/ir.dll/Sircs?0x4054+46+ONESHOT+0 HTTP/1.0 CR LF CR LF
    Looks well. You may have to add q 'Host' information after the HTTP information, where the host IP is the IP of the destination (in my case the router, in yours the IP of the projector)
    THis is a working string from my router at home:
    SEND_STRING dvIP_CLIENT,"'GET /cgi-bin/[email protected]&A=D1&rd=status HTTP/1.1',13,10,13,10,'Host: 192.168.0.254',13,10,13,10"
    
  • JohnMichnrJohnMichnr Junior Member Posts: 279
    The port the Sony projectors operate on is port # 53484. I've had good success controlling the Sonys with the standard command set prefaced by $01,$00.
    I open a TCP/IP connection to the projector on the above port, send the command out with the IP preface, wait for a reply then close the connection. ( the sony's will shut down the connection after like 5 seconds or something so you have to open & close the connection when you have a command to send)

    But then again you can also just send that command as listed above if it works.
  • Jeff BJeff B Junior Member Posts: 37
    The string:

    GET /appli/ir.dll/Sircs?0x4054+46+ONESHOT+0 HTTP/1.0 CR LF CR LF

    worked good. Changing the 46 in the string changes functions.

    This was much easier then using Sony's standard commands, on port # 53484.
  • JohnMichnrJohnMichnr Junior Member Posts: 279
    Cool -

    Now I am not familier with the Get command you are using - is that an IP command, and are you using a send_string as in the example that Marc showed?

    Also do you open the TCP/IP server using the standard netlinx commands?
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    JohnMichnr wrote:
    Cool -

    Now I am not familier with the Get command you are using - is that an IP command, and are you using a send_string as in the example that Marc showed?

    Also do you open the TCP/IP server using the standard netlinx commands?

    Get is the standard http command to get the file that does... (whatever) Your browser sends that command out upon first opening port 80 on a remote server. The server is supposed to send back whatever is the default file to start the http conversation.

    Just as an aside, I find using http to control a device rather clunky and avoid it at all costs if possible. The reason is that on the AMX end of things, a slight modification on the server on web page design can horse up your string concantinations. I much prefer basic telnet type commands when possible.

    I do this even on things that one would think would be a 'web only' solution. I much prefer getting my weather information from a telnet server as opposed to farming if off a website.

    hypertext is designed to be used by a completely different animal. But, that's just my opinion... ;)
  • JohnMichnrJohnMichnr Junior Member Posts: 279
    Thanks for the info Eric. I have an application coming up where I know I will have to use the web control to start and stop a VGA data recorder and I was going to research this anyway.

    but - I assume that I use an IP_CLIENT_OPEN command first on port 80 to open the port, and then use the send_string command to send out the get command with whatever syntax is required?
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    No problem.

    Here's a little hunk of http code that I use to get my WAN address by hitting www.amx.com/ip.asp

    I'm kinda old school and like to run down to the define_program section where others will put this in a function.

    So, my program kinda reads from botton up.
    You start the process by setting GET_WAN_IP_FLAG=1

    I used to do this by hitting my Linux server at a high port. This was essentially a custom built thing by me and was a quick telnet session.

    However, AMX keeps their web page active and I don't have to ensure my Linux server is up and running. This works best for our client's here since I'm not doing this as a freelance programmer any longer.


    The best way to understand this is hit the website in IE first to see what happens. Then look at the code.

    the

    'Accept: */*',13,10,
    'Accept-Language: en-us',13,10,
    'Accept-Encoding: gzip, deflate',13,10,
    'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; .NET CLR 1.1.4322)',13,10,
    'Host: www.amx.com',13,10,13,10"

    section is all spoof to make the remote server think the AMX master is really a windows browser. I figured this out by setting up a port on the AMX master and hitting it with IE from my laptop. I know this is also information available on the AMX site.

    DEFINE_EVENT
    
    DATA_EVENT[HTTP_CLIENT]
    {
    ONLINE:  // Once you've setup the connection, send the string to the website.
        {
        SEND_STRING HTTP_CLIENT,"'GET /ip.asp HTTP/1.1',13,10,
                          'Accept: */*',13,10,
                          'Accept-Language: en-us',13,10,
                          'Accept-Encoding: gzip, deflate',13,10,
                          'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; .NET CLR 1.1.4322)',13,10,
                          'Host: www.amx.com',13,10,13,10"
        }
    STRING:
        {
        WAIT 100 'BOGUS ROUTER STRING'
    	{
    	CLEAR_BUFFER ROUTER_BUFF
    	ROUTER_BUFF=''
    	}
        
        IF(FIND_STRING(ROUTER_BUFF,'OK',1))
    	{
    	WAIT 10
    	    {
    	    ROUTER_WAN_FLAG=1
    	    }
    	}
        }
    }
    // END 
    
    DEFINE_PROGRAM
    
    IF(GET_WAN_IP_FLAG=1)
        {
        IP_CLIENT_CLOSE(9) // just in case...
        WAIT 4
    	{
    	IP_CLIENT_OPEN(9,'www.amx.com',80,1) // GO TO DATA_EVENT    [HTTP_CLIENT] FOR NEXT STEP.
    
    	}
        GET_WAN_IP_FLAG=0
        }
    
    IF(ROUTER_WAN_FLAG=1) // RECIEVED ip address from amx.com
        {
        ROUTER_WAN_FLAG=0
        REMOVE_STRING(ROUTER_BUFF,'Content-Length:',1)
        ROUTER_WAN_COUNT=ATOI(ROUTER_BUFF)
        ROUTER_NEW_WAN_IP=RIGHT_STRING(ROUTER_BUFF,ROUTER_WAN_COUNT)
        IF(ROUTER_NEW_WAN_IP=ROUTER_CURR_WAN_IP)
    	{
    	NETWORKING_LOG="$0D,$0A,'=======================================',$0D,$0A,
    								    'Last known WAN IP from the router was:  ',ROUTER_CURR_WAN_IP,$0D,$0A,
    								    '=======================================',$0D,$0A,$0D,$0A,NETWORKING_LOG,$0D,$0A"
    	}
        ELSE
    	{
    	NETWORKING_LOG="$0D,$0A,'=======================================',$0D,$0A,
    								    'Router WAN IP has changed!!!',$0D,$0A,
    								    'Old WAN IP from the router was:  ',ROUTER_CURR_WAN_IP,$0D,$0A,
    								    'and now is:  ',ROUTER_NEW_WAN_IP,$0D,$0A,
    								    'Please note the change.',$0D,$0A,
    								    '=======================================',$0D,$0A,$0D,$0A,NETWORKING_LOG,$0D,$0A"
    	ROUTER_CURR_WAN_IP=ROUTER_NEW_WAN_IP
    	}
        }
    
    // END GET THE WAN IP OF THE ROUTER...
    
    


    Hope that helps
  • JohnMichnrJohnMichnr Junior Member Posts: 279
    Great thanks for the demo - it all makes sense. Where did you get the protocol for the ip.asp function? or did you just sniff it out?
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    JohnMichnr wrote:
    Great thanks for the demo - it all makes sense. Where did you get the protocol for the ip.asp function? or did you just sniff it out?

    I ran across it on some tech note while looking for something else. I had just been using my own personal server for a while. I was kind of nervous not using the companies or an independent.

    I was so releived to see that AMX had thought of it too and just converted all the systems here over to it.

    If you create a session in hyperterminal and copy/paste the GET message into it, you'll see what it spits back at you. That's how I did it.

    HTTP protocol is easy enough to find. Just google 'hypertext protocol' It is a fabulously easy protocol really.
  • JohnMichnrJohnMichnr Junior Member Posts: 279
    Thanks Eric. While I was not able to make hyperterm show the responces from AMX.com I was able to code it into a master and have that work.

    By the way if you add a line after the GET statement line that says
    'Connection:close',13,10,
    then the connection will shut down after the information is sent from the server.

    Thanks Again.
  • mludviksenmludviksen Junior Member Posts: 18
    JohnMichnr wrote: »
    The port the Sony projectors operate on is port # 53484. I've had good success controlling the Sonys with the standard command set prefaced by $01,$00.
    I open a TCP/IP connection to the projector on the above port, send the command out with the IP preface, wait for a reply then close the connection. ( the sony's will shut down the connection after like 5 seconds or something so you have to open & close the connection when you have a command to send)

    But then again you can also just send that command as listed above if it works.

    John,

    Would you happen to have a short sample of code for the control using Sony's 'PJ Talk' (Port #53484)? I'm trying to use Essential NetTools 'RawSocket' to communicate with my VPL-VW100 (Ruby), and I'm not getting anywhere - I figured I should at least be able to accomplish this before I write code. If you have complete codes/commands for turning the projector on and off, I would really, really appreciate it. Thanks!


    Mark
  • JohnMichnrJohnMichnr Junior Member Posts: 279
    I'll attach a file that should be most of the code - I chopped apart a program this morning that I used for the Sony controls. Now there was a fucntion burried deep in the Sony to turn on PJ TALK. It required digging around in the PC menus for the onboard PC. There was some way to turn on teh PJ TALK to listen ( or to Run) but I have forgotten how - it's been a long time since I did it.

    I hope this code looks right - I've only had 2 cups this morning.
  • mludviksenmludviksen Junior Member Posts: 18
    John,

    Thank you for the quick response. I hope to spend some time on it this weekend - I'll let you know what I find.


    Regards,


    Mark
Sign In or Register to comment.