There is more on the scenario here:
though in short, i have two scripts which amount to:
Arm Cameras with 30sec delay
DisARM NCS system cameras
and while 2 of the cameras are standard security cams, 1 other is my tablet/laptop built-in webcam. I want it enabled and active for motion detection/recording while the system is ARM’ed, but when the system is NOT armed, i want it entirely released from NCS (available for other apps, not watching me, etc. Though when i’m away from the house, i’d like to see if anyone sits at my keyboard).
So, since i’ve scripted the 2 arm/disarm scripts in powershell (and am not otherwise utilizing/running the NCS client… but rather utilizing the NCS service directly via scripts)… i would like as part of the Powershell ARM script to be able to utilize what i’ve found under http://localhost:8124/?singlewsdl: as… ConnectCamera and DisconnectCamera
ie.
#Enable source: PC/tablet built-in screen webcam
$URLEnableCam3 = “http://localhost:8124/Json/ConnectCameraJson?sourceId=3&enabled=true&authToken=MyTokenHere”
Invoke-WebRequest -Uri $URLEnableCam3
and similarly in the disarm script to be able to:
http://localhost:8124/Json/DisconnectCamera?sourceId=3&authToken=MyTokenHere
but it seems these are not implemented, or are non-functional as implemented present?
Is this known/expected? and on a bug list to be prioritized as deemed appropriate, and accordingly addressed? or perhaps it’s user syntax error wrt how i’m improperly calling that method (and similarly disconnect which i can’t get to function)-- and someone can clarify further how i can properly call Connect & Disconnect methods?
When i try the ‘Connect’ method as above, i get the following exception error:
Invoke-WebRequest : Request Error
The server encountered an error processing the request. The exception message is ‘Value cannot be null. Parameter
name: value’. See server logs for more details. The exception stack trace is:
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at
Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at
Moonware.Server.WCF.MoonwareServerWCF.d__31.MoveNext() — End of stack trace from previous
location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at
System.ServiceModel.Dispatcher.TaskMethodInvoker.d__16.MoveNext() — End of stack trace from previous
location where exception was thrown — at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at
System.ServiceModel.Dispatcher.TaskMethodInvoker.InvokeEnd(Object instance, Object& outputs, IAsyncResult result) at
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc) at
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc) at
System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
At C:\Users\msein_000\Documents\NCSScript\ArmNCS.ps1:20 char:1
- Invoke-WebRequest -Uri $URLEnableCam3
-
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
thanks and best regards-- PapaMarc