Full ALPR Database System for Blue Iris!

Hi, @smallik

You're very close. This seems like a very minor issue with the database schema, which is what defines how the tables and columns are structured.

The error is stating that there is a relation missing. Normally, this should be created automatically and should exist in the migrations.sql file.

It is possible that the install script didn't properly get the file it needs, so we should be able to resolve this by downloading the file and just restarting the container.


Here is the file you need: migrations.sql

Download it and place it in the same location as the docker-compose.yml file and the schema.sql. If you already have one, you can just replace it.

After this, restart the containers. You may be able to do this with the restart button in Docker desktop, but please try with the command line, as we know that works.


Code:
docker compose down
docker compose up -d


This should automatically apply the proper database configuration and it should start working.


edit re:


You run this in the same directory where your docker-compose.yml file is stored. So for example, if you made the directory for it at C:\users\youruser\ALPR_database , you would open a powershell and type:

Code:
cd C:\users\youruser\ALPR_database

Then run the commands
Very clear instructions. I've made the changes. I don't have night cameras on line yet so it will be tomorrow morning that I hope I wake up to a screen full of images, graphs, and plate data. Thanks much for your guidance.
 
  • Like
Reactions: algertc
Drat! I should have spoken up louder and saved a lot of time:
 
Yep, right on, as usual. The below is also very helpful to me for writing the troubleshooting page. Docs are almost finished. Not likely to add any value for anyone who has been following along, but should be much better for new users. Can serve as a reference too.

I'm also going to record two new install videos (linux/windows) once they're finished and embed them in the install guide pages. Probably will end up being like 60 seconds long with the install scripts, but it's always nice to have a visual to know you're doing it right.

Check things in this order:
1) Confirm plates are being recognized on the BI console (done)
2) Confirm the call from BI is being made when a plate is detected. (check the BI log to confirm the call is happening. The return code should be 200.
3) If you are seeing errors confirm the IP address of the ALPR DB is correct. Personally since mine is running on the BI machine so I just used localhost:3000 rather than having to specify it explicitly. If it is on a separate machine, confirm there aren't firewall rules preventing access from BI. Try a ping. If the error indicates a security error, verify the API key is correct.
4) If it is reaching the DB, check the logs. I think it's the second to last icon on the left. Check your database password matches what you setup initially and that it is reading the DB.
5) If the call is going through, maybe the fields you are sending aren't fully correct. Can you copy/paste the full post/payload field? For one, I see you are using the Plate call (one plate) but you can use the label call if there are multiple plates being detected by the ALPR module. Are you sending the clip fields?
 
@smallik Upon closer inspection of your log screenshot, the fact that it's complaining about tags being missing doesn't track with the issue being caused by just the migrations file missing. I'm thinking that may not quite fix it.

I don't really understand how this happened the first time around if you used the install script since it is supposed to check all of these things to make sure that things like this don't happen.

I looked back through the code to see if any changes could have caused the error, and it looks ok to me. It's possible that the connection could have dropped halfway through the download when you originally installed, which caused it to only write a partial file for the schema.sql. A pretty rare situation, but possible, and the only explanation I can think of. I can see from my metrics that other recent installs have worked fine.

Docker containers store data in special locations called Docker volumes. It's possible that reinstalling Docker didn't remove the original database volume, causing the error to persist despite your fresh install of the alpr database.


My new recommendation to you is the following (you should be able to do all of this in the Docker Desktop GUI):

1) Turn off/shut down the containers with the little square button. It may take a few seconds for them to shut down.
2) Delete the containers with the trashcan
3) Navigate to the volumes tab in the left navbar. Delete all of the volumes.
4) Now, we should have a clean slate and you should be able to open powershell and run docker compose up -d from the directory where your files are placed, just like before.



I completely agree, even as a frequent user, that setting up elaborate Docker Compose apps can be daunting because you kind of have to get familiar with the configuration for each specific app, but it's really not as bad as it looks. Also, while less intuitive to install with Docker, it's infinitely more flexible and reliable once you have it going. It keeps everything isolated and standardized so it can live in its own world and handle any issues or failures on its own without you ever having to mess with it.

I'm happy to help in PM if somehow it's still complaining after that.
 
Last edited:
  • Love
Reactions: VideoDad
I've been thinking about the TPMS solution, and I think I have a significantly better approach. I consulted a friend with more electronics expertise to ask about making something a bit more custom, and this seems like the way.

The last thing I tried was 2x RTL-SDRs w a Raspberry Pi and a POE hat. Felt like kind of a heavy-handed solution, is sort of expensive for what it is, generates a ton of heat, not very feasible to power with solar, and is prone to SDR inaccuracy.


Here's a rough idea of what I'm thinking instead:



Would be super tiny with minimal heat and very sensitive. Looks like about $30-50 with nice parts. At that price, I'm wondering if maybe I should try a double setup at both ends of the yard for maximum capture probability.


Picture something like this, but fully enclosed and with more rudimentary controls...

1741850164273.png
 
algertc, so, after your post# 660, I did nothing else but follow those instructions. I woke up this morning and after the sun started to illuminate the road, my system began to catch fish (I mean license plates). Yahoo! Before I do anything else, I'm going to save an image of the hard drive so I'll always have a recovery point once I start banging around on things. Thanks so much for the help. One quick question: Is there an option for the ALPR Database to auto refresh if I'm just sitting on the license plate dashboard?
 
algertc, so, after your post# 660, I did nothing else but follow those instructions. I woke up this morning and after the sun started to illuminate the road, my system began to catch fish (I mean license plates). Yahoo! Before I do anything else, I'm going to save an image of the hard drive so I'll always have a recovery point once I start banging around on things. Thanks so much for the help. One quick question: Is there an option for the ALPR Database to auto refresh if I'm just sitting on the license plate dashboard?
Not for the dashboard, but there is on the next tab down on the ALPR Recognition Feed (aka "Live Feed")