Full ALPR Database System for Blue Iris!

al
Mmm ok I see. I’ll figure something out to make that work.
Thank you, but it's not a big deal if it's too much of problem. On another note, I can't seem to get the notification page to load properly. It just brings up a blank page. I just reloaded everything (docker compose down and then docker compose up -d) and it does the same thing.

Here's what I'm seeing:

Screen Shot 2024-11-19 at 4.46.39 PM.png
tion

And here's the push notification settings:

Screen Shot 2024-11-19 at 4.50.59 PM.png
 
al

Thank you, but it's not a big deal if it's too much of problem. On another note, I can't seem to get the notification page to load properly. It just brings up a blank page. I just reloaded everything (docker compose down and then docker compose up -d) and it does the same thing.

Here's what I'm seeing:

View attachment 207652tion

And here's the push notification settings:

View attachment 207651

Shouldn't be too much work. It will still require authentication but it will be passed in through the iframe somehow.

The notifications thing is a bug that I didn't catch. If your notifications table is empty it doesn't render the page. What I didn't realize when testing this, since my notification table is not empty, is that this is also telling it not to render the button to add new notifications, making it unusable. I will fix.
 
  • Like
Reactions: Vettester
Thanks for the update, after sleeping on it there is an easer and cleaner way. If you replace &MEMO and &PLATE with @JSON. This will have all the data needed to replace &MEMO and &PLATE. In the JSON there is the api used, if it is alpr then it is a plate and ignore all the other api in the JSON

{ "memo":"T121396C:94%,KYJ5:72%", "Image":"&ALERT_JPEG", "timestamp":"2024-11-19T23:51:19.323Z" }

JSON
[{"api":"alpr","found":{"success":true,"processMs":436,"inferenceMs":354,"predictions":[{"confidence":0.9422435760498047,"label":"Plate: T121396C","plate":"T121396C","x_min":469,"y_min":557,"x_max":614,"y_max":677},{"confidence":0.7209769487380981,"label":"Plate: KYJ5","plate":"KYJ5","x_min":210,"y_min":481,"x_max":295,"y_max":558}],"message":"Found Plate: T121396C, Plate: KYJ5","moduleId":"ALPR","moduleName":"License Plate Reader","code":200,"command":"alpr","requestId":"6a5d387c-807a-47b6-a4f7-17425b934318","inferenceDevice":"GPU","analysisRoundTripMs":633,"processedBy":"localhost","timestampUTC":"Tue, 19 Nov 2024 23:51:20 GMT"}}]

This is good to know, and yes, probably more proper. I will keep it in mind, but using it would require refactoring a whole bunch of code, especially the timestamp stuff, which was a pain in the ass the first time around. The label list solution should work just fine. If you find any bugs, I'll look at converting it.
 
Shouldn't be too much work. It will still require authentication but it will be passed in through the iframe somehow.

The notifications thing is a bug that I didn't catch. If your notifications table is empty it doesn't render the page. What I didn't realize when testing this, since my notification table is not empty, is that this is also telling it not to render the button to add new notifications, making it unusable. I will fix.
One more thing I noticed is that when you use docker compose up -d it generates a new api key within the app so you have to update the HTTP header in the BI web request with the new key.
 
In the docker compose, all you need to do is change the first port to the port you want. It will keep the db in the container running on 5432 and map port 5433 on the machine to 5432 in the container.

Someone else asked this also. I think I’ll add some links to separate setup instructions in the readme for other common systems people might want to deploy on.

Let me know if that works
Hmm for some reason the dashboard is still not connecting to my dashboard. I am on a synology nas using container manager and portainer if that helps?

Error fetching dashboard metrics: Error: Database connection failed: Connection terminated due to connection timeout
at y (/app/.next/server/chunks/600.js:1:5448)
at async C (/app/.next/server/chunks/600.js:155:185)
at async ei (/app/.next/server/chunks/600.js:285:1909)
at async (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:127:1299)
at async rc (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:126:11937)
at async an (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:132:1048)
at async doRender (/app/node_modules/next/dist/server/base-server.js:1568:34)
at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28)
 
Hmm for some reason the dashboard is still not connecting to my dashboard. I am on a synology nas using container manager and portainer if that helps?
Sorry yes you do need to tell it the new address. This could have been done with DB_HOST=db:5433 in the app environment in the compose file.

The easy fix for you is to just navigate to the settings page within the app and enter in db:5433 for the database address.
 
Sorry yes you do need to tell it the new address. This could have been done with DB_HOST=db:5433 in the app environment in the compose file.

The easy fix for you is to just navigate to the settings page within the app and enter in db:5433 for the database address.
Hmm I tried that and no luck. I wonder if something else is going on with it. Take a look at my full config and see if you can see something wrong

Config:

YAML:
services:
  app:
    image: algertc/alpr-dashboard:latest
    restart: unless-stopped
    ports:
      - "3000:3000"  # Change the first port to the port you want to expose
    environment:
      - NODE_ENV=production
      - ADMIN_PASSWORD=12345678  # Change this to a secure password
      - DB_PASSWORD=12345678  # Change this to match your postgres password
    depends_on:
      - db
    volumes:
      - /volume1/docker/alprdashboard/auth:/auth
      - /volume1/docker/alprdashboard/config:/config
  db:
    image: postgres:13
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=12345678  # Change this to a secure password
    volumes:
      - db-data:/var/lib/postgresql/data
      - /volume1/docker/alprdashboard/schema.sql:/docker-entrypoint-initdb.d/schema.sql
    ports:
      - "5433:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  db-data:
  app-auth:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: ./auth
  app-config:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: ./config


Connecting to database at db:5433
Database connection test failed: Error: Connection terminated due to connection timeout
at <unknown> (/app/node_modules/pg-pool/index.js:45:11)
at async y (/app/.next/server/chunks/600.js:1:5140)
at async C (/app/.next/server/chunks/600.js:155:185)
at async ei (/app/.next/server/chunks/600.js:285:1909)
at async (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:127:1299)
at async rc (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:126:11937)
at async an (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:132:1048)
at async doRender (/app/node_modules/next/dist/server/base-server.js:1568:34)
at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
Error getting database pool: Error: Database connection failed: Connection terminated due to connection timeout
at y (/app/.next/server/chunks/600.js:1:5448)
at async C (/app/.next/server/chunks/600.js:155:185)
at async ei (/app/.next/server/chunks/600.js:285:1909)
at async (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:127:1299)
at async rc (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:126:11937)
at async an (/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:132:1048)
at async doRender (/app/node_modules/next/dist/server/base-server.js:1568:34)
at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28)
 
One more thing I noticed is that when you use docker compose up -d it generates a new api key within the app so you have to update the HTTP header in the BI web request with the new key.
Thank you for catching this. The volume mappings in the compose file were wrong. Please delete your config and auth docker volumes, get the newest docker compose file, then docker compose up -d
 
This is good to know, and yes, probably more proper. I will keep it in mind, but using it would require refactoring a whole bunch of code, especially the timestamp stuff, which was a pain in the ass the first time around. The label list solution should work just fine. If you find any bugs, I'll look at converting it.
So far works fine.
 
Hmm I tried that and no luck. I wonder if something else is going on with it. Take a look at my full config and see if you can see something wrong

Config:

YAML:
services:
  app:
    image: algertc/alpr-dashboard:latest
    restart: unless-stopped
    ports:
      - "3000:3000"  # Change the first port to the port you want to expose
    environment:
      - NODE_ENV=production
      - ADMIN_PASSWORD=12345678  # Change this to a secure password
      - DB_PASSWORD=12345678  # Change this to match your postgres password
    depends_on:
      - db
    volumes:
      - /volume1/docker/alprdashboard/auth:/auth
      - /volume1/docker/alprdashboard/config:/config
  db:
    image: postgres:13
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=12345678  # Change this to a secure password
    volumes:
      - db-data:/var/lib/postgresql/data
      - /volume1/docker/alprdashboard/schema.sql:/docker-entrypoint-initdb.d/schema.sql
    ports:
      - "5433:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  db-data:
  app-auth:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: ./auth
  app-config:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: ./config
The other user that had this problem said it worked fine with just that, so I just assumed that worked.

Turns out you do need to add the command: -p 5433 to the compose file.

I'll definitely make directions for this.
 
The other user that had this problem said it worked fine with just that, so I just assumed that worked.

Turns out you do need to add the command: -p 5433 to the compose file.

I'll definitely make directions for this.
Also make sure to get the newest version of the compose file with the correct volume mappings and delete the previous docker volumes for config and auth so your settings persist correctly from now on.
 
Last edited:
Done, but the notification options are still not rendering.
Working for me. Pull the latest version with docker compose pull

For your HA dashboard. You can now do this for your iframe: /dashboard?api_key=yourApiKey


Note that you do have to include /dashboard, but once you hit that page first you can navigate to all the others also.

This would normally be completely insecure, but the whole thing is insecure and using HTTP so it really makes no difference. Hopefully that works for you!
 
the is Awesome, feature request would it be to possible to capture faces just like you doing the plates
My first reaction was not to mix that into all the ALPR stuff, but this does raise a very interesting point. We don't really have a very good way to use the facial recognition either on Blue Iris. Could either integrate it or make a separate app and probably reuse a ton of the code.

I'll definitely think about this.
 
  • Like
Reactions: NoProblems
Working for me. Pull the latest version with docker compose pull
Thanks, the docker compose pull worked so I can now setup pushover notifications.

IMG_3466.jpg


However, the HA dashboard fix didn't work. I still can't get past the login screen.

Screen Shot 2024-11-19 at 7.43.20 PM.png
 
Last edited:
Give it another pull. I verified it's working now.
Happiness... It's working now! Thank you!!

EDIT: @algertc I spoke too soon. The main dashboard loads but none of the other pages will load from the dashboard page. Clicking on any of the options in the left sidebar brings up the password dialog box again.
 
Last edited:
  • Like
Reactions: algertc
Happiness... It's working now! Thank you!!

EDIT: @algertc I spoke too soon. The main dashboard loads but none of the other pages will load from the dashboard page. Clicking on any of the options in the left sidebar brings up the password dialog box again.

Take a look at this thread: Lovelace iFrame card: dynamic url

I've never been too huge on homeassistant, so I'm not the most familiar with the setup there. What we want to do is rewrite your requests with ?api_key=yourapikey at the end. It seems like whatever that thread is talking about should let you do this with these dynamic values.

Give that a try and if it doesn't work out I think an alternative might be just adding an IP based whitelist. This would let you specify the IP of your home assistant machine and let that bypass the auth. Please try to do it with the tool in that thread first though.
 
My first reaction was not to mix that into all the ALPR stuff, but this does raise a very interesting point. We don't really have a very good way to use the facial recognition either on Blue Iris. Could either integrate it or make a separate app and probably reuse a ton of the code.

I'll definitely think about this.
You’re the best! I truly appreciate your response. I believe both facial recognition and the ALPR database are major game changers.
 
  • Like
Reactions: algertc