Problems with square brackets on a URL (Dahua TiOC API)

Avatar
  • updated

Hello!

I've recently testing out TiOC cameras from Dahua, where I need to use their TiOC API. I've tested some of the URLs on the browser, and with curl, and even though they work, I have a small problem with bOS.

The url itself is this one (just for now):


http://192.168.1.108/cgi-bin/coaxialControlIO.cgi?action=control&channel=1&info[0].Type=1&info[0].IO=1

On the browser, I just have to past the url, enter the username and password and that's it. Testing done.

With curl, as I have square brackets, either I use the --globoff option or I have to change the [ ] with %5B and %5D respectively. Otherwise the curl command gives error.

So, I'm trying to use this url on bOS and it simply doesn't work.


If I use the [ ] I don't get anything. If I use the %, it will conflict in the string editor, as %5... will expect the pointer. I've tried almost everything I can remember, 

I know some guy that will probably figure this out, as I know that he probably uses TiOC cameras...


Yes Jürgen, this message is for you :P

Help!

Best regards

Avatar
Ricardo Pinto


Oh, you mean the end the command as string... Well haven't thought of that, I was trying several string variations but not that way.

I can surely try!

bOS team can also try to give any hint on how to escape the url correctly.

I will try your suggestion tomorrow morning, thanks.


Best regards

Avatar
Ricardo Pinto

Hey bud,

Yes, I've already tried that, and it didn't worked.


At first, I thought I was doing something wrong with the url, but I've compared to another installation where I have the door lock from a Dahua VTO being fired up by the bOS, and the url composition is the same.


So I think the problem may be from not being able to correctly send the square brackets. At least that's what I think it's happening.

Best regards 

Avatar
Jürgen Jürgenson

Hey

Have you tried to use the end of the command as a string value and use it as %x property value?
For the command use  cgi-bin/coaxialControlIO.cgi?action=control&channel=1&info%0 and %0 string value try if [0].Type=1&info[0].IO=1 or %5B0%5D.Type=1&info%5B0%5D.IO=1 or |%|5B0|%|5D.Type=1&info|%|5B0|%|5D.IO=1 will work.