OpenALPR Webhook Processor for IP Cameras

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Code:
07/07/2021 19:09:47 +00:00 An exception was thrown attempting to execute the error handler.
07/07/2021 19:09:47 +00:00 HTTP "POST" "/alerts/pushover/test" responded 500 in 9.5164 ms
07/07/2021 19:09:47 +00:00 CORS policy execution successful.
07/07/2021 19:09:47 +00:00 An unhandled exception has occurred while executing the request.
07/07/2021 19:09:47 +00:00 HTTP "POST" "/alerts/pushover/test" responded 500 in 20134.9969 ms
07/07/2021 19:09:47 +00:00 Executed endpoint '"OpenAlprWebhookProcessor.Alerts.AlertsController.UpsertPushover (OpenAlprWebhookProcessor)"'
07/07/2021 19:09:47 +00:00 Executed action "OpenAlprWebhookProcessor.Alerts.AlertsController.UpsertPushover (OpenAlprWebhookProcessor)" in 20059.4047ms
07/07/2021 19:09:47 +00:00 Failed to send alert via Pushover: Resource temporarily unavailable (api.pushover.net:443)
"Resource temporarily unavailable". Interesting...
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
Try creating a new application with a new api key and try again. make sure you save before you test

Being Friendly to our API
When creating an application that will use our API, please consider that your message may not go through for various reasons. We may be having temporary technical difficulties, your application might have exceeded its monthly quota, or the user you are sending to may have deactivated their account.

The key to being friendly to our API is to pay attention to how it responds:

  • If we issue a 200 HTTP response and the status parameter in the JSON/XML body is 1, your notification has been received and queued. Well done.
  • If we issue a 4xx HTTP response, or the status parameter is not 1, your input was invalid. Either your application is over its quota, your token is invalid, a user is no longer active, you are not sending a required parameter, etc. Parse the JSON/XML response, noting the errors array if present, and take the appropriate response for your type of message. The important part is that repeating your same request will not work, no matter how many times you retry it. Your input needs to be changed, you need to purchase additional message capacity for your application, or you need to stop retrying.
  • If we issue a 500 or any other HTTP response, you were unable to connect to our API, or you did not get a reply, it means we are having temporary problems. You can repeat your same request again, but no sooner than 5 seconds from your last request. If we're having temporary difficulties, flooding our servers with repeated requests will just make the problem worse for everyone.
Your application should implement basic rate limiting. Do not send more than 2 concurrent HTTP requests (TCP connections) to our API, or we may do rate limiting on our side which may cause timeouts and refused connections for your IP. To speed up multiple requests, you should send each request in sequence over the same TCP connection using HTTP keep-alive to avoid the overhead of a new TCP connection and TLS negotiation.

If your application fails to act in a sane manner and sends many failed requests that result in 4xx responses within a few minutes, your IP will be automatically blocked for a temporary period. This period is automatically extended if your IP continues to send bad requests after being unblocked.
 

djmadfx

Getting the hang of it
Joined
Sep 29, 2014
Messages
106
Reaction score
19
Code:
07/07/2021 19:09:47 +00:00 An exception was thrown attempting to execute the error handler.
07/07/2021 19:09:47 +00:00 HTTP "POST" "/alerts/pushover/test" responded 500 in 9.5164 ms
07/07/2021 19:09:47 +00:00 CORS policy execution successful.
07/07/2021 19:09:47 +00:00 An unhandled exception has occurred while executing the request.
07/07/2021 19:09:47 +00:00 HTTP "POST" "/alerts/pushover/test" responded 500 in 20134.9969 ms
07/07/2021 19:09:47 +00:00 Executed endpoint '"OpenAlprWebhookProcessor.Alerts.AlertsController.UpsertPushover (OpenAlprWebhookProcessor)"'
07/07/2021 19:09:47 +00:00 Executed action "OpenAlprWebhookProcessor.Alerts.AlertsController.UpsertPushover (OpenAlprWebhookProcessor)" in 20059.4047ms
07/07/2021 19:09:47 +00:00 Failed to send alert via Pushover: Resource temporarily unavailable (api.pushover.net:443)
"Resource temporarily unavailable". Interesting...
I was able to reproduce your 500 error when inputting an invalid User Key and API. It should really be a 4xx error. Not sure why they are using 500.
 
Last edited:

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Deleting the old app and adding a new one didn't change anything. Same 500 error message. If I purposely mistype my API/User key I also get the 500 error.

Its not a big deal and I can live without Pushover to be sure.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
Since I can use your keys successfully it might be related to your IP address, could you try from another network?
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Pushover works with HA (Home Assistant) in another VM on the same host. I have it setup to notify me when people walk onto my driveway (using Frigate) and it works like a charm in HA.

Its a damn mystery.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
Try v3.14.3-alpha7 I added another check to make sure credentials are valid before testing. you'll see in the logs

7/7/2021 11:45:16 PM -04:00 Pushover credential check failed: Validation failed.
7/7/2021 11:45:16 PM -04:00 Pushover credential check failed: {"user":"invalid","errors":["user key is invalid"],"status":0,"request":"asdfasdf-fwer-sd-9bsdf1e-asdffds"}
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Here is the log with the new build:

Code:
07/08/2021 11:16:56 +00:00 An exception was thrown attempting to execute the error handler.
07/08/2021 11:16:56 +00:00 HTTP "POST" "/alerts/pushover/test" responded 500 in 12.0003 ms
07/08/2021 11:16:56 +00:00 CORS policy execution successful.
07/08/2021 11:16:56 +00:00 An unhandled exception has occurred while executing the request.
07/08/2021 11:16:56 +00:00 HTTP "POST" "/alerts/pushover/test" responded 500 in 20098.7686 ms
07/08/2021 11:16:56 +00:00 Executed endpoint '"OpenAlprWebhookProcessor.Alerts.AlertsController.UpsertPushover (OpenAlprWebhookProcessor)"'
07/08/2021 11:16:56 +00:00 Executed action "OpenAlprWebhookProcessor.Alerts.AlertsController.UpsertPushover (OpenAlprWebhookProcessor)" in 20058.4098ms
07/08/2021 11:16:56 +00:00 Pushover credential check failed: Resource temporarily unavailable (api.pushover.net:443)
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
Can you try running the windows version on another computer? if you copy your config folder it should carry over all your settings.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
v3.15.0 is released with preliminary support added for LicensePlateData API. This new feature will re-populate make/model/trim for vehicles that OpenALPR tries to deduce on itself. This will result in much more accurate results on vehicle information, especially at night when the agent's accuracy falls greatly.

Contact Tyler at Free License Plate Lookup | LicensePlateData.com | About and ask for a $15 license. He will email you an API key. If you could please mention my name (mlapaglia), this thread url, or my github repository GitHub - mlapaglia/OpenAlprWebhookProcessor: An OpenALPR Webhook Processor for IP Camera Overlays I would appreciate it

Add your API key to the enricher settings page:
1626964508539.png

Save then test to ensure your key is correct. Back on the plates screen the enrichment button will be enabled:
1626964545571.png
Right now you can only enrich manually, I will be adding automatic enriching in the next release.

I don't have a API key for this resource, so I will need someone to help me test :)
 
Last edited:

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Wow! Very cool. I’ll contact him and give it a try.

How are you handling web access to the web page itself? I have it behind NGINX Reverse Proxy manager but I’d really like to lock it down so that just anyone from the internet can’t access it. Something like a whitelist of ip addresses that can access the web page itself and no one else. I know it’s password protected, but there is no brute force protection.

The issue is that the service that the webhook runs and listens on is the same port that the web page runs on and I can’t whitelist the openalpr servers since I have no idea what they are.

Is it possible to change the web portal port to one that isn’t the same as the webhook listening service? That way we can lock down access to the web portal?
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Well I talked to Tyler. He quoted me $250 a month. I get 3500 plates a week so for that volume he said the Enterprise plan is all I could use. The Pro plan only allows 4000 lookups a month.

So I'll have to pass on that.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
oh.. i thought it was $15/month for unlimited.. well that sucks lol
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Pushover works for me now. I moved the service to another VM and now it’s magically working. So who knows why it didn’t before.
 

Robert G.

Getting comfortable
Joined
Oct 6, 2018
Messages
296
Reaction score
566
Location
North America
Well I talked to Tyler. He quoted me $250 a month. I get 3500 plates a week so for that volume he said the Enterprise plan is all I could use. The Pro plan only allows 4000 lookups a month.

So I'll have to pass on that.

Perhaps you can just stay within the 15 lookup limit. You only need to lookup unknown plates (most people have the same plates over and over). From there you could set a limit of how many per day (throttle it) so you stay under the $15 limit.

I am using an API where I am doing essentially that. I only query the API when I need to, not for every vehicle for example and then throttle my queries to stay under the price limit.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
Perhaps you can just stay within the 15 lookup limit. You only need to lookup unknown plates (most people have the same plates over and over). From there you could set a limit of how many per day (throttle it) so you stay under the $15 limit.

I am using an API where I am doing essentially that. I only query the API when I need to, not for every vehicle for example and then throttle my queries to stay under the price limit.
What API are you using? I can add it to the supported enrichers.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
v3.16.0 will start storing the vehicle image preview. the openalpr agent changed the configuration key for how much storage the agent can use. after i upgraded to the latest agent I lost a years worth of images because it defaulted back to 8GB of storage. The processor will in the future be able to pull these preview images when the client fails to respond or doesn't have the images anymore. they will be lower resolution, but better than nothing!
 
Top