Full ALPR Database System for Blue Iris!

View attachment 213722

Same issue, docker daemon not detected.

I deleted my first reply because I thought you were using WSL at first.

If you're using sudo to run docker you need to give the sudo to the bash command at the end like this:

Code:
curl -sSL https://raw.githubusercontent.com/algertc/ALPR-Database/main/install.sh | sudo bash


I will update the readme and separate out the linux section to indicate that.
 
I deleted my first reply because I thought you were using WSL at first.

If you're using sudo to run docker you need to give the sudo to the bash command at the end like this:

Code:
curl -sSL https://raw.githubusercontent.com/algertc/ALPR-Database/main/install.sh | sudo bash


I will update the readme and separate out the linux section to indicate that.
That part work, however, now I'm stuck. It asked for time zone immediately but it didn't let me answer even if I press they key continuously.

I restored from my backup, waiting for your next step.

Thanks.

1738844407080.png
1738844333847.png
 
Last edited:
Oh man, I don't know how I missed this thread... This looks awesome. I am currently using the LPR data to send via MQTT to Homeseer to control my garage door.

I tried launching the following docker-compose on my Ubuntu machine... (docker-compose 1.29.2)


I saw some issues with the Timezones and the top line-- so I deleted them. I also had an issue with the name at the top....

mike@ubuntu22:~/Docker/alprDatabase$ docker-compose up
alprdatabase_db_1 is up-to-date
Creating alprdatabase_app_1 ... error

ERROR: for alprdatabase_app_1 Cannot create container for service app: failed to populate volume: error while mounting volume '/var/lib/docker/volumes/alprdatabase_app-plate_images/_data': failed to mount local volume: mount /home/mike/Docker/alprDatabase/storage:/var/lib/docker/volumes/alprdatabase_app-plate_images/_data, flags: 0x1000: no such file or directory

ERROR: for app Cannot create container for service app: failed to populate volume: error while mounting volume '/var/lib/docker/volumes/alprdatabase_app-plate_images/_data': failed to mount local volume: mount /home/mike/Docker/alprDatabase/storage:/var/lib/docker/volumes/alprdatabase_app-plate_images/_data, flags: 0x1000: no such file or directory
ERROR: Encountered errors while bringing up the project.
 
Oh man, I don't know how I missed this thread... This looks awesome. I am currently using the LPR data to send via MQTT to Homeseer to control my garage door.

I tried launching the following docker-compose on my Ubuntu machine... (docker-compose 1.29.2)


I saw some issues with the Timezones and the top line-- so I deleted them. I also had an issue with the name at the top....

mike@ubuntu22:~/Docker/alprDatabase$ docker-compose up
alprdatabase_db_1 is up-to-date
Creating alprdatabase_app_1 ... error

ERROR: for alprdatabase_app_1 Cannot create container for service app: failed to populate volume: error while mounting volume '/var/lib/docker/volumes/alprdatabase_app-plate_images/_data': failed to mount local volume: mount /home/mike/Docker/alprDatabase/storage:/var/lib/docker/volumes/alprdatabase_app-plate_images/_data, flags: 0x1000: no such file or directory

ERROR: for app Cannot create container for service app: failed to populate volume: error while mounting volume '/var/lib/docker/volumes/alprdatabase_app-plate_images/_data': failed to mount local volume: mount /home/mike/Docker/alprDatabase/storage:/var/lib/docker/volumes/alprdatabase_app-plate_images/_data, flags: 0x1000: no such file or directory
ERROR: Encountered errors while bringing up the project.

If you aren’t going to use the install script / it isn’t working for you right now, please check the linked manual install instructions in the readme. There are a couple other steps you need to do.

What was the timezone issue?
 
mike@ubuntu22:~/Docker/alprDatabase$ docker-compose up -d
ERROR: The Compose file './docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see Compose file reference

I commented out line one:

mike@ubuntu22:~/Docker/alprDatabase$ docker-compose up -d
Creating network "alprdatabase_default" with the default driver
ERROR: Configuration for volume app-plate_images specifies "device" driver_opt /home/mike/Docker/alprDatabase/storage 68,7 Top, but a volume with the same name uses a different "device" driver_opt (/home/mike/Docker/alprDatabase/storage). If you wish to use the new configuration, please remove the existing volume "alprdatabase_app-plate_images" first:
$ docker volume rm alprdatabase_app-plate_images
mike@ubuntu22:~/Docker/alprDatabase$

The timezone issue complained about the back slash in the time zone.


I have another machine with Rock Linux (Redhat) and that one is fine with the Docker compose as is but throws the error above. I'll look at the manual when I get back.
 
Is there a way to get a dedicated sub-forum for this thread? It would make things a little easier to find.

Does anyone know a clean way to backup and restore the database? I am trying to move the install from one machine to another. I can get a new instance up with an empty database. I've tried dumping the database with docker exec ... /usr/bin/pg_dump -U postgres postgres and I get the dump, move it over to the other machine, and do docker exec alprdash-db-1 psql -U postgres -d postgres -f /backups/postgres-backup.sql

When I restart it, it looks pretty wonky--all the tags are gone, the images (copied over into the storage directory) do not show up, etc.

Would appreciate some pointers, databases and I aren't friend. :)

Thanks
 
mike@ubuntu22:~/Docker/alprDatabase$ docker-compose up -d
ERROR: The Compose file './docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see Compose file reference

I commented out line one:

mike@ubuntu22:~/Docker/alprDatabase$ docker-compose up -d
Creating network "alprdatabase_default" with the default driver
ERROR: Configuration for volume app-plate_images specifies "device" driver_opt /home/mike/Docker/alprDatabase/storage 68,7 Top, but a volume with the same name uses a different "device" driver_opt (/home/mike/Docker/alprDatabase/storage). If you wish to use the new configuration, please remove the existing volume "alprdatabase_app-plate_images" first:
$ docker volume rm alprdatabase_app-plate_images
mike@ubuntu22:~/Docker/alprDatabase$

The timezone issue complained about the back slash in the time zone.


I have another machine with Rock Linux (Redhat) and that one is fine with the Docker compose as is but throws the error above. I'll look at the manual when I get back.

I think the name option has been deprecated. I just removed it.

Did you try deleting the old volume like it says?

Where was there a backslash in the time zone?
 
Is there a way to get a dedicated sub-forum for this thread? It would make things a little easier to find.

Does anyone know a clean way to backup and restore the database? I am trying to move the install from one machine to another. I can get a new instance up with an empty database. I've tried dumping the database with docker exec ... /usr/bin/pg_dump -U postgres postgres and I get the dump, move it over to the other machine, and do docker exec alprdash-db-1 psql -U postgres -d postgres -f /backups/postgres-backup.sql

When I restart it, it looks pretty wonky--all the tags are gone, the images (copied over into the storage directory) do not show up, etc.

Would appreciate some pointers, databases and I aren't friend. :)

Thanks

I would copy the contents of the storage, config, and auth directories and set up a new one as you would from scratch other than copying those files. Then, you can use pgadmin to connect to the old database and generate a backup. You can then connect to the new empty database and restore that backup.
 
  • Like
Reactions: PeteJ
I would copy the contents of the storage, config, and auth directories and set up a new one as you would from scratch other than copying those files. Then, you can use pgadmin to connect to the old database and generate a backup. You can then connect to the new empty database and restore that backup.

Thanks, I'll give that a shot.
 
  • Like
Reactions: algertc
Ok.... I finally put some time into this and got it working. Lots of errors on my end. I was just copying the docker-compose.yml and creating the config, storage and auth directories... I wasn't pulling the whole github with the sql files. So what I ended up doing.

1. Moving to my RH linux box with docker 27.4. 26.1 was on my Ubuntu box and it didn't like the compose file as was.
2. Cloned the Github and modified the passwords on the docker-compose file. I got rid of the TZ and let it use the current one.
3. Deleted the volumes.

docker volume rm alpr-database_app-auth
docker volume rm alpr-database_app-config
docker volume rm alpr-database_app-plate_images
docker volume rm alpr-database_db-data

4. docker compose up -d
5. Configured BI with my token and website on the BI side.

Worked like a charm. Very well done. I have been thinking about something like this for a while but my data base skills are lacking.

I have one issue... The photos I am getting from BI don't seem to the ones that show the plate. They seem early. I imagine that is an error on the BI side.

I also want to play with known plates... I am currently reading the plates into Homeseer with MQTT. There I am identifying my wife's car but found that I had to use regular expressions to probably identify it. For example, say her plate was DEF 7B5. Often Codeproject AI would identify it as DEF 785, or ZBS, or some combination of those things.

I used the motion direction and the regular expression to open/close the garage door.

DEF ?[7Z][B8][5S]

I am wondering if there would be a way to put things like this into a similar box..

Now that I know it works, I'll probably get the docker-compose.yml working on my Ubuntu server as that is a more reliable machine.

plate-2R89PT.jpg
 
If you aren’t going to use the install script / it isn’t working for you right now, please check the linked manual install instructions in the readme. There are a couple other steps you need to do.

What was the timezone issue?
If I have an existing installation that I want to update to the latest, do I just download the latest docker-compose.yml and schema.sql, and then compose down, compose pull, and compose up -d?

Thanks!
 
In BI under Camera settings | Trigger | Motion sensor (Configure) | Use zones and hot spot (Edit...). This only masks the area so triggers will not occur in the masked area. Your timestamp will still be included in images/video.

View attachment 213710
I thought that only controlled when BI gets triggered, and not the image(s) that BI sends to CPAI. Or does it mask the images that get sent to CPAI?
 
Still happily taking feature requests on the roadmap page also. Will get to them all soon along with reading back through the forum posts.
Apologies if this has been discussed before--I don't see any prior mention of it--but what are the possible routes to integration with UI3?

Could the database be served up as a new "tab" in UI3? I'd be interested in ways to make this available to other users without having to expose another port, e.g. somehow present the page via UI3 so that we can re-use UI3's existing users and access control. Thanks!
 
I thought that only controlled when BI gets triggered, and not the image(s) that BI sends to CPAI. Or does it mask the images that get sent to CPAI?
It only controls when BI gets triggered but, from your example, a snapshot is being triggered from the "PM" in your timestamp.
 
Hey guys. What’s the best way to send plate name over to Home Assistant ?

I’ve accumulated a decent set of plates with known people in the database with saved names associated with these plates. Would like to send plate name real time to HA for announcements.
 
What’s the best way to send plate name over to Home Assistant ?
I would suggest using MQTT. If all you want to capture is a single plate you could setup a simple MQTT alert in BI using a payload of {"&PLATE"}.

Screen Shot 2025-02-10 at 9.14.55 PM.png


Then create a sensor in your config.yaml file

Code:
mqtt:
   sensor:
      - name: "Westbound Last Plate"
        state_topic: "BLUE-IRIS/Last_Plate"

The sensor will then display the last plate captured.

Screen Shot 2025-02-10 at 9.26.42 PM.png
 
Last edited:
I would suggest using MQTT. If all you want to capture is a single plate you could setup an a simple MQTT alert in BI using a payload of {"&PLATE"}.

View attachment 214197

Then create a sensor in your config.yaml file

Code:
mqtt:
   sensor:
      - name: "Westbound Last Plate"
        state_topic: "BLUE-IRIS/Last_Plate"

The sensor will then display the last plate captured.

View attachment 214199

Thanks but I don't want the plate sent. I want the learned name that is associated with the plate in ALPR database sent. So I need to be able to send from ALPR program and not from Blue Iris.

@algertc : is this an option that is currently available? If not can I request it for future releases?