Send commands to the HMP using a Telnet client
From SpinetiX Support Wiki
This page is related to Shared Variables.
Introduction
Telnet is a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility over TCP (the port used is usually 23, though in our case, it's typically 1234) using a virtual terminal connection. You can use different Telnet clients (e.g., Microsoft Telnet Client, PuTTY, Tera Term etc.) to connect to an HMP over the network and send commands using the TCP interface exposed by the Shared Variables legacy server.
Note:
The HMP doesn't implement the Telnet protocol (a "raw" TCP socket connection is done instead), therefore it will not send any feedback regarding the success of establishing a connection or the result of a command. Nevertheless, most Telnet clients will transparently switch to a raw TCP socket connection in such cases, even though a Telnet one was selected.
Tutorial
- Difficulty: Medium.
- Total duration: 5–10 minutes.
- Requirements:
- Hyper Media Player (preferably using the latest firmware);
- A Telnet client;
- An interactive project (like JavaScript API tester) to test shared variable updates and / or events.
Steps
- Open HMP Control Center → Advanced Applications → Network API page.
- Click on the checkbox labeled "Enable secure server" (or "Network API" on older firmware version).
- Click on the checkbox labeled "Enable legacy unprotected server"; change the port if needed.
- Click the "Apply" button and reboot the player.
- Open a connection toward the HMP from your Telnet client. (Instructions for three popular Telnet clients can be found below.)
- Using PuTTY:
- Open the application and enter the host name or IP address of the HMP.
- Set the port to 1234 (or to the value set manually)
- Set connection type to "Raw" or "Telnet" and press "Open".
- Using Tera Term:
- Open the application and under "Host" field, enter the host name or IP address of the HMP.
- Select the Telnet service and set the port to 1234 (or to the value set manually)
- Press "OK".
- Open Setup > Terminal; under New-line, set both options to "CR+LF", then enable "Local echo" and "Auto switch" options. Press "OK".
- Using Windows Telnet client:
- Press the Windows Start button and run the command: "telnet" (opens the Microsoft Telnet Client).
- Type "
SET LOCALECHO
" and press "Enter". (See more about Telnet commands.) - Type "
open HMP_address port
"-
HMP_address
is the host name or IP address of the HMP andport
is 1234 (or the value set manually).
-
- Press "Enter" (If the connection is successful, the cursor will move at the top of the window.)
- Using PuTTY:
- Type the following commands, one at the time. Make sure to press "Enter" after each command.
SUBSCRIBE "var1" UPDATE "var1" "some value" EVENT "mousedown" "x=33,y=44,button=0" EVENT "mouseup" "x=33,y=44,button=0"
Notes:
- To send non-ASCII characters, make sure to set up the client to use UTF-8 character set.
- For HMP200, HMP130, and HMP100, the Network API can be enabled from the Network Settings page > Advanced tab.