I am trying to change settings in my camera using its web api. I know the api call is correct however I am having trouble doing the authentication. I have tried several formats and done enough googling to feel ok posting here.
The documentation for the api says it supports both basic and digest auth. When using basic auth it requires the username and password to be base64 encoded.
So it worked but you didn’t like how the url looked?
If that is the case I think you will need to figure out some other way to communicate with the device. I think openHAB only supports basic authentication and per your posting above the basic authentication requires base 64 encoding.
I dont know what was different last night but I couldnt get the formated url to work in wget or a browser but now it is working in the browser using basic auth. However it is still not working in the binding.
You should see something, even if it is just one log statement near the start of openHAB saying the HTTP binding is loaded and running. If you don’t see that then the binding itself may not be installed. Verify that the HTTP binding’s jar file is in your addons folder.
Ok I finally found a curl command that works. As such I have switched from trying to do an http binding to an exec binding. I kept trying different options and this finally worked
Error: 23:17:23.553 ERROR o.o.m.i.i.GenericItemProvider[:354]- Binding configuration of type ‘exec’ of item âOfficeCameraMotionâ could not be parsed correctly.
java.lang.NullPointerException: null
at java.util.regex.Matcher.getTextLength(Matcher.java:1234)
at java.util.regex.Matcher.reset(Matcher.java:308)
at java.util.regex.Matcher.(Matcher.java:228)
at java.util.regex.Pattern.matcher(Pattern.java:1088)
at org.openhab.binding.exec.internal.ExecGenericBindingProvider.processBindingConfiguration(ExecGenericBindingProvider.java:100)
Am I going to have to escape every special symbol again?
I feel like I had to go the round about way of doing it three times.
I ended up making a bash script with the one line to run the curl script, which was called by the exec binding. I had expected to just be able to use the http binding. I guess things are rarely as easy as we expect them to be.