roleoroleo / onvif_simple_server

Light implementation of an onvif server intended for use in resource-constrained devices
GNU General Public License v3.0
28 stars 11 forks source link

PullMessages operation does not exist #14

Open icedbeancat opened 2 days ago

icedbeancat commented 2 days ago

Hi @roleoroleo, I was able to successfully run the server, thank you.

However, I am facing an issue with PullMessages when testing with client. This is the output after PullMessages:

{ 'CurrentTime': datetime.datetime(2024, 10, 18, 9, 31, 42, tzinfo=<isodate.tzinfo.Utc object at 0x701019e0b610>), 'TerminationTime': datetime.datetime(2024, 10, 18, 9, 31, 44, tzinfo=<isodate.tzinfo.Utc object at 0x701019e0b610>), 'NotificationMessage': [] }

I have already created the necessary input files as shown:

/tmp/onvif_notify_server$ ls -l
total 16
-rw-rw-rw- 1   0 Oct 18 16:23 animal_detection
-rw-rw-rw- 1   0 Oct 18 16:23 baby_crying
-rw-rw-rw- 1  11 Oct 18 16:24 human_detection
-rw-rw-rw- 1  55 Oct 18 16:23 motion_alarm
-rw-rw-rw- 1  11 Oct 18 17:02 sound_detection
-rw-rw-rw- 1  11 Oct 18 16:24 vehicle_detection

Am I supposed to populate the files? From my understanding, even though the file is empty, I should at least still see the Topic and Source information as configured in the .conf file. Or is what I'm seeing now what is expected?

Appreciate your help very much!

roleoroleo commented 2 days ago

onvif_notify_server checks if files exist. So, you have to touch the file when the alarm is fired and remove the file when the alarm ends.