Delay between tasks in Alert Action set

txedgeman

n3wb
Joined
Dec 9, 2022
Messages
9
Reaction score
5
Location
Texas
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:
Picture1.jpgPicture2.jpg
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:
Picture3.jpg
3) Run Program/Script action as a secondary Action which calls curl.exe with detailed timestamp logging and wait for Execution to finish:
Picture4.jpg
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:
Picture6.jpg
5) Log to file with detailed timestamp as a POST Curl Action in Alert Action set (person required)
Picture7.jpg
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:

txedgeman

n3wb
Joined
Dec 9, 2022
Messages
9
Reaction score
5
Location
Texas
What sort of delays in seconds are people seeing from the instant you step in front of the camera to the moment you get your pushover/telegram AI based notification?

I had tried uninstalling and reinstalling Blue Iris then re-importing my configuration. I saw in another thread that it might be better to rebuild the config from scratch.

I'm also contemplating to wipe the boot drive and reinstall Windows (using copy from Microsoft). Will this mess up my license with Blue Iris? I really don't want to loose all the settings and tuning that I've done to get it working.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,037
Reaction score
48,808
Location
USA
There are so many factors - computer processor, router, internet speed, etc.

Most are between 2 and 10 seconds after triggered.
 

txedgeman

n3wb
Joined
Dec 9, 2022
Messages
9
Reaction score
5
Location
Texas
Tried to reinstall Windows only to find out that the processor is no longer supported by Windows. I did an OS reset which is supposed to turn it back to a new install without wiping data from disk. That did not help as I still saw the delay in starting to send the telegram alert.

Next, I sprung for a new (refurbished) PC with more current processor (i9-9900), 32GB RAM, 256GB M.2 SSD boot/BI main disk. Did a clean install of Windows 11 Pro, disabled AV, installed BI, and moved my WD Purple main storage disk to new machine. Did a BI restore. I note in the new clean version of Win 11 pro, there is an included version of curl so, no longer a need to use the 3rd party version. I still see the same delay in the action set between the first append-to-file log event to the start of the execution of the curl command to send the telegram alert.

Next I tried to rebuild the full camera config (complete with triggers, alerts, recording) in BI for a camera and still see the delay in starting the curl invocation. I'm really stumped here.
 
Top