Page 1 of 1

API via PHP

Posted: Sat Nov 23, 2013 5:41 pm
by rogerlawrence79
So I can connect... using stream_socket_client (PHP)... (DSC)

I get a 5053CD response, which I believe is correct according to the api documentation.

I then need to send a 005 Login Request..., but that needs to be converted to hex... So...

"303035" Not sure that data should immediately follow so I should follow with CR/LF (OD OA). My question... what should the string look like that I should attempt to fwrite to the open socket?

Thank you in advance for any direction!

Roger

Re: API via PHP

Posted: Fri Dec 20, 2013 1:39 pm
by sboutros
I'm getting a bit past this point.

Open a socket and receive 5053CD
Reply with 005user (hex: 3030357573657235340D0A )
Broken out that is: 303035 75736572 3534 0D0A (005 user CHK CR/LF)
Then I get 5000052A acknowledging my 005/Auth
Then I get a 5050CA - which I assume is 505-Fail

This is on a port forwarded Envisalink, Firmware Version: 01.10.120, default user/password

Anybody??

Re: API via PHP

Posted: Fri Dec 20, 2013 1:47 pm
by GrandWizard
It means the password is incorrect. Can you log into the Envisalink with password "user"?

Re: API via PHP

Posted: Fri Dec 20, 2013 2:02 pm
by sboutros
GrandWizard wrote:It means the password is incorrect. Can you log into the Envisalink with password "user"?
Yes... hence my confusion :)

Re: API via PHP

Posted: Fri Dec 20, 2013 10:01 pm
by GrandWizard
It looks like what you are transmitting is correct but maybe you should take a network "sniff" or you traffic and post it for the other developers to have a look at.

Re: API via PHP

Posted: Sat Dec 21, 2013 1:29 am
by sboutros
Do you want the hex dump of the network data?

Is there a basic PHP script for folks to test with?
Sample code perhaps...?

Thanks

Re: API via PHP

Posted: Sat Dec 21, 2013 10:21 am
by GrandWizard
I'm not much of a programmer so sending it to me isn't going to do you much good.

I'm just saying that if you used a network packet sniffer to see what is actually being sent to the Envisalink you might get one of those "aha" moments.

We don't really support the TPI at Eyezon, we leave that up to the manufacturer. The developer community is pretty active so maybe one of them might offer up some code. I know there are open-source projects using the Envisalink TPI so you could try that too.

Re: API via PHP

Posted: Sat Dec 21, 2013 10:44 am
by sboutros
I see, thanks. I just assumed you guys were also the manufacturer. Who is the manufacturer?

Re: API via PHP

Posted: Thu Jan 02, 2014 3:59 pm
by yan@dytronix
have u try just sending 005user + checksum without conversion? that worked for me in java.