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:
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")
 
That is the plan - kinda LOL. Each TPMS has an unique identifier, that way if they remove the plates, you still have identifying info!
Shhh!!! Don't tell the bad guys!
 
Shhh!!! Don't tell the bad guys!
This is part of what’s so nice about this though. Even if u were to have the most sophisticated criminals who are somehow aware that you’re doing this, what are they gonna do? Go to a tire shop and get all their wheels taken off and have them removed?

I can just imagine how pissed off I would be if I were a thief who took my plate off thinking I was being careful then got arrested because of my tires lmao.
 
It has been 95% done for a couple weeks. I couldn't get Mike's ALPR code to work on my machine and was trying to troubleshoot that off and on. Finally figured it out yesterday. All I had to do was add some extra Python imports.

Now that I have it working, I can get the data I need from the module to finish the image processing for training.

I have a couple of other projects that I need to get finished soon, so it might still be a week or two before it's fully ready.
 
  • Like
Reactions: hopalong and PeteJ
It has been 95% done for a couple weeks. I couldn't get Mike's ALPR code to work on my machine and was trying to troubleshoot that off and on. Finally figured it out yesterday. All I had to do was add some extra Python imports.

Now that I have it working, I can get the data I need from the module to finish the image processing for training.

I have a couple of other projects that I need to get finished soon, so it might still be a week or two before it's fully ready.

Nice! I'm up to maybe 6000 or so plates now, and I'm looking forward to better OCR. I find myself repeatedly correct the same OCR errors over and over.
 
  • Like
Reactions: algertc
Yes. Secondary form of PII to store in the database so you can still identify vehicles if they remove their license plate.

Little POE box you can run out to the street. Needs to be as close as possible.

I have a Raspberry Pi with a RTL SDR in my attic with the antenna up as high as possible. I suppose I could get a second one and use a Raspberry Pi I just decommissioned. I could probably get it pretty damn close to the street-- but the problem here in New England would be the plows. Lots of people mailboxes get taken out every winter-- having a box with an antenna anywhere within 3 feet of the road is bound to get destroyed by a wall of snow.

How close are we talking here? What about something like a can antenna that is unidirectional? I do have a utility pole in my yard that the plows steer clear of. I don't know what the power company would think of me mounting a box to it?
 
Ok- last night I was telling my wife how a bunch of nerds on this forum were trying to read tire pressure data off of the cars on the street in addition to the plates. We had a good laugh making fun of you all....

Now, I just installed rtl_433 on my SDR raspberry Pi and I am now reading some Hyundai TPMS on my street. My neighbor has one but I don't even see it in their driveway.

I am all in on the TPMS.

Apparently, one of my neighbors has a ThermoPro meat thermometer as well!
 
  • Like
Reactions: TheWaterbug
Ok- last night I was telling my wife how a bunch of nerds on this forum were trying to read tire pressure data off of the cars on the street in addition to the plates. We had a good laugh making fun of you all....

Now, I just installed rtl_433 on my SDR raspberry Pi and I am now reading some Hyundai TPMS on my street. My neighbor has one but I don't even see it in their driveway.

I am all in on the TPMS.

Apparently, one of my neighbors has a ThermoPro meat thermometer as well!

OMFG that is incredible! The ability to read TPMS without being at the street is a game changer.

Can you post what you are seeing - like only tire pressure or are you getting an unique identifier?
 
Apparently, one of my neighbors has a ThermoPro meat thermometer as well!
LOL!!!

If you see it go over 140º, go over and shame him!!!! Unless he's making brisket.
 
  • Like
Reactions: Skinny1 and wpiman