Hi,
I've noticed a multi-second delay in starting to execute an alert action task in my action set and I can't figure out what is causing it. Specifically, I'm seeing the 'Run Program/Script' action where I invoke curl.exe to make an API call to telegram take several seconds from when the action set starts executing to seeing the curl binary start processing. It takes 6-10 seconds from standing in front of the camera to receiving the alert notification. The trigger and CodeProject AI process and detect a person as expected. In debugging to capture this delay I've implemented the following:


1) Log to file with detailed timestamp on Trigger action to capture Motion Detection timestamp
2) Log to file with detailed timestamp as my first Action in Alert Action set (person required) to capture AI has now determined a person timestamp:

3) Run Program/Script action as a secondary Action which calls curl.exe with detailed timestamp logging and wait for Execution to finish:

CURL PARAMETERS: -vv --trace-time -F chat_id=-82xxxxxxx -F photo=@"E:\BlueIrisData\Video\Alerts\&ALERT_PATH" --trace-time -F caption="[WatchVid](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) [Pause20min](&WAN/admin?profile=5&lock=1) [Pause1hr](&WAN/admin?profile=6&lock=1) [UNpause](&WAN/admin?profile=1&lock=0) \- &MEMO" -F parse_mode=MarkdownV2 -w "ResponseCode: %{http_code} TotalTime: %{time_total}\n" -i --no-progress-meter -o E:\BlueIrisData\AlertLog\CurlLog_&CAM_%Y%m%d-%H_%M_%S.log --stderr E:\BlueIrisData\AlertLog\CurlERRORLog_&CAM_%Y%m%d-%H_%M_%S.log
4) Added Wait Action for Curl to complete:

5) Log to file with detailed timestamp as a POST Curl Action in Alert Action set (person required)

Logs look like this:
Alert log:
Timestamp,Camera,Profile,Type,Memo,AlertPath,comment
2024/02/20-17:28:59.773,FrontDoor56,1: Active,Motion_AB,person:94%,E:\BlueIrisData\Video\Alerts\temp_FrontDoor56_0.jpg,pre-Telegram
2024/02/20-17:29:08.637,FrontDoor56,1: Active,Motion_AB,person:94%,E:\BlueIrisData\Video\Alerts\temp_FrontDoor56_0.jpg,POST-Telegram
Curl StdErr log:
17:29:04.620645 * processing: 17:29:04.725941 * Trying 149.154.167.220:443...
17:29:04.850100 * Connected to api.telegram.org (149.154.167.220) port 443
17:29:04.851107 * ALPN: offers h2,http/1.1
[....]
17:29:08.339309 < HTTP/2 200
Here you can see it took almost 5 seconds for Curl to start. I've installed Wireshark to capture packets on both the Camera network and LAN (to internet) network with timestamps and the first timestamp in Curl log corresponds to the DNS lookup for api.telegram.org. I've tried reinstalling BI. I've tried using just a basic telegram alert with static text only. Antivirus is disabled. I've tried disabling all of my other cameras. None of these seem to help with the delay. Curl is installed on the SSD drive, and temp alert images are written to WD Purple spindle drive.
I'm running a 9 camera setup
Version: Release 5.8.6.7 x64 (2/13/2024)
Service: Yes [.\xxxx]
OS: Windows 11 Pro
CPU,GPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz [22%,51%]
RAM: 1.80GB/31.8GB
Clips: 82210 items, 11.85TB/15.79TB
Storage: C: +141.4GB, E: +623.1GB
Does anyone have any other ideas to try to figure out why there is this delay?
I've noticed a multi-second delay in starting to execute an alert action task in my action set and I can't figure out what is causing it. Specifically, I'm seeing the 'Run Program/Script' action where I invoke curl.exe to make an API call to telegram take several seconds from when the action set starts executing to seeing the curl binary start processing. It takes 6-10 seconds from standing in front of the camera to receiving the alert notification. The trigger and CodeProject AI process and detect a person as expected. In debugging to capture this delay I've implemented the following:


1) Log to file with detailed timestamp on Trigger action to capture Motion Detection timestamp
2) Log to file with detailed timestamp as my first Action in Alert Action set (person required) to capture AI has now determined a person timestamp:

3) Run Program/Script action as a secondary Action which calls curl.exe with detailed timestamp logging and wait for Execution to finish:

CURL PARAMETERS: -vv --trace-time -F chat_id=-82xxxxxxx -F photo=@"E:\BlueIrisData\Video\Alerts\&ALERT_PATH" --trace-time -F caption="[WatchVid](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) [Pause20min](&WAN/admin?profile=5&lock=1) [Pause1hr](&WAN/admin?profile=6&lock=1) [UNpause](&WAN/admin?profile=1&lock=0) \- &MEMO" -F parse_mode=MarkdownV2 -w "ResponseCode: %{http_code} TotalTime: %{time_total}\n" -i --no-progress-meter -o E:\BlueIrisData\AlertLog\CurlLog_&CAM_%Y%m%d-%H_%M_%S.log --stderr E:\BlueIrisData\AlertLog\CurlERRORLog_&CAM_%Y%m%d-%H_%M_%S.log
4) Added Wait Action for Curl to complete:

5) Log to file with detailed timestamp as a POST Curl Action in Alert Action set (person required)

Logs look like this:
Alert log:
Timestamp,Camera,Profile,Type,Memo,AlertPath,comment
2024/02/20-17:28:59.773,FrontDoor56,1: Active,Motion_AB,person:94%,E:\BlueIrisData\Video\Alerts\temp_FrontDoor56_0.jpg,pre-Telegram
2024/02/20-17:29:08.637,FrontDoor56,1: Active,Motion_AB,person:94%,E:\BlueIrisData\Video\Alerts\temp_FrontDoor56_0.jpg,POST-Telegram
Curl StdErr log:
17:29:04.620645 * processing: 17:29:04.725941 * Trying 149.154.167.220:443...
17:29:04.850100 * Connected to api.telegram.org (149.154.167.220) port 443
17:29:04.851107 * ALPN: offers h2,http/1.1
[....]
17:29:08.339309 < HTTP/2 200
Here you can see it took almost 5 seconds for Curl to start. I've installed Wireshark to capture packets on both the Camera network and LAN (to internet) network with timestamps and the first timestamp in Curl log corresponds to the DNS lookup for api.telegram.org. I've tried reinstalling BI. I've tried using just a basic telegram alert with static text only. Antivirus is disabled. I've tried disabling all of my other cameras. None of these seem to help with the delay. Curl is installed on the SSD drive, and temp alert images are written to WD Purple spindle drive.
I'm running a 9 camera setup
Version: Release 5.8.6.7 x64 (2/13/2024)
Service: Yes [.\xxxx]
OS: Windows 11 Pro
CPU,GPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz [22%,51%]
RAM: 1.80GB/31.8GB
Clips: 82210 items, 11.85TB/15.79TB
Storage: C: +141.4GB, E: +623.1GB
Does anyone have any other ideas to try to figure out why there is this delay?
Last edited: