You can watch the log in realtime by running this in linux if you SSH in.
tail -f /var/log/openhab2/openhab.log
CTRL + C will stop the output.
The other way would be to delete the log file and it will then get re-created when openhab trys to write to the file. You then have a fresh file that is much smaller.
@matt1 " http://172.29.8.70/MotionDetection/1" link shows a blank page for a brief period and then displays âThis site can not be reachedâ
and still the state of âEnable/Disable motion alarmâ and âMotion alarmâ is not changingâŠ
Something else I noticed in your log output is the camera did reply and it appeared that your camera gave corrupted output.
So should test it with another camera !?
another thing i noted is that when i disable the motion alarm it re-enables itself again even if âmotion detectionâ is disabled in the cameraâŠ
With Digest Auth it is 100% normal and ok to see every second request to the camera to be a 401 unauthorized error, if you read the logs you will see the binding detects this and sends the request a second time with the special encyption NONCE key and then you see a 200 OK reply.
Why it is continuously generating the Debug log messages!! shouldât it generate the logs only in case of motion or image updation !!! and i cant seem to disable âEnable/disable alarmâ button.
If you want a lower level of logs then set it to INFO and not DEBUG using the same method you changed it to debug with. Debug is for watching everything that is going on to find issues aka finding bugs, debug.
@toroid
Excellent news, so does the binding change when it sees this? What was stopping it from showing up before? It seems safe to make this automatic in the next build.
@matt1 I switched the test code off to on and back and I finally worked motion alarm in the log the following entries:
:
2018-05-22 13:16:56.909 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:172.18.2.13
2018-05-22 13:16:56.918 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - + The request is going to be GET:/ISAPI/Event/notification/alertStream:
2018-05-22 13:16:56.925 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: This reply from the camera is normal if it needs Basic or Digest auth details.
2018-05-22 13:16:56.928 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:172.18.2.13
2018-05-22 13:16:56.936 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - + The request is going to be GET:/ISAPI/Event/notification/alertStream:
2018-05-22 13:16:56.944 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
MIME-Version: 1.0
Connection: close
Content-Type: multipart/mixed; boundary=boundary
2018-05-22 13:16:56.948 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 632, cap: 632/632, unwrapped: PooledUnsafeDirectByteBuf(ridx: 739, widx: 739, cap: 1024)), decoderResult: success)
2018-05-22 13:16:56.951 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 549
<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>172.18.2.13</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>94:e1:ac:11:cd:86</macAddress>
<channelID>1</channelID>
<dateTime>2018-05-22T13:16:56+03:00</dateTime>
<activePostCount>1</activePostCount>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion alarm</eventDescription>
<DetectionRegionList>
</DetectionRegionList>
<channelName>Cam-1</channelName>
</EventNotificationAlert>
:
I switched the test code off to on and back and I finally worked motion alarm in the log the following entries
Same thing happened with me. when i kept toggling the new code button fast enough, it detected the motion and state of motion alarm button changed.
but this state is not reverting back.
strange thing i noticed in logs is that when i toggle the new code button once in a while it goes to check ISAPI/Event/notification/alertStream.
OK I have done another build with HikAuto on the end, this one should not need to have the test button pushed as it will now poll the camera. I also made another slight change which should not break anything as it will speed up polling with HIK.
@ArsalanAlli http://172.29.8.70/MotionDetection/1
if the above url does not work for you maybe try this one
/ISAPI/Event/schedules/motionDetections
Try it in a browser and what you are looking for is
<enabled>true</enabled>
Without finding a working way to see if the motion alarm is turned on or off, the binding will also not be able to turn it on and off. HIK uses a very big pain in the butt way that requires you to fetch the XML, you edit it and then send it back to the camera to change the settings. This is why I could not start adding the support Sergey is asking for until I reached this point.
There is an API linked in the first post for hikvision, go through the links and see if you can find one that works. Often they have more than 1 url that does the same thing.
i just figured it out that during the first few seconds of âtest new button- ONâ motion is detected and it changes the state of motion alarm⊠but does not change its state afterwards.
There is an API linked in the first post for hikvision
OK I have done another build with HikAuto on the end
@matt1 HIKAuto build is detecting motion and changing the state of âMotion Alarmâ to ON but it is not changing the state back to OFF when there is no motion.