This is a broad question and I'm not certain if its even possible but I'm genuinely curios if there is a way to make some form of call from a perspective session to control an AXIS Pan-Tilt-Zoom camera.
This is a very loaded question, but if anyone has any ideas of how this may be possible I'm all ears.
The username and password fields are correct on my end.
This is giving me this error:
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 2, in runAction IOError: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.python.core.PyException: IOError: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
... 38 common frames omitted
Its very long and gross but it confuses me because the get request has the identification credentials and it seems to be a security error.
not sure how to proceed but any insights would be helpful while I try and fix this issue.
With a little looking it seems that the self signed certificate is not trusted. So I added a bypass for testing purposes to see if I could actually make it work before I went about adding the certificate and what not. (from here: Unable to POST on a REST API using https - #8 by Ben_Hunt)
This is currently what I have in a simple button event:
However, this still does not seem to accept the zoom function to the camera regardless of HTTP or HTTPS. The password and username variables also don't seem to make a difference. 401 is still the return.
The weird thing about this is I did a basic test and just threw the URL into a browser and ran it and it will zoom the camera in but not via the button.
If you have any further suggestions they would be greatly appreciated.
Have you been able to work with the AXIS cameras through ignition? Because I did some more digging and found this:
which informed me via the .net function provided by ignition you cannot authenticate with these cameras to perform actions?
I have an idea for a potential work around that involves the 'requests' header in python but cannot seem to add it to the scripting library properly to call it. Would you happen to know how to do that? Or do you have a better way?
I know this thread is technically closed but I was just wondering if you know how to make calls that involve JSON? Because I can get the simple ones to work that move the camera but I cannot get the ones with JSON to work for user management and things like that.