OpenALPR Webhook Processor for IP Cameras

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
507
possibly try that
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
I don't have a valid https cert for it.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
Alright I'll give it another try with https when I get home and make sure that IgnoreSslErrors: true is set.

My Watchman is on the latest Docker version using the standard docker pull openalpr/agent. I wonder why they haven't promoted 2.8.101 to the latest?
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
507
no idea, manually using openalpr/agent:2.8.101 works for me though
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
507
ok, looks like there is one more step, on a fresh install a call needs to be made to create the "company" on the prem site.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
507
ok registration is in there now, you can remove CompanyId from appsettings, i figured out how to get it programmatically during registration. check the appsettings example username/password were adding to the openalprserver object.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
Alright! I'll give it a try when I get home in a bit.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
I must be missing something somewhere. Crashes on start. It may be because my Longitude is a negative number?? Edit: Nope. Changed Longitude to positive number and still crashed.

JSON:
{"log":"Unhandled exception. System.Text.Json.JsonException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.\n","stream":"stderr","time":"2021-01-06T20:07:49.152479816Z"}
{"log":" ---\u003e System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.\n","stream":"stderr","time":"2021-01-06T20:07:49.152551994Z"}
{"log":"   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader\u0026 json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)\n","stream":"stderr","time":"2021-01-06T20:07:49.152559522Z"}
{"log":"   at System.Text.Json.Utf8JsonReader.Read()\n","stream":"stderr","time":"2021-01-06T20:07:49.152564002Z"}
{"log":"   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader\u0026 reader, ReadStack\u0026 readStack)\n","stream":"stderr","time":"2021-01-06T20:07:49.152567941Z"}
{"log":"   --- End of inner exception stack trace ---\n","stream":"stderr","time":"2021-01-06T20:07:49.152572269Z"}
{"log":"   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack\u0026 readStack, JsonReaderException ex)\n","stream":"stderr","time":"2021-01-06T20:07:49.152576122Z"}
{"log":"   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader\u0026 reader, ReadStack\u0026 readStack)\n","stream":"stderr","time":"2021-01-06T20:07:49.152580175Z"}
{"log":"   at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader\u0026 reader)\n","stream":"stderr","time":"2021-01-06T20:07:49.152584295Z"}
{"log":"   at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)\n","stream":"stderr","time":"2021-01-06T20:07:49.152588296Z"}
{"log":"   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)\n","stream":"stderr","time":"2021-01-06T20:07:49.15259216Z"}
{"log":"   at OpenAlprWebhookProcessor.HeartbeatService.AgentRegistration.RegisterAgentAsync(Uri serverUrl, String username, String password, Boolean ignoreSslErrors) in /src/OpenAlprWebhookProcessor/HeartbeatService/Registration/AgentRegistration.cs:line 39\n","stream":"stderr","time":"2021-01-06T20:07:49.152596174Z"}
{"log":"   at OpenAlprWebhookProcessor.HeartbeatService.HeartbeatService.RegisterAgentAsync() in /src/OpenAlprWebhookProcessor/HeartbeatService/HeartbeatService.cs:line 151\n","stream":"stderr","time":"2021-01-06T20:07:49.152600446Z"}
{"log":"   at OpenAlprWebhookProcessor.HeartbeatService.HeartbeatService.StartAsync(CancellationToken cancellationToken) in /src/OpenAlprWebhookProcessor/HeartbeatService/HeartbeatService.cs:line 45\n","stream":"stderr","time":"2021-01-06T20:07:49.152604487Z"}
{"log":"   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)\n","stream":"stderr","time":"2021-01-06T20:07:49.152608554Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)\n","stream":"stderr","time":"2021-01-06T20:07:49.152614428Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)\n","stream":"stderr","time":"2021-01-06T20:07:49.152621063Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)\n","stream":"stderr","time":"2021-01-06T20:07:49.152627606Z"}
{"log":"   at OpenAlprWebhookProcessor.Program.Main(String[] args) in /src/OpenAlprWebhookProcessor/Program.cs:line 21\n","stream":"stderr","time":"2021-01-06T20:07:49.152631555Z"}

Code:
{
  "AllowedHosts": "*",
  "OpenAlprAgent": {
    "Cameras": [
      {
        "Latitude": 11.1111,
        "Longitude": -11.1111,
        "Manufacturer": "Dahua",
        "Name": "abcdefgh",
        "OpenAlprCameraId": 111111111,
        "Password": "password",
        "UpdateOverlayTextUrl": "http://10.200.200.14/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=",
        "Username": "admin"
      }
    ],
    "Hostname": "<redacted>",
    "OpenAlprWebServer": {
      "Endpoint": "http://10.200.200.54",
      "IgnoreSslErrors": true,
      "Username": "user",
      "Password": "pass"
    },
    "Uid": "<redacted>",
    "Version": "2.8.101"
    },
  "ConnectionStrings": {
    "ProcessorContext": "Data Source=config/processor.db"
  },
  "WebRequestLoggingEnabled": false
}
 
Last edited:

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
507
make your endpoint "Endpoint": "http://10.200.200.54",
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
I edited the log. I actually had the /push/ in there before I noticed you had removed it in your new appsettings.json. Above is the new log without the /push at the end.
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
507
yep, the url is used for multiple actions now, not just pushing, so it can't be /push anymore.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
Ok. So the log above is valid when I start up the service using Endpoint": "http://10.200.200.54,. No /push. I don't have a < or > in the appsettings.json.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
Here is my entire appsettings.json:

JSON:
{
  "AllowedHosts": "*",
  "OpenAlprAgent": {
    "Cameras": [
      {
        "Latitude": 11.1111,
        "Longitude": -11.1111,
        "Manufacturer": "Dahua",
        "Name": "<redacted>",
        "OpenAlprCameraId": <redacted>,
        "Password": "<redacted>",
        "UpdateOverlayTextUrl": "http://10.200.200.14/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=",     
        "Username": "admin"
      }
    ],
    "Hostname": "<redacted>",
    "OpenAlprWebServer": {
      "Endpoint": "http://10.200.200.54",
      "IgnoreSslErrors": true,
      "Username": "<redacted>",
      "Password": "<redacted>"
    },
    "Uid": "<redacted>",
    "Version": "2.8.101"
  },
  "ConnectionStrings": {
    "ProcessorContext": "Data Source=config/processor.db"
  },
  "WebRequestLoggingEnabled": false
Here is the log when starting it with those settings:

JSON:
{"log":"Unhandled exception. System.Text.Json.JsonException: The input does not contain any JSON tokens. Expected the input to start with a val
id JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.\n","stream":"stderr","time":"2021-01-06T20:17:48.012
202011Z"}
{"log":" ---\u003e System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid J
SON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.\n","stream":"stderr","time":"2021-01-06T20:17:48.012257906Z"}
{"log":"   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader\u0026 json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)\n","stream":"stderr","time":"2021-01-06T20:17:48.012265914Z"}
{"log":"   at System.Text.Json.Utf8JsonReader.Read()\n","stream":"stderr","time":"2021-01-06T20:17:48.01227059Z"}
{"log":"   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader\u0026 reader, ReadStack\u0026 readStack)\n","stream":"stderr","time":"2021-01-06T20:17:48.012274836Z"}
{"log":"   --- End of inner exception stack trace ---\n","stream":"stderr","time":"2021-01-06T20:17:48.01228148Z"}
{"log":"   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack\u0026 readStack, JsonReaderException ex)\n","stream":"stderr","time":"2021-01-06T20:17:48.012288289Z"}
{"log":"   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader\u0026 reader, ReadStack\u0026 readStack)\n","stream":"stderr","time":"2021-01-06T20:17:48.012301911Z"}
{"log":"   at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader\u0026 reader)\n","stream":"stderr","time":"2021-01-06T20:17:48.012312052Z"}
{"log":"   at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)\n","stream":"stderr","time":"2021-01-06T20:17:48.012316678Z"}
{"log":"   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)\n","stream":"stderr","time":"2021-01-06T20:17:48.012320688Z"}
{"log":"   at OpenAlprWebhookProcessor.HeartbeatService.AgentRegistration.RegisterAgentAsync(Uri serverUrl, String username, String password, Boolean ignoreSslErrors) in /src/OpenAlprWebhookProcessor/HeartbeatService/Registration/AgentRegistration.cs:line 39\n","stream":"stderr","time":"2021-01-06T20:17:48.012325024Z"}
{"log":"   at OpenAlprWebhookProcessor.HeartbeatService.HeartbeatService.RegisterAgentAsync() in /src/OpenAlprWebhookProcessor/HeartbeatService/HeartbeatService.cs:line 151\n","stream":"stderr","time":"2021-01-06T20:17:48.012331039Z"}
{"log":"   at OpenAlprWebhookProcessor.HeartbeatService.HeartbeatService.StartAsync(CancellationToken cancellationToken) in /src/OpenAlprWebhookProcessor/HeartbeatService/HeartbeatService.cs:line 45\n","stream":"stderr","time":"2021-01-06T20:17:48.012340046Z"}
{"log":"   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)\n","stream":"stderr","time":"2021-01-06T20:17:48.012346433Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)\n","stream":"stderr","time":"2021-01-06T20:17:48.012354573Z"}
{"log":"   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)\n","stream":"stderr","time":"2021-01-06T20:17:48.012361331Z"}
 

mlapaglia

Getting comfortable
Joined
Apr 6, 2016
Messages
849
Reaction score
507
This might be an issue with the response when it tries to register..
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,614
Reaction score
2,932
Its there. I just missed it when I copy-pasted.
 
Top