duanemck / ezviz.net

Experimental .net library for interacting with the Ezviz API. Based on the excellent work in https://github.com/BaQs/pyEzviz
MIT License
4 stars 0 forks source link

Failed to buid the docker image #6

Closed rezzalex closed 1 year ago

rezzalex commented 1 year ago

Hello, In order to build the docker image, I have first copied manually the 2 files that are outside the "docker" directory, so that they can be copied in the container.

here is my error message :

image

What did I missed ?

duanemck commented 1 year ago

Hi, the Dockerfile was an experimental thing when I was having issues running the code on my Pi, I never managed to get it working at the time, probably shouldn't have committed it.

But anyway, I'm in the process of setting up a new Pi and I'm trying to run all my services in Docker, so I'll be looking at this a bit more closely soon

rezzalex commented 1 year ago

That is a good news.

I am working with Domoticz and Mosquito in containers and I see here the opportunity to use your mqtt module to fully manage my Ezviz cams from DZ

As a workaround, I have modified a bit the code of the other project you have been inspire by, so that I can received the motion detection events.

What I would like to do in Domoticz as well, is : . Wake up (sleep) a battery cam and then visualize the video flow from DZ, . Receive, store and then send by email the alam photo

duanemck commented 1 year ago

Give this a try https://github.com/duanemck/ezviz.net/wiki/Docker

I couldn't get it to work with the docker run command, it refused to mount the volume (not sure if I configured something incorrectly), but it's working using the sample docker-compose.yml

rezzalex commented 1 year ago

Thank you. It seems I hqve either a Json issue, or a docker "bind" issue :

Here is my logs :

--- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) --- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Program.<Main>$(String[] args) in /src/ezviz-mqtt-systemd/Program.cs:line 4 at Program.<Main>(String[] args) Unhandled exception. System.IO.InvalidDataException: Failed to load configuration from file '/config/appsettings.json'. ---> System.FormatException: Could not parse the JSON file. ---> System.Text.Json.JsonReaderException: ':' is invalid after a single JSON value. Expected end of data. LineNumber: 0 | BytePositionInLine: 9. at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenUntilAfterAllCommentsAreSkipped(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextToken(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenOrRollback(Byte marker) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.JsonDocument.Parse(ReadOnlySpan1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 json, JsonDocumentOptions options) at System.Text.Json.JsonDocument.Parse(String json, JsonDocumentOptions options) at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input) at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.Parse(Stream input) at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) --- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) --- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Program.

$(String[] args) in /src/ezviz-mqtt-systemd/Program.cs:line 4 at Program.
(String[] args) Unhandled exception. System.IO.InvalidDataException: Failed to load configuration from file '/config/appsettings.json'. ---> System.FormatException: Could not parse the JSON file. ---> System.Text.Json.JsonReaderException: ':' is invalid after a single JSON value. Expected end of data. LineNumber: 0 | BytePositionInLine: 9. at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenUntilAfterAllCommentsAreSkipped(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextToken(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenOrRollback(Byte marker) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.JsonDocument.Parse(ReadOnlySpan1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 json, JsonDocumentOptions options) at System.Text.Json.JsonDocument.Parse(String json, JsonDocumentOptions options) at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input) at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.Parse(Stream input) at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) --- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) --- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Program.<Main>$(String[] args) in /src/ezviz-mqtt-systemd/Program.cs:line 4 at Program.<Main>(String[] args) Unhandled exception. System.IO.InvalidDataException: Failed to load configuration from file '/config/appsettings.json'. ---> System.FormatException: Could not parse the JSON file. ---> System.Text.Json.JsonReaderException: ':' is invalid after a single JSON value. Expected end of data. LineNumber: 0 | BytePositionInLine: 9. at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenUntilAfterAllCommentsAreSkipped(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextToken(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenOrRollback(Byte marker) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.JsonDocument.Parse(ReadOnlySpan1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 json, JsonDocumentOptions options) at System.Text.Json.JsonDocument.Parse(String json, JsonDocumentOptions options) at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input) at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.Parse(Stream input) at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) --- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) --- End of inner exception stack trace --- at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Program.
$(String[] args) in /src/ezviz-mqtt-systemd/Program.cs:line 4 at Program.
(String[] args)

and json config file :

"ezviz": { "username": "XXXXX", "password": "YYYYYYY" }, "mqtt": { "host": "192.168.1.XXX", "username": "", "password": "" }

duanemck commented 1 year ago

Oh, that's my mistake in the documentation, you need to enclose the whole thing in { }

So

{
  "ezviz": {
  "username": "XXXXX",
  "password": "YYYYYYY"
  },
  "mqtt": {
  "host": "192.168.1.XXX",
  "username": "",
  "password": ""
  }
}
rezzalex commented 1 year ago

OK, this is working; thanks a lot.