Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getProfiles error #20

Closed
hauptanja opened this issue Oct 4, 2022 · 10 comments
Closed

getProfiles error #20

hauptanja opened this issue Oct 4, 2022 · 10 comments

Comments

@hauptanja
Copy link

I have a problem with flutter sdk: '>=2.18.0 <3.0.0` on MacOS 12.5.1 when i try to connect to a camera and i call getProfiles:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast #0 _$VideoEncoderConfigurationFromJson (package:easy_onvif/model/video_encoder_configuration.g.dart:15:53) #1 new VideoEncoderConfiguration.fromJson (package:easy_onvif/model/video_encoder_configuration.dart:76:7) #2 _$ProfileFromJson (package:easy_onvif/model/profile.g.dart:23:39) #3 new Profile.fromJson (package:easy_onvif/model/profile.dart:65:7) #4 _$GetProfilesResponseFromJson.<anonymous closure> (package:easy_onvif/model/profiles_response.g.dart:12:31) #5 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31) #6 ListIterator.moveNext (dart:_internal/iterable.dart:342:26) #7 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27) #8 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28) #9 new List.of (dart:core-patch/array_patch.dart:51:28) #10 ListIterable.toList (dart:_internal/iterable.dart:213:44) #11 _$GetProfilesResponseFromJson (package:easy_onvif/model/profiles_response.g.dart:13:12) #12 new GetProfilesResponse.fromJson (package:easy_onvif/model/profiles_response.dart:22:7) #13 _$BodyFromJson (package:easy_onvif/model/body.g.dart:76:33) #14 new Body.fromJson (package:easy_onvif/model/body.dart:201:55) #15 _$EnvelopeFromJson (package:easy_onvif/model/envelope.g.dart:10:18) #16 new Envelope.fromJson (package:easy_onvif/model/envelope.dart:20:7) #17 new Envelope.fromXml (package:easy_onvif/model/envelope.dart:23:16) #18 Soap.retrieveEnvelope (package:easy_onvif/src/soap.dart:67:21) <asynchronous suspension> #19 Media.getProfiles (package:easy_onvif/src/media.dart:45:22)

@faithoflifedev
Copy link
Owner

@hauptanja this is likely due to your camera giving an unexpected response (not following the ONVIF spec). If you enable the debugging functionality within easy_onvif, you can have the response from the camera logged. If you provide the response, and the camera model, I may be able to adjust the code to accommodate the difference.

@hauptanja
Copy link
Author

hauptanja commented Oct 24, 2022

flutter: addOnvifCameraWith >
flutter: connectOnvif
flutter: 👻 11:36:58.779677 INFO     UI Loggy - Onvif - initializing ...
flutter: 🐛 11:36:58.785087 DEBUG    UI Loggy - DeviceManagement - getSystemDateAndTime
flutter: 🐛 11:36:58.806210 DEBUG    UI Loggy - Onvif - URI: http://x.x.x.x/onvif/device_service
flutter: 🐛 11:36:58.806434 DEBUG    UI Loggy - Onvif - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header/><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetSystemDateAndTime xmlns="http://www.onvif.org/ver10/device/wsdl"/></s:Body></s:Envelope>
flutter: 🐛 11:36:58.935959 DEBUG    UI Loggy - Onvif - RESPONSE:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl"><s:Header/><s:Body><tds:GetSystemDateAndTimeResponse><tds:SystemDateAndTime><tt:DateTimeType>NTP</tt:DateTimeType><tt:DaylightSavings>false</tt:DaylightSavings><tt:TimeZone><tt:TZ>GMT+02:00PDT,M1.1.1/00:00:00,M1.1.2/00:00:00</tt:TZ></tt:TimeZone><tt:UTCDateTime><tt:Time><tt:Hour>9</tt:Hour><tt:Minute>36</tt:Minute><tt:Second>58</tt:Second></tt:Time><tt:Date><tt:Year>2022</tt:Year><tt:Month>10</tt:Month><tt:Day>24</tt:Day></tt:Date></tt:UTCDateTime><tt:LocalDateTime><tt:Time><tt:Hour>11</tt:Hour><tt:Minute>36</tt:Minute><tt:Second>58</tt:Second></tt:Time><tt:Date><tt:Year>2022</tt:Year><tt:Month>10</tt:Month><tt:Day>24</tt:Day></tt:Date></tt:LocalDateTime></tds:SystemDateAndTime></tds:GetSystemDateAndTimeResponse></s:Body></s:Envelope>
flutter: 🐛 11:36:58.944626 DEBUG    UI Loggy - DeviceManagement - getServices
flutter: 🐛 11:36:58.960391 DEBUG    UI Loggy - Onvif - URI: http://x.x.x.x/onvif/device_service
flutter: 🐛 11:36:58.960524 DEBUG    UI Loggy - Onvif - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><Security xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1"><UsernameToken><Username>XXXXXX</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">XXXXX=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">XXXXX</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2022-10-24T09:36:58.002111Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetServices xmlns="http://www.onvif.org/ver10/device/wsdl"><IncludeCapability>true</IncludeCapability></GetServices></s:Body></s:Envelope>
flutter: 🐛 11:36:58.997441 DEBUG    UI Loggy - Onvif - RESPONSE:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl"><s:Header/><s:Body><tds:GetServicesResponse><tds:Service><tds:Namespace>http://www.onvif.org/ver10/device/wsdl</tds:Namespace><tds:XAddr>http://x.x.x.x/onvif/device_service</tds:XAddr><tds:Capabilities><tds:Capabilities><tds:Network IPFilter="false" ZeroConfiguration="false" IPVersion6="false" DynDNS="false" Dot11Configuration="false" Dot1XConfigurations="0" HostnameFromDHCP="false" NTP="1" DHCPv6="false"/><tds:Security TLS1.0="false" TLS1.1 ="false" TLS1.2="false" OnboardKeyGeneration="false" AccessPolicyConfig="false" DefaultAccessPolicy="true" Dot1X="false" RemoteUserHandling="false" X.509Token="false" SAMLToken="false" KerberosToken="false" UsernameToken="true" HttpDigest="true" RELToken="false" SupportedEAPMethods="0" MaxUsers="20" MaxUserNameLength="6" MaxPasswordLength="32"/><tds:System DiscoveryResolve="false" DiscoveryBye="true" RemoteDiscovery="false" SystemBackup="false" SystemLogging="true" FirmwareUpgrade="true" HttpFirmwareUpgrade="true" HttpSystemBackup="false" HTTPSystemLogging="false" HTTPSupportInformation="false" StorageConfiguration="false" MaxStorageConfigurations="0" GeoLocationEntries="0"/></tds:Capabilities></tds:Capabilities><tds:Version><tt:Major>20</tt:Major><tt:Minor>06</tt:Minor></tds:Version></tds:Service><tds:Service><tds:Namespace>http://www.onvif.org/ver20/analytics/wsdl</tds:Namespace><tds:XAddr>http://x.x.x.x/onvif/analytics_service</tds:XAddr><tds:Capabilities><tan:Capabilities RuleSupport="true" AnalyticsModuleSupport="true" CellBasedSceneDescriptionSupported="false" RuleOptionsSupported="true" AnalyticsModuleOptionsSupported="false"/></tds:Capabilities><tds:Version><tt:Major>20</tt:Major><tt:Minor>06</tt:Minor></tds:Version></tds:Service><tds:Service><tds:Namespace>http://www.onvif.org/ver20/imaging/wsdl</tds:Namespace><tds:XAddr>http://x.x.x.x/onvif/imaging_service</tds:XAddr><tds:Capabilities><timg:Capabilities ImageStabilization="false" Presets="false"/></tds:Capabilities><tds:Version><tt:Major>19</tt:Major><tt:Minor>06</tt:Minor></tds:Version></tds:Service><tds:Service><tds:Namespace>http://www.onvif.org/ver10/media/wsdl</tds:Namespace><tds:XAddr>http://x.x.x.x/onvif/media_service</tds:XAddr><tds:Capabilities><trt:Capabilities SnapshotUri="true" Rotation="true" VideoSourceMode="true" OSD="true" TemporaryOSDText="false" EXICompression="false"><trt:ProfileCapabilities MaximumNumberOfProfiles="6"/><trt:StreamingCapabilities RTPMulticast="true" RTP_TCP="true" RTP_RTSP_TCP="true" NonAggregateControl="false" NoRTSPStreaming="false"/></trt:Capabilities></tds:Capabilities><tds:Version><tt:Major>20</tt:Major><tt:Minor>06</tt:Minor></tds:Version></tds:Service><tds:Service><tds:Namespace>http://www.onvif.org/ver20/media/wsdl</tds:Namespace><tds:XAddr>http://x.x.x.x/onvif/media2_service</tds:XAddr><tds:Capabilities><tr2:Capabilities SnapshotUri="true" Rotation="true" VideoSourceMode="true" OSD="true" TemporaryOSDText="false" Mask="false" SourceMask="true"><tr2:ProfileCapabilities MaximumNumberOfProfiles="6" ConfigurationsSupported="VideoSource VideoEncoder AudioSource AudioEncoder AudioOutput AudioDecoder Metadata Analytics"/><tr2:StreamingCapabilities RTSPStreaming="true" RTPMulticast="true" RTP_RTSP_TCP="true" NonAggregateControl="false" AutoStartMulticast="false"/></tr2:Capabilities></tds:Capabilities><tds:Version><tt:Major>20</tt:Major><tt:Minor>06</tt:Minor></tds:Version></tds:Service><tds:Service><tds:Namespace>http://www.onvif.org/ver10/events/wsdl</tds:Namespace><tds:XAddr>http://x.x.x.x/onvif/event_service</tds:XAddr><tds:Capabilities><tev:Capabilities WSSubscriptionPolicySupport="true" WSPullPointSupport="true" WSPausableSubscriptionManagerInterfaceSupport="false" MaxNotificationProducers="10" MaxPullPoints="5" PersistenNotificationStorage="false"/></tds:Capabilities><tds:Version><tt:Major>20</tt:Major><tt:Minor>06</tt:Minor></tds:Version></tds:Service><tds:Service><tds:Namespace>http://www.onvif.org/ver10/deviceIO/wsdl</tds:Namespace><tds:XAddr>http://x.x.x.x/onvif/deviceIO_service</tds:XAddr><tds:Capabilities><tmd:Capabilities VideoSources="1" VideoOutputs="0" AudioSources="1" AudioOutputs="1" RelayOutputs="1" SerialPorts="1" DigitalInputs="2" DigitalInputOptions="true"/></tds:Capabilities><tds:Version><tt:Major>19</tt:Major><tt:Minor>06</tt:Minor></tds:Version></tds:Service></tds:GetServicesResponse></s:Body></s:Envelope>
flutter: 🐛 11:36:59.011648 DEBUG    UI Loggy - DeviceManagement - getCapabilities
flutter: 🐛 11:36:59.015394 DEBUG    UI Loggy - Onvif - URI: http://x.x.x.x/onvif/device_service
flutter: 🐛 11:36:59.015559 DEBUG    UI Loggy - Onvif - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header/><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetCapabilities xmlns="http://www.onvif.org/ver10/device/wsdl"><Category>All</Category></GetCapabilities></s:Body></s:Envelope>
flutter: 🐛 11:36:59.041186 DEBUG    UI Loggy - Onvif - RESPONSE:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl"><s:Header/><s:Body><tds:GetCapabilitiesResponse><tds:Capabilities><tt:Analytics><tt:XAddr>http://x.x.x.x/onvif/analytics_service</tt:XAddr><tt:RuleSupport>true</tt:RuleSupport><tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport></tt:Analytics><tt:Device><tt:XAddr>http://x.x.x.x/onvif/device_service</tt:XAddr><tt:Network><tt:IPFilter>false</tt:IPFilter><tt:ZeroConfiguration>false</tt:ZeroConfiguration><tt:IPVersion6>false</tt:IPVersion6><tt:DynDNS>false</tt:DynDNS><tt:Extension><tt:Dot11Configuration>false</tt:Dot11Configuration></tt:Extension></tt:Network><tt:System><tt:DiscoveryResolve>false</tt:DiscoveryResolve><tt:DiscoveryBye>true</tt:DiscoveryBye><tt:RemoteDiscovery>false</tt:RemoteDiscovery><tt:SystemBackup>false</tt:SystemBackup><tt:SystemLogging>true</tt:SystemLogging><tt:FirmwareUpgrade>true</tt:FirmwareUpgrade><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>00</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>10</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>20</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>30</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>40</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>42</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>16</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>18</tt:Major><tt:Minor>06</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>18</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>19</tt:Major><tt:Minor>06</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>19</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>20</tt:Major><tt:Minor>06</tt:Minor></tt:SupportedVersions><tt:Extension><tt:HttpFirmwareUpgrade>true</tt:HttpFirmwareUpgrade><tt:HttpSystemBackup>false</tt:HttpSystemBackup><tt:HttpSystemLogging>false</tt:HttpSystemLogging><tt:HttpSupportInformation>false</tt:HttpSupportInformation></tt:Extension></tt:System><tt:IO><tt:InputConnectors>2</tt:InputConnectors><tt:RelayOutputs>1</tt:RelayOutputs><tt:Extension><tt:Auxiliary>false</tt:Auxiliary><tt:AuxiliaryCommands></tt:AuxiliaryCommands><tt:Extension></tt:Extension></tt:Extension></tt:IO><tt:Security><tt:TLS1.1>false</tt:TLS1.1><tt:TLS1.2>false</tt:TLS1.2><tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration><tt:AccessPolicyConfig>false</tt:AccessPolicyConfig><tt:X.509Token>false</tt:X.509Token><tt:SAMLToken>false</tt:SAMLToken><tt:KerberosToken>false</tt:KerberosToken><tt:RELToken>false</tt:RELToken><tt:Extension><tt:TLS1.0>false</tt:TLS1.0><tt:Extension><tt:Dot1X>false</tt:Dot1X><tt:SupportedEAPMethod>0</tt:SupportedEAPMethod><tt:RemoteUserHandling>false</tt:RemoteUserHandling></tt:Extension></tt:Extension></tt:Security></tt:Device><tt:Events><tt:XAddr>http://x.x.x.x/onvif/event_service</tt:XAddr><tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport><tt:WSPullPointSupport>true</tt:WSPullPointSupport><tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events><tt:Imaging><tt:XAddr>http://x.x.x.x/onvif/imaging_service</tt:XAddr></tt:Imaging><tt:Media><tt:XAddr>http://x.x.x.x/onvif/media_service</tt:XAddr><tt:StreamingCapabilities><tt:RTPMulticast>true</tt:RTPMulticast><tt:RTP_TCP>true</tt:RTP_TCP><tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP></tt:StreamingCapabilities><tt:Extension><tt:ProfileCapabilities><tt:MaximumNumberOfProfiles>6</tt:MaximumNumberOfProfiles></tt:ProfileCapabilities></tt:Extension></tt:Media><tt:Extension><tt:DeviceIO><tt:XAddr>http://x.x.x.x/onvif/deviceIO_service</tt:XAddr><tt:VideoSources>1</tt:VideoSources><tt:VideoOutputs>0</tt:VideoOutputs><tt:AudioSources>1</tt:AudioSources><tt:AudioOutputs>1</tt:AudioOutputs><tt:RelayOutputs>1</tt:RelayOutputs></tt:DeviceIO></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></s:Body></s:Envelope>
flutter: 👻 11:36:59.052839 INFO     UI Loggy - Onvif - initialization complete
flutter: onvif camera connected
flutter: 🐛 11:36:59.053337 DEBUG    UI Loggy - DeviceManagement - getDeviceInformation
flutter: 🐛 11:36:59.056739 DEBUG    UI Loggy - Onvif - URI: http://x.x.x.x/onvif/device_service
flutter: 🐛 11:36:59.056919 DEBUG    UI Loggy - Onvif - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><Security xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1"><UsernameToken><Username>XXXXXX</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">XXXXX=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">XXXXX==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2022-10-24T09:36:58.110007Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetDeviceInformation xmlns="http://www.onvif.org/ver10/device/wsdl"/></s:Body></s:Envelope>
flutter: 🐛 11:36:59.079804 DEBUG    UI Loggy - Onvif - RESPONSE:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl"><s:Header/><s:Body><tds:GetDeviceInformationResponse><tds:Manufacturer>TELEKOMSI</tds:Manufacturer><tds:Model>IPC-K22-TSI</tds:Model><tds:FirmwareVersion>2.800.10LZ004.0.T, Build Date 2021-07-16</tds:FirmwareVersion><tds:SerialNumber>7D018EAPAZ2CE05</tds:SerialNumber><tds:HardwareId>1.00</tds:HardwareId></tds:GetDeviceInformationResponse></s:Body></s:Envelope>
flutter: connectOnvif deviceInfo 
{"Manufacturer":"TELEKOMSI","Model":"IPC-K22-TSI","FirmwareVersion":"2.800.10LZ004.0.T, Build Date 2021-07-16","SerialNumber":"7D018EAPAZ2CE05","HardwareId":"1.00"}
flutter: 🐛 11:36:59.082933 DEBUG    UI Loggy - Media - getProfiles
flutter: 🐛 11:36:59.084428 DEBUG    UI Loggy - Onvif - URI: http://x.x.x.x/onvif/media_service
flutter: 🐛 11:36:59.084533 DEBUG    UI Loggy - Onvif - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><Security xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1"><UsernameToken><Username>XXXXXX</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">XXXXX=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">XXXXX==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2022-10-24T09:36:58.139460Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetProfiles xmlns="http://www.onvif.org/ver10/media/wsdl"/></s:Body></s:Envelope>
flutter: 🐛 11:36:59.118002 DEBUG    UI Loggy - Onvif - RESPONSE:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:trt="http://www.onvif.org/ver10/media/wsdl"><s:Header/><s:Body><trt:GetProfilesResponse><trt:Profiles token="MediaProfile00000" fixed="true"><tt:Name>MediaProfile_Channel1_MainStream</tt:Name><tt:VideoSourceConfiguration token="00000"><tt:Name>VideoSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken><tt:Bounds x="0" y="0" width="2048" height="1536"/><tt:Extension><tt:Rotate><tt:Mode>OFF</tt:Mode></tt:Rotate></tt:Extension></tt:VideoSourceConfiguration><tt:AudioSourceConfiguration token="00000"><tt:Name>AudioSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken></tt:AudioSourceConfiguration><tt:VideoEncoderConfiguration token="00000"><tt:Name>VideoEncoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount></tt:VideoEncoderConfiguration><tt:AudioEncoderConfiguration token="00000"><tt:Name>AudioEncoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>AAC</tt:Encoding><tt:Bitrate>64</tt:Bitrate><tt:SampleRate>16</tt:SampleRate><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.0</tt:IPv4Address></tt:Address><tt:Port>40002</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:AudioEncoderConfiguration><tt:VideoAnalyticsConfiguration token="00000"><tt:Name>AnalyticsConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotion" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"/><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1" y="-1"/><tt:Scale x="0.0062500000000000003" y="0.0083400000000000002"/></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"/><tt:SimpleItem Name="AlarmOnDelay" Value="1000"/><tt:SimpleItem Name="AlarmOffDelay" Value="1000"/><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="/></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:MetadataConfiguration token="00000" CompressionType=""><tt:Name>MetadataConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.2.0.0</tt:IPv4Address></tt:Address><tt:Port>40020</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration><tt:Extension><tt:AudioOutputConfiguration token="00000"><tt:Name>AudioOutputConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:OutputToken>00000</tt:OutputToken><tt:SendPrimacy>www.onvif.org/ver20/HalfDuplex/Auto</tt:SendPrimacy><tt:OutputLevel>50</tt:OutputLevel></tt:AudioOutputConfiguration><tt:AudioDecoderConfiguration token="00000"><tt:Name>AudioDecoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount></tt:AudioDecoderConfiguration></tt:Extension></trt:Profiles><trt:Profiles token="MediaProfile00001" fixed="true"><tt:Name>MediaProfile_Channel1_SubStream1</tt:Name><tt:VideoSourceConfiguration token="00000"><tt:Name>VideoSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken><tt:Bounds x="0" y="0" width="2048" height="1536"/><tt:Extension><tt:Rotate><tt:Mode>OFF</tt:Mode></tt:Rotate></tt:Extension></tt:VideoSourceConfiguration><tt:AudioSourceConfiguration token="00000"><tt:Name>AudioSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken></tt:AudioSourceConfiguration><tt:VideoEncoderConfiguration token="00001"><tt:Name>VideoEncoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H264</tt:Encoding><tt:Resolution><tt:Width>640</tt:Width><tt:Height>480</tt:Height></tt:Resolution><tt:Quality>4.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>25</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>1024</tt:BitrateLimit></tt:RateControl><tt:H264><tt:GovLength>50</tt:GovLength><tt:H264Profile>Main</tt:H264Profile></tt:H264><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.1</tt:IPv4Address></tt:Address><tt:Port>40008</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:AudioEncoderConfiguration token="00001"><tt:Name>AudioEncoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>AAC</tt:Encoding><tt:Bitrate>64</tt:Bitrate><tt:SampleRate>16</tt:SampleRate><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.1</tt:IPv4Address></tt:Address><tt:Port>40010</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:AudioEncoderConfiguration><tt:VideoAnalyticsConfiguration token="00000"><tt:Name>AnalyticsConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotion" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"/><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1" y="-1"/><tt:Scale x="0.0062500000000000003" y="0.0083400000000000002"/></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"/><tt:SimpleItem Name="AlarmOnDelay" Value="1000"/><tt:SimpleItem Name="AlarmOffDelay" Value="1000"/><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="/></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:MetadataConfiguration token="00000" CompressionType=""><tt:Name>MetadataConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.2.0.0</tt:IPv4Address></tt:Address><tt:Port>40020</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration><tt:Extension><tt:AudioOutputConfiguration token="00000"><tt:Name>AudioOutputConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:OutputToken>00000</tt:OutputToken><tt:SendPrimacy>www.onvif.org/ver20/HalfDuplex/Auto</tt:SendPrimacy><tt:OutputLevel>50</tt:OutputLevel></tt:AudioOutputConfiguration><tt:AudioDecoderConfiguration token="00001"><tt:Name>AudioDecoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount></tt:AudioDecoderConfiguration></tt:Extension></trt:Profiles></trt:GetProfilesResponse></s:Body></s:Envelope>
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      _$VideoEncoderConfigurationFromJson (package:easy_onvif/model/video_encoder_configuration.g.dart:15:53)
#1      new VideoEncoderConfiguration.fromJson (package:easy_onvif/model/video_encoder_configuration.dart:76:7)
#2      _$ProfileFromJson (package:easy_onvif/model/profile.g.dart:23:39)
#3      new Profile.fromJson (package:easy_onvif/model/profile.dart:65:7)
#4      _$GetProfilesResponseFromJson.<anonymous closure> (package:easy_onvif/model/profiles_response.g.dart:12:31)
#5      MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#6      ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#7      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#8      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#9      new List.of (dart:core-patch/array_patch.dart:51:28)
#10     ListIterable.toList (dart:_internal/iterable.dart:213:44)
#11     _$GetProfilesResponseFromJson (package:easy_onvif/model/profiles_response.g.dart:13:12)
#12     new GetProfilesResponse.fromJson (package:easy_onvif/model/profiles_response.dart:22:7)
#13     _$BodyFromJson (package:easy_onvif/model/body.g.dart:76:33)
#14     new Body.fromJson (package:easy_onvif/model/body.dart:201:55)
#15     _$EnvelopeFromJson (package:easy_onvif/model/envelope.g.dart:10:18)
#16     new Envelope.fromJson (package:easy_onvif/model/envelope.dart:20:7)
#17     new Envelope.fromXml (package:easy_onvif/model/envelope.dart:23:16)
#18     Soap.retrieveEnvelope (package:easy_onvif/src/soap.dart:67:21)
<asynchronous suspension>
#19     Media.getProfiles (package:easy_onvif/src/media.dart:45:22)
<asynchronous suspension>
#20     OnvifConnectUtil.connectOnvif (package:seifr/utils/OnvifUtil.dart:81:19)
<asynchronous suspension>
#21     CameraUtil.addOnvifCameraWith (package:seifr/utils/CameraUtil.dart:72:21)
<asynchronous suspension>

this camera

@faithoflifedev
Copy link
Owner

Hi @hauptanja,

The info you have provided has allowed me to identify the issue with the code. I'll be publishing an updated version in a few hours.

@hauptanja
Copy link
Author

Thanks a lot!

@faithoflifedev
Copy link
Owner

It took a few tries, but v2.0.13+5 has the fix.

@hauptanja
Copy link
Author

hauptanja commented Oct 27, 2022

I still get the same error...

Unhandled exception:
type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      _$VideoEncoderConfigurationFromJson (package:easy_onvif/src/model/video_encoder_configuration.g.dart:17:50)
#1      new VideoEncoderConfiguration.fromJson (package:easy_onvif/src/model/video_encoder_configuration.dart:76:7)
#2      _$ProfileFromJson (package:easy_onvif/src/model/profile.g.dart:23:39)
#3      new Profile.fromJson (package:easy_onvif/src/model/profile.dart:65:7)
#4      _$GetProfilesResponseFromJson.<anonymous closure> (package:easy_onvif/src/model/profiles_response.g.dart:12:31)
#5      MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#6      ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#7      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#8      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#9      new List.of (dart:core-patch/array_patch.dart:51:28)
#10     ListIterable.toList (dart:_internal/iterable.dart:213:44)
#11     _$GetProfilesResponseFromJson (package:easy_onvif/src/model/profiles_response.g.dart:13:12)
#12     new GetProfilesResponse.fromJson (package:easy_onvif/src/model/profiles_response.dart:21:7)
#13     _$BodyFromJson (package:easy_onvif/src/model/body.g.dart:76:33)
#14     new Body.fromJson (package:easy_onvif/src/model/body.dart:201:55)
#15     _$EnvelopeFromJson (package:easy_onvif/src/model/envelope.g.dart:10:18)
#16     new Envelope.fromJson (package:easy_onvif/src/model/envelope.dart:20:7)
#17     new Envelope.fromXml (package:easy_onvif/src/model/envelope.dart:23:16)
#18     Soap.retrieveEnvelope (package:easy_onvif/src/soap.dart:67:21)
<asynchronous suspension>
#19     Media.getProfiles (package:easy_onvif/src/media.dart:45:22)
<asynchronous suspension>
#20     main (file:///Users/anjahauptman/Documents/Biokoda/easy_onvif/example/example.dart:55:15)
<asynchronous suspension>

@faithoflifedev
Copy link
Owner

faithoflifedev commented Oct 27, 2022

Hi @hauptanja ,

It's actually a different error. It looks like the device you're using isn't properly following the Onvif spec in terms of it's response for video encoder configuration info. Per the spec, Resolution is not an optional field, however your device is not providing that data. The previous error was with the encoding field.

I've made an update to make the field optional, but there are still other video encoder configuration fields that are required that may cause issues, in addition to other configuration elements that the code may be looking for further along in processing the device response.

v2.0.13+6 has been published

@hauptanja
Copy link
Author

hauptanja commented Oct 27, 2022

🐛 17:13:46.703033 DEBUG    UI Loggy - Onvif - RESPONSE:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:trt="http://www.onvif.org/ver10/media/wsdl"><s:Header/><s:Body><trt:GetProfilesResponse><trt:Profiles token="MediaProfile00000" fixed="true"><tt:Name>MediaProfile_Channel1_MainStream</tt:Name><tt:VideoSourceConfiguration token="00000"><tt:Name>VideoSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken><tt:Bounds x="0" y="0" width="2048" height="1536"/><tt:Extension><tt:Rotate><tt:Mode>OFF</tt:Mode></tt:Rotate></tt:Extension></tt:VideoSourceConfiguration><tt:AudioSourceConfiguration token="00000"><tt:Name>AudioSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken></tt:AudioSourceConfiguration><tt:VideoEncoderConfiguration token="00000"><tt:Name>VideoEncoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount></tt:VideoEncoderConfiguration><tt:AudioEncoderConfiguration token="00000"><tt:Name>AudioEncoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>AAC</tt:Encoding><tt:Bitrate>64</tt:Bitrate><tt:SampleRate>16</tt:SampleRate><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.0</tt:IPv4Address></tt:Address><tt:Port>40002</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:AudioEncoderConfiguration><tt:VideoAnalyticsConfiguration token="00000"><tt:Name>AnalyticsConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotion" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"/><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1" y="-1"/><tt:Scale x="0.0062500000000000003" y="0.0083400000000000002"/></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"/><tt:SimpleItem Name="AlarmOnDelay" Value="1000"/><tt:SimpleItem Name="AlarmOffDelay" Value="1000"/><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="/></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:MetadataConfiguration token="00000" CompressionType=""><tt:Name>MetadataConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.2.0.0</tt:IPv4Address></tt:Address><tt:Port>40020</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration><tt:Extension><tt:AudioOutputConfiguration token="00000"><tt:Name>AudioOutputConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:OutputToken>00000</tt:OutputToken><tt:SendPrimacy>www.onvif.org/ver20/HalfDuplex/Auto</tt:SendPrimacy><tt:OutputLevel>50</tt:OutputLevel></tt:AudioOutputConfiguration><tt:AudioDecoderConfiguration token="00000"><tt:Name>AudioDecoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount></tt:AudioDecoderConfiguration></tt:Extension></trt:Profiles><trt:Profiles token="MediaProfile00001" fixed="true"><tt:Name>MediaProfile_Channel1_SubStream1</tt:Name><tt:VideoSourceConfiguration token="00000"><tt:Name>VideoSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken><tt:Bounds x="0" y="0" width="2048" height="1536"/><tt:Extension><tt:Rotate><tt:Mode>OFF</tt:Mode></tt:Rotate></tt:Extension></tt:VideoSourceConfiguration><tt:AudioSourceConfiguration token="00000"><tt:Name>AudioSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>00000</tt:SourceToken></tt:AudioSourceConfiguration><tt:VideoEncoderConfiguration token="00001"><tt:Name>VideoEncoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H264</tt:Encoding><tt:Resolution><tt:Width>640</tt:Width><tt:Height>480</tt:Height></tt:Resolution><tt:Quality>4.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>25</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>1024</tt:BitrateLimit></tt:RateControl><tt:H264><tt:GovLength>50</tt:GovLength><tt:H264Profile>Main</tt:H264Profile></tt:H264><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.1</tt:IPv4Address></tt:Address><tt:Port>40008</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:AudioEncoderConfiguration token="00001"><tt:Name>AudioEncoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>AAC</tt:Encoding><tt:Bitrate>64</tt:Bitrate><tt:SampleRate>16</tt:SampleRate><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.1</tt:IPv4Address></tt:Address><tt:Port>40010</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:AudioEncoderConfiguration><tt:VideoAnalyticsConfiguration token="00000"><tt:Name>AnalyticsConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotion" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="60"/><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1" y="-1"/><tt:Scale x="0.0062500000000000003" y="0.0083400000000000002"/></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="20"/><tt:SimpleItem Name="AlarmOnDelay" Value="1000"/><tt:SimpleItem Name="AlarmOffDelay" Value="1000"/><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="/></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:MetadataConfiguration token="00000" CompressionType=""><tt:Name>MetadataConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.2.0.0</tt:IPv4Address></tt:Address><tt:Port>40020</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration><tt:Extension><tt:AudioOutputConfiguration token="00000"><tt:Name>AudioOutputConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:OutputToken>00000</tt:OutputToken><tt:SendPrimacy>www.onvif.org/ver20/HalfDuplex/Auto</tt:SendPrimacy><tt:OutputLevel>50</tt:OutputLevel></tt:AudioOutputConfiguration><tt:AudioDecoderConfiguration token="00001"><tt:Name>AudioDecoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount></tt:AudioDecoderConfiguration></tt:Extension></trt:Profiles></trt:GetProfilesResponse></s:Body></s:Envelope>


Unhandled exception:
type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      _$VideoEncoderConfigurationFromJson (package:easy_onvif/src/model/video_encoder_configuration.g.dart:20:52)
#1      new VideoEncoderConfiguration.fromJson (package:easy_onvif/src/model/video_encoder_configuration.dart:76:7)
#2      _$ProfileFromJson (package:easy_onvif/src/model/profile.g.dart:23:39)
#3      new Profile.fromJson (package:easy_onvif/src/model/profile.dart:65:7)
#4      _$GetProfilesResponseFromJson.<anonymous closure> (package:easy_onvif/src/model/profiles_response.g.dart:12:31)
#5      MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#6      ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#7      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#8      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#9      new List.of (dart:core-patch/array_patch.dart:51:28)
#10     ListIterable.toList (dart:_internal/iterable.dart:213:44)
#11     _$GetProfilesResponseFromJson (package:easy_onvif/src/model/profiles_response.g.dart:13:12)
#12     new GetProfilesResponse.fromJson (package:easy_onvif/src/model/profiles_response.dart:21:7)
#13     _$BodyFromJson (package:easy_onvif/src/model/body.g.dart:76:33)
#14     new Body.fromJson (package:easy_onvif/src/model/body.dart:201:55)
#15     _$EnvelopeFromJson (package:easy_onvif/src/model/envelope.g.dart:10:18)
#16     new Envelope.fromJson (package:easy_onvif/src/model/envelope.dart:20:7)
#17     new Envelope.fromXml (package:easy_onvif/src/model/envelope.dart:23:16)
#18     Soap.retrieveEnvelope (package:easy_onvif/src/soap.dart:67:21)
<asynchronous suspension>
#19     Media.getProfiles (package:easy_onvif/src/media.dart:45:22)
<asynchronous suspension>
#20     main (file:///Users/anjahauptman/Documents/Biokoda/onvif/easy_onvif/example/example.dart:55:15)
<asynchronous suspension>

@faithoflifedev
Copy link
Owner

v2.0.13+8 (just published) has been tested against the provided XML response, so you should be good with the GetProfilesResponse operation. If there's further errors, pass along the XML response from the debug, and I'll try to make appropriate adjustments.

@hauptanja
Copy link
Author

thanks, it works now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants