Yet Another Free Extension for Blue Iris Adding AI Object Dectection/Reduction in False Alarms/Enhanced Notification of Activity/On Guard

Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
I believe that the app should run OK without the database. Just don't turn on/press the Motion Only button.
Your SQL issues are something I'll look into.
I wouldn't worry about it if it is only me having these SQL errors. If others also have the errors....that's different :)
Tried to see how I can investigate the errors to give you some info. But I think I need a SQL server files to launch the MMC.exe snap-in for it, which I do not have.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
I wouldn't worry about it if it is only me having these SQL errors. If others also have the errors....that's different :)
Tried to see how I can investigate the errors to give you some info. But I think I need a SQL server files to launch the MMC.exe snap-in for it, which I do not have.
First, exit from On Guard

Go to a windows command prompt as an administrator. The easiest way to do that is click on the Windows start menu. Depending on your OS either type in "cmd" or type cmd into the search bar. When you see the cmd icon show up, right click and Run as Admin. You probably already know how to do that, but....

Next type in the following commands:
sqllocaldb stop mssqllocaldb
sqllocaldb delete mssqllocaldb
sqllocaldb start "MSSQLLocalDB

Tell me about any errors. If there are no errors restart On Guard. tell me if that solves your SQL problems. Look at the very bottom of your log files and note the time to make sure they are recent.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
OK, that is definitely bad.
Please re-download the file version from GitHub, not the release. There is a possibility that the setup file there wasn't 100% correct.
So, go to control panel. Uninstall On Guard. Once uninstalled run the setup from GitHub. Watch carefully to see if LocalDB is installed correctly. Then, re-run the sqllocaldb commands above and see if anything is different
.
I did just try an install on a plain vanilla computer that ran the setup and installed localdb. It worked, but at times I saw windows going behind one another. That was probably me messing around on it, but there is a possibility that some important error message is getting hidden. In any event I want to make sure you're not failing in the install process somewhere.

I did run these sqllocaldb commands on the fresh install on the other computer. They worked fine. So, if this isn't working on your re-install post back here. If it still fails the sqllocaldb commands there must be something Microsoft is choking on. I do have one other option, but that would require I add additional login credentials for SQL, and I'd rather not if I don't have to. Just one more set of settings.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
And while you are in control panel uninstalling on guard you should probably uninstall Microsoft SQL Server 2019 LocalDB as well.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
uninstalled both OnGuard and SQL server. rebooted machine. no firewall / no anti-virus.
did the sqllocaldb trick, ran OnGuard as administrator just for giggles.
no obvious errors with OnGuard during start up. Same SQL errors in log. However, I think I fixed it with blunt force :) error example below:
2020.12.25 19:16:15:3218 - MainWindow - InsertMotionIfNecessary - Sql Exception on opening database connection: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)
2020.12.25 19:17:05:3310 - MainWindow - InsertMotionIfNecessary - Sql Exception on opening database connection: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)
2020.12.25 19:18:39:2416 - MainWindow - InsertMotionIfNecessary - Sql Exception on opening database connection: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)
2020.12.25 19:37:52:6691 - On Guard started at: 12/25/2020 7:37:52 PM
2020.12.25 19:40:38:0765 - 0 interesting objects found in file: D:\AI\AI_Front.20201225_194037565.jpg
Just a complete wall of those SQL errors in no discernable time line pattern while idle (no events at those times).
How I fixed it (at least, no SQL errors as of yet since 10:30pm last night)... I downloaded/installed the 2019 SQL Lite Express from Microsoft, thinking I needed the SQL Server Configuration Manager itself to start indepth troubleshooting (I think this is the only way to see the associated network port, related names, etc).
So...let's chalk up the errors I've been having to my unique personal PC & Windows. Maybe goofy initial Windows installation or something else.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
uninstalled both OnGuard and SQL server. rebooted machine. no firewall / no anti-virus.
did the sqllocaldb trick, ran OnGuard as administrator just for giggles.
no obvious errors with OnGuard during start up. Same SQL errors in log. However, I think I fixed it with blunt force :) error example below:
2020.12.25 19:16:15:3218 - MainWindow - InsertMotionIfNecessary - Sql Exception on opening database connection: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)
2020.12.25 19:17:05:3310 - MainWindow - InsertMotionIfNecessary - Sql Exception on opening database connection: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)
2020.12.25 19:18:39:2416 - MainWindow - InsertMotionIfNecessary - Sql Exception on opening database connection: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)
2020.12.25 19:37:52:6691 - On Guard started at: 12/25/2020 7:37:52 PM
2020.12.25 19:40:38:0765 - 0 interesting objects found in file: D:\AI\AI_Front.20201225_194037565.jpg
Just a complete wall of those SQL errors in no discernable time line pattern while idle (no events at those times).
How I fixed it (at least, no SQL errors as of yet since 10:30pm last night)... I downloaded/installed the 2019 SQL Lite Express from Microsoft, thinking I needed the SQL Server Configuration Manager itself to start indepth troubleshooting (I think this is the only way to see the associated network port, related names, etc).
So...let's chalk up the errors I've been having to my unique personal PC & Windows. Maybe goofy initial Windows installation or something else.
Well, hopefully it is working now. I considered just telling the user: "Install Sql Server Lite" in the instructions, but the localDB stuff doesn't require extra steps (when it works at least).

Let me know what you think of the changes to MQTT.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
Can the setup.exe work with Windows 7 - SQL Server 2016 LocalDB too ?
I believe that any version of SQL should work. The only problem might be with the security settings. I'm using the "Windows Authentication" security since it avoided adding yet more stuff to the setup screens. However, I may make that an option as well if it becomes an issue. Please let me know if it doesn't work.
 

MolsonB

n3wb
Joined
Nov 30, 2020
Messages
10
Reaction score
0
Location
Ontario, Canada
I just meant, when I try setup.exe, it says I need 2019 LocalDB to continue.
So I just run installer instead. Having Windows 7 and 2016 LocalDB does work, I just can't install OnGuard using setup.exe

I believe that any version of SQL should work. The only problem might be with the security settings. I'm using the "Windows Authentication" security since it avoided adding yet more stuff to the setup screens. However, I may make that an option as well if it becomes an issue. Please let me know if it doesn't work.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
I just meant, when I try setup.exe, it says I need 2019 LocalDB to continue.
So I just run installer instead. Having Windows 7 and 2016 LocalDB does work, I just can't install OnGuard using setup.exe
That is a bit of a surprise. I appreciate you letting me know. I'll look at the prerequisites and see if there options that would be helpful. I know that I could use earlier versions of SQL going back to 2008/2012 if I recall correctly. I'm not doing anything requiring later versions of SQL.

I wouldn't be totally shocked if there were other issues related to older versions of Windows. I am using the latest version of the .Net Framework (4.8). I could use earlier versions if necessary. I believe that that is fully Windows 7 compatible, but I haven't checked.

BTW, I know that there are many reasons why people would prefer Windows 7 (I worked on it at Microsoft). However, if your main reason for not upgrading is the annoying Start Menu you might want to try Start 10. It is very inexpensive (< $10) and I've found it very stable. Personally, I do hate the Windows 8/10 Start Menu.

Just to be clear then, with the exception of SQL you got everything working, and you got around that?
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
If anyone has tried the new MQTT features (only with the code download, not the latest "release") I'd appreciate some feedback. Likewise, if anyone has tried the "motion stopped" feature I'd appreciate feedback on that. Just as a recap of those features (1) You can now define your own MQTT topic/payload format (2) You can optionally get notifications sent to an URL or MQTT server when motion has stopped.

I intend to make a new release within then next day or so with these new features. In addition, there will be some features/bug fixes. Among the new features is the ability to have your defined areas work without change if you change your .jpg motion frame resolutions change. In fact, you should be able to mix and match resolutions from Blue Iris within any working set. That is, some pictures may be at 2560x1920 and some at 1024x768 - all for the same camera.

Note that the new release when it comes will require you to redefine your cameras and areas. Note that this is in effect now for code downloads (not the formal release). This is because data has been added internally to support the new features. Unfortunately, there is no good way to transfer your old camera and area data. Your email server definitions will be retained, but that's about it.
 

silencery

Pulling my weight
Joined
Oct 6, 2015
Messages
223
Reaction score
153
Been busy with work and family for the holidays, but yes, I definitely intend to try out the newest beta ASAP! Will report back when I get a chance.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
after I fix my Ubiquiti UDM router/switch firmware issue (all static IP's on any subnet can not reach gateways all of a sudden)... I'll help with the MQTT portion.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
Release 1.4.1 is now at GitHub at: Release On Guard Security Assistant Version 1.4.1 · Ken98045/On-Guard

This version adds user defined MQTT messages and support for "the motion has stopped" events. This should allows you to do such things as turn lights on when motion is detected, and turn them off when motion has stopped. This is supported both through MQTT and via URL/HTTP notifications.

The data files for the cameras and the areas have changed since data has been added. Therefore you will need to re-create cameras and areas. This will be true even if you downloaded the Beta/non-release version.
Note that setup data files are now stored at: users\YourUserName\AppData\Roaming\OnGuard instead of the previous locations. If you were updating from a previous release you will not need to manually delete your setup files (unless you downloaded the Beta).

The way in which Cleanup Old Pictures operates has been enhanced and changed. You can now specify the day and hour range to cleanup. Cleanup is now camera specific.

An added feature with this version is that your can change your motion picture resolution via Blue Iris without needing to re-define your areas. In fact, you can mix and match your picture resolutions even in the same working set. This should allow you to experiment with different motion frame settings if you are trying to balance performance vs picture detail. That may not be too important to many, but it annoyed me so I fixed it.

There were also several bug fixes. Among these is a fix that corrects On Guard handling of situations where DeepStack gets overloaded.

As always, I welcome bug reports and suggestions for new features.

If you haven't tried the new DeepStack version I suggest you do so. It is located at: Release DeepStack Windows Version - Beta · johnolafenwa/DeepStack. If you have an NVidia card (with CUDA support) download the GPU version. It does not need to be a particularly powerful NVidia card to benefit from the GPU version. My DeepStack processing time has gone down to about 225ms to 400ms with 2560x1920 motion pictures. With 1280x1024 pictures it is down to about 125 - 175ms. Thus, if desired you can change your Blue Iris motion capture rate to 4 to 8 frames per second without any significant delay in image processing by On Guard. I understand that the CPU/non-NVidia version has also been speeded up. I have not tried it.
 
Last edited:

Vettester

Getting comfortable
Joined
Feb 5, 2017
Messages
749
Reaction score
706
Hi Ken,

I installed the latest update and have it setup on two cameras and for some reason my notifications stop after the first one is sent. If I restart the app it does the same thing, one notification and then it stops. Not sure if it makes a difference or not, but I'm running DeepStack inside a docker container. When I test the DeepStack connection it comes back with "successfully processed a picture via DeepStack" and the logs indicate the pictures are being processing.

Any thoughts on what might be causing this?

Here is a sample of my log file.

2020.12.29 18:20:18:3734 - On Guard started at: 12/29/2020 6:20:18 PM
2020.12.29 18:20:42:7946 - 0 interesting objects found in file: C:\aiinput\aifrontdoor.20201229_182042288.jpg
2020.12.29 18:20:49:2846 - 3 interesting objects found in file: C:\aiinput\aidriveway.20201229_182048810.jpg
2020.12.29 18:20:49:3136 - Successfully notified URL: in the street
2020.12.29 18:23:50:0168 - 0 interesting objects found in file: C:\aiinput\aifrontdoor.20201229_182349532.jpg
2020.12.29 18:24:31:2966 - 1 interesting objects found in file: C:\aiinput\aidriveway.20201229_182430804.jpg
2020.12.29 18:28:15:2706 - 2 interesting objects found in file: C:\aiinput\aidriveway.20201229_182814802.jpg
2020.12.29 18:32:03:2742 - 1 interesting objects found in file: C:\aiinput\aidriveway.20201229_183202794.jpg
2020.12.29 18:33:17:8710 - 3 interesting objects found in file: C:\aiinput\aidriveway.20201229_183317378.jpg
2020.12.29 18:42:36:0199 - 0 interesting objects found in file: C:\aiinput\aifrontdoor.20201229_184235541.jpg
2020.12.29 18:42:45:2482 - 2 interesting objects found in file: C:\aiinput\aidriveway.20201229_184244777.jpg

-TIA
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
75
Location
Seattle
Hi Ken,

I installed the latest update and have it setup on two cameras and for some reason my notifications stop after the first one is sent. If I restart the app it does the same thing, one notification and then it stops. Not sure if it makes a difference or not, but I'm running DeepStack inside a docker container. When I test the DeepStack connection it comes back with "successfully processed a picture via DeepStack" and the logs indicate the pictures are being processing.

Any thoughts on what might be causing this?

Here is a sample of my log file.

2020.12.29 18:20:18:3734 - On Guard started at: 12/29/2020 6:20:18 PM
2020.12.29 18:20:42:7946 - 0 interesting objects found in file: C:\aiinput\aifrontdoor.20201229_182042288.jpg
2020.12.29 18:20:49:2846 - 3 interesting objects found in file: C:\aiinput\aidriveway.20201229_182048810.jpg
2020.12.29 18:20:49:3136 - Successfully notified URL: in the street
2020.12.29 18:23:50:0168 - 0 interesting objects found in file: C:\aiinput\aifrontdoor.20201229_182349532.jpg
2020.12.29 18:24:31:2966 - 1 interesting objects found in file: C:\aiinput\aidriveway.20201229_182430804.jpg
2020.12.29 18:28:15:2706 - 2 interesting objects found in file: C:\aiinput\aidriveway.20201229_182814802.jpg
2020.12.29 18:32:03:2742 - 1 interesting objects found in file: C:\aiinput\aidriveway.20201229_183202794.jpg
2020.12.29 18:33:17:8710 - 3 interesting objects found in file: C:\aiinput\aidriveway.20201229_183317378.jpg
2020.12.29 18:42:36:0199 - 0 interesting objects found in file: C:\aiinput\aifrontdoor.20201229_184235541.jpg
2020.12.29 18:42:45:2482 - 2 interesting objects found in file: C:\aiinput\aidriveway.20201229_184244777.jpg

-TIA
This might just be a matter of your settings. For each URL/HTTP notification there is a Cooldown time. It defaults to 5 minutes (300 seconds actually). So, once you triggered the notification at 6:20 for the driveway you should not see any further notification for that area, or any other area during the cooldown timeout. The only exception to that timeout is for areas defined as "doors". If the previous area was not a door, and the next area is a door you will get notified/video triggered for the door. However, if the previous area was a door, and this area is a door then the cooldown is in effect.

The purpose of the cooldown is to avoid constantly triggering the URL notification if there is a lot of movement going on. Since I don't know exactly what your cooldown time is set for it is difficult for me to know. You could try setting the cooldown very low (say 10 seconds) and trying again.

Also, take a look at how your areas are defined too. The default is "entry door". Normally you really want that assigned only to doors, but it is up to you. Your driveway should probably defined as a "driveway area", or if it is people it could be "people walking". Right now the only thing special is "entry door"; entry doors have "priority". So for instance if there were people in your driveway you might not want to constantly get video triggers if they were just playing basketball. You would just want the first one. However, if someone triggered your "driveway", and then walked up to your front door, you would definitely want a trigger for the door. If people were walking in and out of your front door (kids, workmen, whatever), you would probably want just the first trigger for the door. That said, you might want the front door cooldown set pretty low.

Don't worry, the situation is even more complicated for email notifications. The reason for that is that email notifications can be more intrusive that simply triggering a camera to start recording.

I will double check tomorrow to see if things are behaving as expected (at least by me!). The time difference between the notification at 6:20 and the activity at 6:42 makes me think that you have hit a real problem. If you have additional information, please add a new post with it.

There is one other "gotcha" that will mess with the cooldown timers, and any other timers that I should probably mention.. When you go into Camera Settings everything is stopped. This is because I can't have timers going off for a camera that may be in the middle of being edited or deleted. This isn't a problem during normal operation because you probably don't need to add/edit/delete cameras that often (almost never). However, during your initial setup/testing process you may be tempted to go in there reasonably often, and that could screw up your testing.
 
Last edited:

Vettester

Getting comfortable
Joined
Feb 5, 2017
Messages
749
Reaction score
706
This might just be a matter of your settings.
The two cameras I have setup are for my front door and my driveway. I left the cooldown for both of them set to the default value of 300 seconds. I defined the front door cam as "entry door" and the driveway cam as "driveway area". I tried lowering the cooldown to 10 seconds for both cameras and restated the app. When I restarted there were unprocessed files in my aiinput directory and the app processed 1 file for each camera and area of interest and then stopped even though some of the files had timestamps of more than 10 seconds apart. I definitely have something misconfigured somewhere. I'll keep playing around to see if I can figure out what's wrong.
 
Top