faithoflifedev / easy_onvif_workspace

This package works with a variety of ONVIF compatible devices allowing for IP Cameras and NVRs (network video recorders) to be integrated into Dart and Flutter applications.
32 stars 19 forks source link

Can't get token #11

Closed anhthoai closed 2 years ago

anhthoai commented 2 years ago

Hello, I test your library with this: `var onvif = Onvif(host: '192.168.1.11', username: 'admin', password: 'admin@123456'); await onvif.initialize(); var deviceInfo = await onvif.deviceManagement.getDeviceInformation(); print(deviceInfo.model);

var profiles = await onvif.media.getProfiles(); profiles.forEach((element) { print(element.name + ' ' + element.token); }); var profileToken = profiles[0].token; print(profileToken); `

But I get this error, could you please have a look? `C:/flutter/bin/cache/dart-sdk/bin/dart.exe --enable-asserts C:\development\easy_onvif\test\onvif_test.dart IPC-B122-PF28 Unhandled exception: Exception: Error code: {Code: {Value: {$: SOAP-ENV:Receiver}, Subcode: {Value: {$: ter:ActionNotSupported}}}, Reason: {Text: {@xml:lang: en, $: Optional Action Not Implemented}}, Detail: {}}

0 Soap.send (package:easy_onvif/src/soap.dart:29:11)

#1 Soap.retrieveEnvlope (package:easy_onvif/src/soap.dart:42:26) #2 Media.getProfiles (package:easy_onvif/src/media.dart:35:22) #3 main (file:///C:/development/easy_onvif/test/onvif_test.dart:15:18) `
faithoflifedev commented 2 years ago

Hi @anhthoai ,

The error you provided shows that the "getProfiles" method is not implemented on your device.

I've just published easy_onvif 1.0.0-dev.2, which does not use "getProfiles" as part of the initialization after connecting to the device. Let me know if this updated package works for your device.

faithoflifedev commented 2 years ago

Hi @anhthoai , I believe I have this resolved with v1.0.2