So I am failing miserably with integrating a barco clickshare I cant even open the IP connection let alone fool with the API. Wanted to see if anyone has any advice and if they have personal experience with the device.
Well got past step one with getting an IP connection, I was sending my HTTP port into the IP_CLIENT_OPEN( ) with a character array instead of an integer... Oops. Now its online so I get to play with the API which is REST, first time messing with it so any advice or hints are welcome.
Well got past step one with getting an IP connection, I was sending my HTTP port into the IP_CLIENT_OPEN( ) with a character array instead of an integer... Oops. Now its online so I get to play with the API which is REST, first time messing with it so any advice or hints are welcome.
Managing your connection with IP is pretty important. I wrote a series of functions I drag into each program for such things. For example with most HTTP you want to just open the connection, send the message and get out. Other connections that may stay alive longer need to be managed as well.
Ugh still failing miserably, looked around the forum and adjusted some things here and there. Basically is what I am finding that when I send the string out my IP connection immediately goes offline. As a test I did not send anything to it and it will stay alive for two minutes routinely. Here is a snippet of the messages I am getting through diagnostics ("SENT:" shows what I am sending out to the device).
Line 109 (14:40:42):: CIpEvent::OffLine 0:6:1
Line 110 (14:41:02):: IPSocketManConnectTask 'tcp-client:1:6' exiting
Line 111 (14:41:02):: CIpEvent::OnLine 0:6:1
Line 112 (14:41:07):: SENT: GET /v1.0/DeviceInfo/Sharing HTTP/1.1Host: 10.10.1.39:4000
Line 113 (14:41:07):: CIpEvent::OffLine 0:6:1
Ugh still failing miserably, looked around the forum and adjusted some things here and there. Basically is what I am finding that when I send the string out my IP connection immediately goes offline. As a test I did not send anything to it and it will stay alive for two minutes routinely. Here is a snippet of the messages I am getting through diagnostics ("SENT:" shows what I am sending out to the device).
Line 109 (14:40:42):: CIpEvent::OffLine 0:6:1
Line 110 (14:41:02):: IPSocketManConnectTask 'tcp-client:1:6' exiting
Line 111 (14:41:02):: CIpEvent::OnLine 0:6:1
Line 112 (14:41:07):: SENT: GET /v1.0/DeviceInfo/Sharing HTTP/1.1Host: 10.10.1.39:4000
Line 113 (14:41:07):: CIpEvent::OffLine 0:6:1
HTTP is very particular and missing a space after GET or CRLF after HTTP/1.1 or 2 CRLF's at the end of the header or a host of other wrong or required fields can make a connection impossible. Best bet is to post your code, provide a link to the API and get real familiar with WireShark.
Here's a sample for an HTTP connection to an Axis IP camera. In this case when you want to control the camera a button is pushed and it send the IP_CLIENT_OPEN then when yu get the online notification it would trigger this function. You have to watch what happens in WireShark and see all the parameters that are being passed and include them in your code then one at a time comment them out to see what the device really doesn't need and then send it the minimum required, it's a real PITA. In this example I could probably have removed more but after a while you end up saying F' it, it's good enough and move on to the real work at hand of controlling the device. Sometimes you think you should be done with the module but you've really only figured out how to talk to the friggin thing.
So I am failing miserably with integrating a barco clickshare I cant even open the IP connection let alone fool with the API. Wanted to see if anyone has any advice and if they have personal experience with the device.
Just curious - are you sendind CR,LF after the lines in the GET command?
Eric, at one point yes I did have carriage returns and line feeds, the posting with the diagnostics did not use them. I had a much longer get command as well but I started chopping it up after struggling.
Kuoweiliao I hope you didn't go through the trouble of doing all that for me, I will test out the file you made and post the results and thank you for going through all that.
Yep that works. So I was building my header not quite right and dealing with MD5 for the first time but that helped alot thanks!
I have a module posted on the mod pedia forum that uses MD5 too. EPCII or Etherner Power Controller or something like that. I think it include the module that does the MD5 encryption too that I got from AMX_Jeff.
Well damn, Barco added a new device CSE-200 and it uses HTTPS now, and port change to 4001. If I keep my IP socket the same I receive this message:
Line 26 (12:54:50):: CS POLL: GET /v1.0/DeviceInfo/Sharing HTTP/1.1$0D$0AHost: 10.10.1.79:4001$0D$0AAuthorization: Digest username="integrator",realm="",nonce="",uri="/v1.0/DeviceInfo/Sharing",cnonce="2043f351dbcfec88c6b8a0c862681add" ,nc=00000011,algorithm=,response="8fc10d40b85a195
Line 27 (12:54:50):: CS RX: HTTP/1.1 301 Moved Permanently$0D$0ALocation: https://10.10.1.79:4001/v1.0/DeviceInfo/Sharing$0D$0ADate: Wed, 27 Apr 2016 17:55:44 GMT$0D$0AConnection: keep-alive$0D$0ATransfer-Encoding: chunked$0D$0A$0D$0A
Same thing if I change the host to "Host: https://10.10.1.79:4001". If I change the IP socket to 4001 it goes offline the moment I send a command so it doesnt like the format or something. According to the protocol everything is the same between the models except the location is https and port 4001. Any bright ideas?
Thanks vining, I did come across that and noticed the last post of mush saying AMX pointed him to page 131 but thats SSH. I dont have Duet I was hoping something changed with Netlinx and that they would have SSL available.
Comments
Managing your connection with IP is pretty important. I wrote a series of functions I drag into each program for such things. For example with most HTTP you want to just open the connection, send the message and get out. Other connections that may stay alive longer need to be managed as well.
Line 109 (14:40:42):: CIpEvent::OffLine 0:6:1
Line 110 (14:41:02):: IPSocketManConnectTask 'tcp-client:1:6' exiting
Line 111 (14:41:02):: CIpEvent::OnLine 0:6:1
Line 112 (14:41:07):: SENT: GET /v1.0/DeviceInfo/Sharing HTTP/1.1Host: 10.10.1.39:4000
Line 113 (14:41:07):: CIpEvent::OffLine 0:6:1
Here's a sample for an HTTP connection to an Axis IP camera. In this case when you want to control the camera a button is pushed and it send the IP_CLIENT_OPEN then when yu get the online notification it would trigger this function. You have to watch what happens in WireShark and see all the parameters that are being passed and include them in your code then one at a time comment them out to see what the device really doesn't need and then send it the minimum required, it's a real PITA. In this example I could probably have removed more but after a while you end up saying F' it, it's good enough and move on to the real work at hand of controlling the device. Sometimes you think you should be done with the module but you've really only figured out how to talk to the friggin thing.
But I was tested some functions of ClickShare API and it's working.
P.S. My coding ability is not very will....so.... just for your reference....
Just curious - are you sendind CR,LF after the lines in the GET command?
Kuoweiliao I hope you didn't go through the trouble of doing all that for me, I will test out the file you made and post the results and thank you for going through all that.
I have a module posted on the mod pedia forum that uses MD5 too. EPCII or Etherner Power Controller or something like that. I think it include the module that does the MD5 encryption too that I got from AMX_Jeff.
I'm sure if mush got any usefull feedback from AMX he would have posted what he got. Duet users might have a better answer