ONVIF Motion Events Not Triggering

I believe I have everything setup correctly on the cameras and in bluecherry, but I’m not seeing any “Marking the passed packet with TriggerFlag” events in the log and I’m not seeing recordings made when there is motion.

Details:

  • Hikvision DS-2CD2042WD-I
  • Hikvision-CGI enabled with digest/basic
  • Camera ONVIF enabled with the same username and password that was being used when this camera was setup manually.
  • Camera Motion Detection enabled for the whole area at 80 sensitivity, which I double checked using the Dynamic Analysis for Motion feature.
  • Camera Arming Schedule is 24/7
  • Camera Linkage Method is Notify Surveillance Center: A1
  • Bluecherry ONVIF Probe & Autoconfigure worked and changed some device settings, which were saved.
  • Followed directions here: ONVIF Motion detection - Bluecherry.
  • Server version 3.1.1

Logs show the following, but no events are recorded when they should be:

Mar 14 15:56:40 cmbluecherry2 bc-server[1994]: I(10/Cafe N): Setting up device
Mar 14 15:56:45 cmbluecherry2 bc-server[1994]: I(10/Cafe N): Stream started: h264, 1/90000(s) 1/90000(c)
Mar 14 15:56:45 cmbluecherry2 bc-server[1994]: I(10/Cafe N): Switching to new recording schedule 'triggered'
Mar 14 15:56:45 cmbluecherry2 bc-server[1994]: I(10/Cafe N): Starting onvif events thread 2256520768 for device 10 ...
Mar 14 15:56:45 cmbluecherry2 bc-server[1994]: E(10/Cafe N): Can't write to live stream: Invalid data found when processing input
Mar 14 15:56:45 cmbluecherry2 bc-server[1994]: E(10/Cafe N): Failed to stream packet for HLS live view
Mar 14 15:56:45 cmbluecherry2 bc-server[1994]: I(10/Cafe N): Subscribed to ONVIF events at http://172.18.0.16/onvif/Events/PullSubManager_20250314T155645Z_0
Mar 14 15:57:00 cmbluecherry2 bc-server[1994]: I(10/Cafe N): Stream started: h264, 1/90000(s) 1/90000(c)
Mar 14 15:57:00 cmbluecherry2 bc-server[1994]: W(10/Cafe N): Likely timestamping error. Ignoring.

I upgraded to 3.1.9, which required an apt-get dist-upgrade. After the update and a reboot, the devices page showed blank and the log file was flooded with 15 a second of:

Mar 14 16:50:55 cmbluecherry2 bc-server[1919]: I(11/Wine Camera): Starting onvif events thread 1140848192 for device 11 ...
Mar 14 16:50:55 cmbluecherry2 bc-server[1919]: I(11/Wine Camera): ONVIF events thread exiting... 

This is a different camera that I’m also trying to get setup.

I used a snapshot to revert to 3.1.1

We are aware of issues with ONVIF, we are putting priority into a rewrite of the ONVIF code to support edge notifications. In short the new code will pull down event types the camera supports (person detected|vehicle detected|object detection) allowing you to fine tune the type of notifications. I’m hoping this will be ready for testing in the next 6-8 weeks.

Just to confirm- based on the log files I sent over you can determine that there is no chance of getting this to work with our current cameras with the current release of bluecherry?

Just dropping a note - to upgrade from 3.1.1 on ubuntu 22.04.5 to 3.1.9 I had to apt install php8.3-sqlite3 after the dist-upgrade.

Correct. However you could help speed up development if you could help run some commands on any onvif cameras you have.

sudo apt install bluecherry-node-onvif
wget https://gist.githubusercontent.com/curtishall/a9e66351bfc8213a749daf3876b86e88/raw/f97ce9d4b388b326b64cce09daad5e699481258f/bc-check-onvif.js
node bc-check-onvif.js ipaddress port login password

Example command:

node bc-check-onvif.js 192.168.87.151 8000 admin admin

Example output:

*******************************************************************************
** This script subscribes for events and aggregates supported rules
** Usage: node bc-check-onvif.js <ip> <port> <username> <password>
*******************************************************************************
Connected to ONVIF Device
Manufacturer  REOLINK
Model         RLC-823A
Firmware      v3.1.0.2831_23102509_v1.0.0.31
Serial Number 19216887151
Device Time   Sat Mar 15 2025 20:57:06 GMT+0000 (Coordinated Universal Time)
Event properties retrieved.
Listening for events for 20 seconds...
Received Event Topic: tns1:RuleEngine/CellMotionDetector/Motion
Received Event Topic: tns1:RuleEngine/MyRuleDetector/FaceDetect
Received Event Topic: tns1:RuleEngine/MyRuleDetector/PeopleDetect
Received Event Topic: tns1:RuleEngine/MyRuleDetector/VehicleDetect
Received Event Topic: tns1:RuleEngine/MyRuleDetector/DogCatDetect
Received Event Topic: tns1:VideoSource/MotionAlarm

Polling complete.

This camera supports the following rules:

CellMotionDetector: Motion
DogCat Detect
People Detect
Vehicle Detect
VideoSource: MotionAlarm

Got it, thanks. I installed the jillion packages required for npm, then nimble and was able to get the command to run. We currently have several IP cams, but they are all one of two models. I chose one of each, made sure the firmware was up to date and ONVIF was configured, etc. and ran the commands.

Hikvision DS-2CD2042WD-I

Connected to ONVIF Device
Manufacturer  HIKVISION
Model         DS-2CD2042WD-I
Firmware      V5.5.82 build 190220
Serial Number [redacted]
Device Time   Mon Mar 17 2025 00:34:46 GMT+0000 (Coordinated Universal Time)
Event properties retrieved.
Listening for events for 20 seconds...
Received Event Topic: tns1:VideoSource/MotionAlarm
Received Event Topic: tns1:RuleEngine/CellMotionDetector/Motion
Received Event Topic: tns1:RuleEngine/TamperDetector/Tamper
Received Event Topic: tns1:VideoSource/ImageTooDark/ImagingService
Received Event Topic: tns1:RuleEngine/FieldDetector/ObjectsInside
Received Event Topic: tns1:Monitoring/OperatingTime/LastReset
Received Event Topic: tns1:Monitoring/OperatingTime/LastReboot
Received Event Topic: tns1:Monitoring/OperatingTime/LastClockSynchronization
Received Event Topic: tns1:Device/HardwareFailure/StorageFailure
Received Event Topic: tns1:Monitoring/ProcessorUsage

Polling complete.

This camera supports the following rules:

CellMotionDetector: Motion
VideoSource: MotionAlarm

Hikvision DS-2CD2043G0-I

Connected to ONVIF Device
Manufacturer  HIKVISION
Model         DS-2CD2043G0-I
Firmware      V5.6.821
Serial Number [redacted]
Device Time   Mon Mar 17 2025 00:39:05 GMT+0000 (Coordinated Universal Time)
Event properties retrieved.
Listening for events for 20 seconds...
Received Event Topic: tns1:VideoSource/MotionAlarm
Received Event Topic: tns1:RuleEngine/CellMotionDetector/Motion
Received Event Topic: tns1:RuleEngine/TamperDetector/Tamper
Received Event Topic: tns1:VideoSource/ImageTooDark/ImagingService
Received Event Topic: tns1:RuleEngine/FieldDetector/ObjectsInside
Received Event Topic: tns1:Monitoring/OperatingTime/LastReset
Received Event Topic: tns1:Monitoring/OperatingTime/LastReboot
Received Event Topic: tns1:Monitoring/OperatingTime/LastClockSynchronization
Received Event Topic: tns1:Device/HardwareFailure/StorageFailure
Received Event Topic: tns1:Monitoring/ProcessorUsage
Received Event Topic: tns1:Monitoring/ProcessorUsage
Received Event Topic: tns1:VideoSource/MotionAlarm
Received Event Topic: tns1:RuleEngine/CellMotionDetector/Motion

Polling complete.

This camera supports the following rules:

CellMotionDetector: Motion
VideoSource: MotionAlarm

Could we get remote access to these cameras (port 80) for onvif event testing? We’ve tested on Reolink and some Panasonic cameras, but the more we can have in our test pool (remotely even) is fine.

Thanks

$ curl http://127.0.0.1:4000/devices/54/events/test-subscribe
{"message":"Subscribed for 20 seconds. Check logs for events."}curt@v3demo:~$ curl http://127.0.0.1:4000/devices/54/events/types
[{"type":"motion","label":"Motion Detection"},{"type":"facedetect","label":"Face Detection"},{"type":"peopledetect","label":"Person Detection"},{"type":"vehicledetect","label":"Vehicle Detection"},{"type":"dogcatdetect","label":"Animal Detection"},{"type":"motionalarm","label":"Motion Detection"}]curt@v3demo:~$