Help with Telnet Login
Greetings,
I am trying to connect to an IP device via telnet from Netlinx. My connection is opened as follows:
<code>
DEFINE_START
WAIT 200 IP_CLIENT_OPEN (nPort,cIP,23,1)
</code>
nPort is my Netlinx port which is 7
cIP is the IP address of the device I would like to talk to.
I am seeing the login prompt come in. After the login prompt is seen...
<code>
SEND_STRING dv,"login,$0D"
</code>
Login is a char array containing the login name. After the string is sent, I do not get any response from the device. It just keeps sending the login prompt every minute or so. Using a Windows Telnet connection it works as expected, asking me for a password.
Any idea what I could be doing wrong?
Thanks.
I am trying to connect to an IP device via telnet from Netlinx. My connection is opened as follows:
<code>
DEFINE_START
WAIT 200 IP_CLIENT_OPEN (nPort,cIP,23,1)
</code>
nPort is my Netlinx port which is 7
cIP is the IP address of the device I would like to talk to.
I am seeing the login prompt come in. After the login prompt is seen...
<code>
SEND_STRING dv,"login,$0D"
</code>
Login is a char array containing the login name. After the string is sent, I do not get any response from the device. It just keeps sending the login prompt every minute or so. Using a Windows Telnet connection it works as expected, asking me for a password.
Any idea what I could be doing wrong?
Thanks.
0
Comments
http://www.amxforums.com/showthread.php?6856-TELNET-commands&highlight=telnet+commands
What are you trying to talk to?
Most things like Lutron which also uses port 23 is pretty much a straight forward back and forth procedure. Catch what it sends when you open the client connection and respond accordingly based on the devices api. But if that's what you're doing, first verify the login response the device expects is formatted the way the api specifies.
Post what the device is and maybe someone will have working code they'd like to share or at least a word of advice. If you have the api post that too, especially if it's an oddball device.
edit:
Just in case you're working with RA2 or HomeWorks QS you can try this code:
After I get the login prompt I send the username a comma the password and a carriage return line feed:
Windows is probably sending a carriage return line feed and you are just sending a carriage return.
Also you can send the user name and password with one string if you want.