Home AMX User Forum NetLinx Studio

Control Network Media Tank with telnet

Hi all

Has anyone tried to control a NMT (Popcorn Hour) with AMX?
It can be controlled with telnet from a pc
http://www.networkedmediatank.com/showthread.php?tid=30168&page=1

I open the socket with netcat <ip> <port> and control the device with commands like "echo x". this works perfectly
With wireshark, I see TCP packets with the following Data: echo x$0A
But if i open a Port with AMX like this IP_CLIENT_OPEN(10,'192.168.200.138',30000,IP_TCP)
and send the string (over Control Device on 0:10:1) "'echo x',$0A" theres no action at all.

Am I doing something wrong?
what is the general way to send telnet commands with AMX?

Hope you guys have helpful tipps!
Cheers

Comments

  • mushmush Posts: 287
    Isn't Telnet port 23?
    So your command should be IP_CLIENT_OPEN(10,'192.168.200.138',23,IP_TCP)
    What errors is NetLinx spitting back at you?
  • RolfWRolfW Posts: 6
    usually it is, but as you can see in wireshark, the commands are sent with port 30000.
    In the other thread i posted, there's port 23 not open.

    i get no errors from netlinx in diagnostics... or where should the error happen?


    Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2009-10-24 18:23 UCT
    Interesting ports on 192.168.1.167:
    Not shown: 65524 closed ports
    PORT STATE SERVICE VERSION
    21/tcp open ftp PureFTPd
    139/tcp open netbios-ssn Samba smbd 3.X (workgroup: NNWG)
    445/tcp open netbios-ssn Samba smbd 3.X (workgroup: NNWG)
    2020/tcp open xinupageserver?
    2222/tcp open unknown
    6357/tcp open tcpwrapped
    8088/tcp open http Apache httpd 1.3.33 ((Unix) PHP/4.3.8)
    8883/tcp open unknown
    30000/tcp open unknown
    56650/tcp open tcpwrapped
    58818/tcp open tcpwrapped

    other suggestions?
  • yuriyuri Posts: 861
    You can't use "control a device" to control something through Ethernet. At least, I have never been able to get it to work...

    Try this to open the socket
    nIPClientResult = IP_CLIENT_OPEN(dvPopcorn.Port,hostIpAddress,hostPort, 1)
    

    Example:
    dvPopcorn = 0:5:0
    hostIpAddress = '192.168.1.1'
    hostPort = 30000

    Also, don't terminate your command with $0A, use $0D in stead :)
    SEND_STRING dvPopcorn, "'echo x',$0D";
    

    Good luck, what commands can you execute on the Popcorn by the way?
  • RolfWRolfW Posts: 6
    oh wow, you're right! :)
    if I "hardcode" it, it works perfect!
    beautyful!!!

    there are lot's of commands. they tried almost every command on the link i posted.

    thank you!
    nice weekend guys
    cheers
  • RolfWRolfW Posts: 6
    by the way, it works with $0A AND $0D
  • mushmush Posts: 287
    RolfW wrote: »
    send the string (over Control Device on 0:10:1)

    Ahh..
    I missed the crucial part! That will teach me to skim!

    PS Can you please keep us informed of your progress? I have a Popcorn Hour NMT as well.
  • RolfWRolfW Posts: 6
    sure!
    one update: don't send the "echo".
    you only need to send the command (e.g. "x" for on/off)

    but it's sad that you get no feedback over ip... would be great if someone has an idea to get feedback!

    Best Regards

    That would be a first try with usual snapi-codes...
    SWITCH(nBTN1)
    {
    CASE 1: //Play
    {
    SEND_STRING dvNMT, "'y',$0D"
    }
    CASE 2: //Stop
    {
    SEND_STRING dvNMT, "'s',$0D"
    }
    CASE 3: //Pause
    {
    SEND_STRING dvNMT, "'p',$0D"
    }
    CASE 4: //Next
    {
    SEND_STRING dvNMT, "'n',$0D"
    }
    CASE 5: //Previous
    {
    SEND_STRING dvNMT, "'E',$0D"
    }
    CASE 6: //Fast Forward
    {
    SEND_STRING dvNMT, "'f',$0D"
    }
    CASE 7: //Fast Rewind
    {
    SEND_STRING dvNMT, "'w',$0D"
    }
    CASE 21: //Enter
    {
    SEND_STRING dvNMT, "'Enter',$0D"
    }
    CASE 22: //Home
    {
    SEND_STRING dvNMT, "'O',$0D"
    }
    CASE 45: //Up
    {
    SEND_STRING dvNMT, "'U',$0D"
    }
    CASE 46: //Down
    {
    SEND_STRING dvNMT, "'D',$0D"
    }
    CASE 47: //Left
    {
    SEND_STRING dvNMT, "'L',$0D"
    }
    CASE 48: //Right
    {
    SEND_STRING dvNMT, "'R',$0D"
    }
    CASE 27: //On/Off
    {
    SEND_STRING dvNMT, "'x',$0D"
    }
    CASE 44: //Menu
    {
    SEND_STRING dvNMT, "'m',$0D"
    }
    CASE 100: //Sub Title
    {
    SEND_STRING dvNMT, "'b',$0D"
    }
    CASE 116: //Zoom
    {
    SEND_STRING dvNMT, "'z',$0D"
    }
    CASE 118: //Audio
    {
    SEND_STRING dvNMT, "'a',$0D"
    }
    CASE 120: //Eject
    {
    SEND_STRING dvNMT, "'j',$0D"
    }
    }
  • yuriyuri Posts: 861
    Better than nothing I guess, feedback would be nice though :)
Sign In or Register to comment.