OpenALPR Webhook Processor for IP Cameras

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
i'm trying to make an android app that can talk to the api to get plates on your phone, i'm a mobile dev noob though.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
also, are the images working on your local openalpr?
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
I didn't see any images (plate nor car) on my local OpenALPR server when I clicked on the plates in the list. Are they supposed to be there? I assumed they were not as that is why I asked if they could be re-created from the base64 code that is sent with the webhook. Are you thinking about pulling the images from the docker Watchman location??

I'm not there at the moment but will check again this afternoon when I get back home.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
The browser uses the on prem openalpr server to talk to the agent to get the images on the fly when you hover over them. we'll need to figure out how it finds the agent to call for images.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
Ahh. That is why there is a small delay when you click on a plate from the cloud server. It has to tunnel a connection back to the local Watchman agent to retrieve the image.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
my uneducated guess is the openalpr server listens to the heartbeat and sees what IP address it is coming from and uses that to request the plates. still need to research it.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
That does make sense because you set the image folder size at the Cloud ALPR server for the local Watchman agent. It defaults to 8GB.

clp.png
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
once i set websockets_enabled = 0 in alprd.conf i am unable to pull back images. i confirmed this in the def query_image_socket(request_data): method in sockets_helper.py
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
So that means they are coming from the Watchman agent then?
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
i always knew they were, just didn't know how. we'll need to find a way to get the on prem openalpr to connect to the agent OpenALPR Watchman — openalpr 2.8.101 documentation
"Users that prefer an on-premise webserver can follow the instructions below to install the Watchman webserver locally. On-premise installations of the Watchman webserver store metadata from each license plate read in a local MySQL database. Full images of the plate captures remain in a rolling buffer on the hard drive where the Agent is installed. "
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
I think you need a commercial license to do that.

Are the plate/vehicle pic converted to base64 and sent in the webook? Can't it be reversed back to the image?
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
yes, the agent can only push to the cloud, but it will probably accept web socket connections from anywhere. i can modify the heartbeat to send any web socket address we want, and the on prem server will make a connection and grab plates. need to test.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
I'm still on the Watchman Commercial trial. I wonder if that allows me to connect to my local ALPR server directly from the agent.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
yes it will, you need to pass in the -w argument when you register your agent for it to register with your on prem server.

It's what I do, only I modified the binary to not check whether my license is valid or not :oops:
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
Alright. When I get home I can do that if it helps you. How and what would we need to capture?
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
506
i was incorrect, the websocket connection comes from the agent, so we can't modify that
INFO Attempting Websockets connection to server
2021-01-07 17:06:50,254 INFO success: beanstalk entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO Received endpoint address wss:/asdf.asdf.com/link
INFO Established connection to: wss:/asdf.asdf.com/link
INFO Using SSL: 1
the easiest way around it would be redirecting cloud.openalpr.com to your local ip.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
The only issue with modifying the hosts file on the agent would be it may mess it up when it calls home to check if the license is valid. Does it use the cloud.openalpr.com to do that?
 

tech101

Known around here
Joined
Mar 30, 2015
Messages
1,474
Reaction score
2,130
Location
SF BayArea, USA
This seems really nice thank you to both of you seems like some of the issues running the local server are all being squared away nice I would have to give it a good read before I try for sure lol.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,563
Reaction score
2,837
If we can forward all the agent traffic to the local server via a simple edit of the hosts file, then that is a game changer.
 
Top