Closed TheDizzyEgg closed 1 year ago
Hello @TheDizzyEgg,
Do you have some sample code for the onvif operations you are doing?
This is the most basic example:
void main(List
print('Hello world: ${dart_onvif.calculate()}!'); }
Throws the following errors:
`‼️ 15:41:44.174242 ERROR UI Loggy - Onvif - ERROR: DioError [DioErrorType.response]: Http status error [500] ‼️ 15:41:44.207244 ERROR UI Loggy - Onvif - ERROR: DioError [DioErrorType.response]: Http status error [400] Unhandled exception: Exception: Error code: {Code: {Value: {$: SOAP-ENV:Sender}, Subcode: {Value: {$: ter:NotAuthorized}}}, Reason: {Text: {@xml:lang: en, $: Sender not authorized}}, Detail: {Text: {$: The action requested requires authorization and the sender is not authorized}}}
Sorry @TheDizzyEgg , the sample you've given doesn't make sense. Try something like:
void main(List<String> arguments) async {
// get connection information from the config.yaml file
final config = loadYaml(File('example/config.yaml').readAsStringSync());
// configure device connection
final onvif = await Onvif.connect(
host: config['host'],
username: config['username'],
password: config['password'],
logOptions: const LogOptions(
LogLevel.all,
stackTraceLevel: LogLevel.error,
),
printer: const PrettyPrinter(
showColors: true,
));
// get device info
var deviceInfo = await onvif.deviceManagement.getDeviceInformation();
print('Manufacturer: ${deviceInfo.manufacturer}');
print('Model: ${deviceInfo.model}');
}
Although the Onvif device manager allows me to log in and view the camera, using the easy_onvif lib I can never connect, I always get back:
ERROR:flutter/runtime/dart_vm_initializer.cc(41) Unhandled Exception: Exception: Error code: Code: Value: SOAP-ENV:Sender, Subcode: Value: NotAuthorized, Reason: Sender not authorized, Detail: Text: The action requested requires authorization and the sender is not authorized
Although I'm calling connect with the correct IP, username and password (Onvif admin user).
Any ideas!?