API via PHP

Information and support for EnvisaLink modules.

Moderators: EyezOnRich, GrandWizard

Post Reply
rogerlawrence79
Posts: 1
Joined: Sat Nov 23, 2013 5:33 pm

API via PHP

Post 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
sboutros
Posts: 4
Joined: Tue Dec 17, 2013 10:20 am

Re: API via PHP

Post 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??
GrandWizard
Posts: 2375
Joined: Tue Nov 16, 2010 4:08 pm

Re: API via PHP

Post by GrandWizard »

It means the password is incorrect. Can you log into the Envisalink with password "user"?
sboutros
Posts: 4
Joined: Tue Dec 17, 2013 10:20 am

Re: API via PHP

Post by sboutros »

GrandWizard wrote:It means the password is incorrect. Can you log into the Envisalink with password "user"?
Yes... hence my confusion :)
GrandWizard
Posts: 2375
Joined: Tue Nov 16, 2010 4:08 pm

Re: API via PHP

Post 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.
sboutros
Posts: 4
Joined: Tue Dec 17, 2013 10:20 am

Re: API via PHP

Post 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
GrandWizard
Posts: 2375
Joined: Tue Nov 16, 2010 4:08 pm

Re: API via PHP

Post 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.
sboutros
Posts: 4
Joined: Tue Dec 17, 2013 10:20 am

Re: API via PHP

Post by sboutros »

I see, thanks. I just assumed you guys were also the manufacturer. Who is the manufacturer?
yan@dytronix
Posts: 6
Joined: Mon May 27, 2013 12:10 pm

Re: API via PHP

Post by yan@dytronix »

have u try just sending 005user + checksum without conversion? that worked for me in java.
Post Reply