Page 1 of 1

EnvisaLink 2DS TPI question

Posted: Fri Feb 08, 2013 1:19 am
by rustyk
I'm trying to telnet to my EnvisaLink 2DS TPI, but no matter what I try, the server responds that the password is no good. I know the password is good because I can log into the web interface with it (the password is set to 123456). Here's the communication between the server and the client:

Socket connection established
SERVER: 5053CD
CLIENT (sending 005 login command and password 123456): 30303531323334353631430D0A
SERVER: 5000052A
SERVER: 5050CA
Connection was closed by the server

Even when I intentionally use an incorrect "checksum", I still get the server message "5050" - bad password, instead of the expected server message "501" bad checksum:

Socket connection established
SERVER: 5053CD
CLIENT (sending 005 login command and password 123456): 30303531323334353646460D0A
SERVER: 5000052A
SERVER: 5050CA
Connection was closed by the server


This makes me think it's not even attempting to check my password. Have I constructed the command wrong? Is there anywhere else I can look to find out what I'm doing wrong?

Thanks!
Rusty

Re: EnvisaLink 2DS TPI question

Posted: Fri Feb 08, 2013 10:54 am
by K-Man
Your checksum is wrong in both instances and the TPI doesn't differentiate between a bad password and a bad checksum (I guess I was thought I wouldn't give a hacker more information than was needed).

The checksum for your string should be CA, and you have 1C. I think what you've forgot is the modulo on the checksum. If you add up the entire string you get 0x1CA. This is then made modulo 0x100 so the checksum is 0xCA.

Re: EnvisaLink 2DS TPI question

Posted: Fri Feb 08, 2013 12:07 pm
by rustyk
Thanks for that info, I was confused about how to calculate the checksum, but I have that fixed now. Even so, I am still getting the same result. Does my string look correct now?

Socket connection established
SERVER: 5053CD
CLIENT (sending 005 login command and password 123456): 30303531323334353643410D0A
SERVER: 5000052A
SERVER: 5050CA
Connection was closed by the server

I've tested again and again logging into the web interface using that password, and it works there, so I'm sure the password is correct as 123456.

Re: EnvisaLink 2DS TPI question

Posted: Fri Feb 08, 2013 12:28 pm
by rustyk
Actually I found that this seems to work fine:

Socket connection established.
SERVER: 5053CD
CLIENT: 005123456CA
SERVER: 5000052A
SERVER: 5051CB

The TPI manual said that all communication must be done in hex, which is why I was converting everything to hex, including the two digits of the checksum, then hex CRLF needed to be added at the end. But apparently none of that was necessary based on what I see working here.

Re: EnvisaLink 2DS TPI question

Posted: Fri Feb 08, 2013 1:54 pm
by K-Man
No, all communications, except <CR> and <LF> are done in ASCII. Things like the checksum are calculated in HEX, but you send them as the ASCII equivalent.

It's all meant to be human readable.