Barco Clickshare

MLaletasMLaletas Junior MemberPosts: 225
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.

Comments

  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,159
    post the code. perhaps you're just missing a little something.
  • MLaletasMLaletas Junior Member Posts: 225
    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.
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,159
    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.
  • MLaletasMLaletas Junior Member Posts: 225
    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
  • viningvining X Member Posts: 4,353
    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.
    DEFINE_FUNCTION fnAxisSendPTZ_CMD(CHAR iCmnd[],INTEGER nHoldRepeat)
        
         {
         SEND_STRING 0,"'AXIS CAM MOD-[ ',itoa(nThisAXISCAM),' ], TX CMD-[ ',iCmnd,' ] :DEBUG<',ITOA(__LINE__),'>'" ;
      
          SEND_STRING dvAXISCAM,"'GET /axis-cgi/com/ptz.cgi?camera=1&',iCmnd,' HTTP/1.1',CRLF" ;
          
          //SEND_STRING dvAXISCAM,"'Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash,',
          //                   ' application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml,',
          //                   ' application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*',CRLF" ;
          SEND_STRING dvAXISCAM,"'Referer: http://',cAXISCAM_IP_ADDRESS,'/view/status.html',CRLF" ;
          //SEND_STRING dvAXISCAM,"'Accept-Language: en-us',CRLF" ;
          //SEND_STRING dvAXISCAM,"'User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB5;',
          //                   ' .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 1.0.3705; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)',CRLF" ;
          //SEND_STRING dvAXISCAM,"'UA-CPU: x86',CRLF" ;
          //SEND_STRING dvAXISCAM,"'Accept-Encoding: gzip, deflate',CRLF" ;
          //SEND_STRING dvAXISCAM_Arry[nAxisCurCamIndx],"'If-Modified-Since: Fri, 13 Mar 1970 22:49:57 GMT; length=492',CRLF" ;
          SEND_STRING dvAXISCAM,"'Host: ',cAXISCAM_IP_ADDRESS,CRLF" ;
         // SEND_STRING dvAXISCAM,"'Connection: Keep-Alive',CRLF" ;
          SEND_STRING dvAXISCAM,"'Authorization: Basic ',fnAxisEncryptUserPass(),CRLF" ;
          SEND_STRING dvAXISCAM,"CRLF" ;
          
          fnAxis_DeBug("'SENT:  GET /axis-cgi/com/ptz.cgi?camera=1&',iCmnd,'CRnLF. :DEBUG<',ITOA(__LINE__),'>'") ;
          //fnAxis_DeBug("'SENT:  Authorization Sent: ',fnAxisEncryptUserPass(),'. :DEBUG<',ITOA(__LINE__),'>'") ;
        
          
         RETURN ;
    }
    
  • kuoweiliaokuoweiliao Junior Member Posts: 23
    I don't have more time to finish the module.
    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....
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,159
    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?
  • MLaletasMLaletas Junior Member Posts: 225
    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.
  • MLaletasMLaletas Junior Member Posts: 225
    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!
  • viningvining X Member Posts: 4,353
    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.
  • MLaletasMLaletas Junior Member Posts: 225
    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?
  • MLaletasMLaletas Junior Member Posts: 225
    So better question to ask is there a way to connect via SSL through Netlinx yet?
  • viningvining X Member Posts: 4,353
    http://www.amxforums.com/forum/technical-forum/amx-hardware/121182-https-client
    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
  • MLaletasMLaletas Junior Member Posts: 225
    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.
Sign In or Register to comment.