OpenALPR Webhook Processor for IP Cameras

I'm up and running. I'll let it run tonight and give you an update in the morning!
 
So its getting plate information but I'm not seeing any pics. It gives me those "missing picture" icons. The direction indicators are also off. Its showing down on the local page but it really should be pointing right. I have some more that just came across that are pointing up but should be left.


Screenshot from 2021-01-10 21-05-19.png
 
yes my post mentions the things that are broken. look at the URL of the broken image on the left and see if it is the correct URL to get to your agent. it needs to point there to get the image.
 
I was so excited that you released the first version I skipped over the last part of your post where you said you were aware of the bugs!
 
it's whatever port number you have your agent running on. you should be able to open the url in your browser, if it works there it's good.
 
Ok, I guess I'll have to determine what port it is running on. That isn't configurable on my end via their Docker Watchman anywhere I've seen so I don't have a clue what port it is on. I'm guessing I can probably determine it with a docker command that shows incoming ports open to that container.
 
once i start storing the x,y coordinates of the plate i'll be able to get the crop image from the agent and the second image will start working
 
Very exciting! I think this will turn out be the "answer" for those of us that want to store long term LPR data in an easy to retrieve and inspect fashion!
 
So where is that alprd.conf file that is needed to turn the Watchman webserver on with “web_server_enabled = 1” ? Do I need to edit a file inside the container??
 
I exec into the container and added the bottom line to the alprd.conf file:

Code:
root@a267f0c62ea0:/etc/openalpr# more alprd.conf
[daemon]
analysis_threads = 2
company_id = <redacted>
country = us
site_id = unspecified-docker
store_plates = 1
store_plates_location = /var/lib/openalpr/plateimages/
store_plates_maxsize_mb = 8192
store_video = 0
store_video_maxsize_gb = 20
upload_address = https://cloud.openalpr.com/push/
upload_data = 1
websockets_enabled = 1
web_server_enabled = 1

Restarted both your container and the Watchman container, but still can't pull images. If I go directly to the image link in a browser I just get a connection refused...
 
Ok, I figured it out. If I do docker ps I can see my containers running and the ports bound to them. I can also see that Docker is forwarding port 32795 -> the default OpenALPR webserver port of 8355. I can see the images if I substitute the external port of 32795 for port 8355 so I know the werbserver is running and serving images. If I stop the Watchmen, however, the external port changes so I need to pass a port that is hardcoded for the docker run command when the agent starts.

Screenshot from 2021-01-11 12-32-29.png
 
Last edited:
it's just taking a port in from the outside the container and sending it inside, you can change the port number along the way if you want. you could do 8355 -> 8355 if you want. update your appsettings.json with 8355 and it should start working.

if it doesn't, copy the link of the broken image and put it in your browser, you can use that for troubleshooting. mess around with your watchman agent container ports until it starts working

you can also just hit the root url to see the diagnostic message to know the connection is working
1610391549008.png
 
I ended up modfying the Watchman Docker run command and added docker run -p 8355:8355.... That did it! I can see images now!

Its a bit of pain to modify the contents of anything inside of a running container if you've never done it before. Especially with a minimal shell without nano or vi. I had to use echo and append >> to add the variable that turns the webserver on to that alprd.conf file.
 
the service now stores the x,y coordinates for the plate and uses it to construct the crop image url. i have also wired up the pagination so you can go back further than 10 plates in the past.

pull mlapaglia/openalprwebhookprocessor:v2.0.3-alpha to test them out
 
I pulled your alpha and deleted the old container/image, the users.db, and processor.db so I could start fresh. I'm still not seeing the plate crop. Only getting the vehicle crop. Pagination is working properly though. I can go back to as many plates as I've seen so far through testing on the alpha. Here is a log if it helps:

JSON:
{"log":"[13:26:42 WRN] Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.\n","stream":"stdout","time":"2021-01-12T13:26:42.163418463Z"}
{"log":"[13:26:42 INF] User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.\n","stream":"stdout","time":"2021-01-12T13:26:42.163998768Z"}
{"log":"[13:26:43 INF] Entity Framework Core 5.0.1 initialized 'ProcessorContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None\n","stream":"stdout","time":"2021-01-12T13:26:43.106180112Z"}
{"log":"[13:26:43 INF] Executed DbCommand (18ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\n","stream":"stdout","time":"2021-01-12T13:26:43.29803425Z"}
{"log":"SELECT COUNT(*) FROM \"sqlite_master\" WHERE \"name\" = '__EFMigrationsHistory' AND \"type\" = 'table';\n","stream":"stdout","time":"2021-01-12T13:26:43.298099551Z"}
{"log":"[13:26:43 INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\n","stream":"stdout","time":"2021-01-12T13:26:43.339218784Z"}
{"log":"SELECT \"MigrationId\", \"ProductVersion\"\n","stream":"stdout","time":"2021-01-12T13:26:43.339265158Z"}
{"log":"FROM \"__EFMigrationsHistory\"\n","stream":"stdout","time":"2021-01-12T13:26:43.339278009Z"}
{"log":"ORDER BY \"MigrationId\";\n","stream":"stdout","time":"2021-01-12T13:26:43.339287298Z"}
{"log":"[13:26:43 INF] Entity Framework Core 5.0.1 initialized 'UsersContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None\n","stream":"stdout","time":"2021-01-12T13:26:43.628299513Z"}
{"log":"[13:26:43 INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\n","stream":"stdout","time":"2021-01-12T13:26:43.630942139Z"}
{"log":"SELECT COUNT(*) FROM \"sqlite_master\" WHERE \"name\" = '__EFMigrationsHistory' AND \"type\" = 'table';\n","stream":"stdout","time":"2021-01-12T13:26:43.630977339Z"}
{"log":"[13:26:43 INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\n","stream":"stdout","time":"2021-01-12T13:26:43.635682285Z"}
{"log":"SELECT \"MigrationId\", \"ProductVersion\"\n","stream":"stdout","time":"2021-01-12T13:26:43.635717694Z"}
{"log":"FROM \"__EFMigrationsHistory\"\n","stream":"stdout","time":"2021-01-12T13:26:43.635729148Z"}
{"log":"ORDER BY \"MigrationId\";\n","stream":"stdout","time":"2021-01-12T13:26:43.635740043Z"}
{"log":"[13:26:43 INF] Now listening on: http://[::]:80\n","stream":"stdout","time":"2021-01-12T13:26:43.80504156Z"}
{"log":"[13:26:43 INF] Application started. Press Ctrl+C to shut down.\n","stream":"stdout","time":"2021-01-12T13:26:43.808076829Z"}
{"log":"[13:26:43 INF] Hosting environment: Production\n","stream":"stdout","time":"2021-01-12T13:26:43.808189971Z"}
{"log":"[13:26:43 INF] Content root path: /app\n","stream":"stdout","time":"2021-01-12T13:26:43.808370369Z"}
{"log":"[13:27:13 INF] Request starting HTTP/1.1 POST http://605router.mooo.com:3859/webhook application/json 16876\n","stream":"stdout","time":"2021-01-12T13:27:14.00082482Z"}
{"log":"[13:27:14 INF] Executing endpoint 'OpenAlprWebhookProcessor.WebhookProcessor.WebhookController.Post (OpenAlprWebhookProcessor)'\n","stream":"stdout","time":"2021-01-12T13:27:14.269452474Z"}
{"log":"[13:27:14 INF] Route matched with {action = \"Post\", controller = \"Webhook\"}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.ActionResult] Post() on controller OpenAlprWebhookProcessor.WebhookProcessor.WebhookController (OpenAlprWebhookProcessor).\n","stream":"stdout","time":"2021-01-12T13:27:14.374474874Z"}
{"log":"[13:27:14 INF] request received from: ::ffff:35.170.81.143\n","stream":"stdout","time":"2021-01-12T13:27:14.683889461Z"}
{"log":"[13:27:14 INF] adding job for plate: BCRC50\n","stream":"stdout","time":"2021-01-12T13:27:14.692975922Z"}
{"log":"[13:27:14 INF] processing job for plate: BCRC50\n","stream":"stdout","time":"2021-01-12T13:27:14.69380863Z"}
{"log":"[13:27:14 INF] Entity Framework Core 5.0.1 initialized 'ProcessorContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None\n","stream":"stdout","time":"2021-01-12T13:27:14.945012123Z"}
{"log":"[13:27:15 INF] Executed DbCommand (12ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?' (Size = 3568), @p6='?' (Size = 6), @p7='?', @p8='?', @p9='?' (Size = 64), @p10='?' (Size = 28), @p11='?', @p12='?' (Size = 25)], CommandType='Text', CommandTimeout='30']\n","stream":"stdout","time":"2021-01-12T13:27:15.737360552Z"}
{"log":"INSERT INTO \"PlateGroups\" (\"Id\", \"AlertDescription\", \"Confidence\", \"Direction\", \"IsAlert\", \"Jpeg\", \"Number\", \"OpenAlprCameraId\", \"OpenAlprProcessingTimeMs\", \"OpenAlprUuid\", \"PlateCoordinates\", \"ReceivedOnEpoch\", \"VehicleDescription\")\n","stream":"stdout","time":"2021-01-12T13:27:15.737421523Z"}
{"log":"VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12);\n","stream":"stdout","time":"2021-01-12T13:27:15.737444012Z"}
{"log":"[13:27:16 INF] plate saved successfully\n","stream":"stdout","time":"2021-01-12T13:27:16.277611181Z"}
{"log":"[13:27:16 INF] Executing HttpStatusCodeResult, setting HTTP status code 200\n","stream":"stdout","time":"2021-01-12T13:27:16.301175581Z"}
{"log":"[13:27:16 INF] Executed action OpenAlprWebhookProcessor.WebhookProcessor.WebhookController.Post (OpenAlprWebhookProcessor) in 1916.7879ms\n","stream":"stdout","time":"2021-01-12T13:27:16.302501015Z"}
{"log":"[13:27:16 INF] Executed endpoint 'OpenAlprWebhookProcessor.WebhookProcessor.WebhookController.Post (OpenAlprWebhookProcessor)'\n","stream":"stdout","time":"2021-01-12T13:27:16.305619673Z"}
{"log":"[13:27:16 INF] HTTP POST /webhook responded 200 in 2300.4652 ms\n","stream":"stdout","time":"2021-01-12T13:27:16.313598812Z"}
{"log":"[13:27:16 INF] Request finished HTTP/1.1 POST http://<redacted>:3859/webhook application/json 16876 - 200 0 - 2336.7803ms\n","stream":"stdout","time":"2021-01-12T13:27:16.327378277Z"}
{"log":"[13:27:21 INF] clearing expired overlay for: 254963574\n","stream":"stdout","time":"2021-01-12T13:27:21.296878591Z"}
{"log":"[13:27:23 INF] Application is shutting down...\n","stream":"stdout","time":"2021-01-12T13:27:23.937561986Z"}
 

Attachments

  • Screenshot from 2021-01-12 07-19-48.png
    Screenshot from 2021-01-12 07-19-48.png
    4 MB · Views: 8
Last edited: