Flutter 3.13.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ead455963c (9 weeks ago) • 2023-09-26 18:28:17 -0700
Engine • revision a794cf2681
Tools • Dart 3.1.3 • DevTools 2.25.0
easy_onvif: ^2.1.3+3
loggy: ^2.0.3
import 'dart:developer';
import 'package:easy_onvif/onvif.dart';
import 'package:flutter/material.dart';
import 'package:loggy/loggy.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final OnVIFService onvifService = OnVIFService();
@override
void initState() {
init();
super.initState();
}
init() async {
await onvifService.connect(ip: "10.201.1.6");
onvifService.getToken().then((value) {
onvifService.getPresets();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Onvif Test'),
centerTitle: true,
),
body: Container(),
);
}
}
class OnVIFService {
late final Onvif onvif;
String? token;
Future<void> connect({required String ip}) async {
onvif = await Onvif.connect(
host: ip,
username: 'admin',
password: '123456',
logOptions: const LogOptions(
LogLevel.debug,
stackTraceLevel: LogLevel.error,
),
printer: const PrettyPrinter(
showColors: true,
));
log('OnVIFService: connected to $ip');
}
Future<void> getToken() async {
final profiles = await onvif.media.getProfiles();
final profile = profiles.last;
token = profile.token;
log('OnVIFService: got token $token');
}
Future<String> getSnapshot() async {
final snapshot = await onvif.media.getSnapshotUri(token!);
log('OnVIFService: got snapshot $snapshot');
return snapshot;
}
Future<void> getPresets() async {
final presets = await onvif.ptz.getPresets(token!, limit: 10);
log('OnVIFService: got presets $presets');
}
}
Performing hot restart...
Syncing files to device SM A135F...
Restarted application in 3,081ms.
I/flutter (22608): 👻 18:02:56.505226 INFO UI Loggy - Onvif - initializing ...
I/flutter (22608): 🐛 18:02:56.556251 DEBUG UI Loggy - DeviceManagement - getSystemDateAndTime
I/flutter (22608): 🐛 18:02:57.882572 DEBUG UI Loggy - LoggingInterceptors - URI: http://10.201.1.6/onvif/device_service
I/flutter (22608): 🐛 18:02:57.883507 DEBUG UI Loggy - LoggingInterceptors - REQUEST:
I/flutter (22608): <?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>
I/flutter (22608): 🐛 18:02:58.465847 DEBUG UI Loggy - LoggingInterceptors - RESPONSE:
I/flutter (22608): <?xml version="1.0" encoding="UTF-8"?>
I/flutter (22608): <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:tds="http://www.onvif.or
I/flutter (22608): 🐛 18:02:58.918573 DEBUG UI Loggy - DeviceManagement - getServices
I/flutter (22608): 🐛 18:02:58.998275 DEBUG UI Loggy - LoggingInterceptors - URI: http://10.201.1.6/onvif/device_service
I/flutter (22608): 🐛 18:02:58.999242 DEBUG UI Loggy - LoggingInterceptors - REQUEST:
I/flutter (22608): <?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>admin</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">o8RXJ33+JIE3Pks/EleFA8ltqeU=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">oH2fgyza5Y5/tofPXxF5pw==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2018-01-01T02:55:58.016049Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.
I/flutter (22608): 🐛 18:02:59.045113 DEBUG UI Loggy - LoggingInterceptors - RESPONSE:
I/flutter (22608): <?xml version="1.0" encoding="UTF-8"?>
I/flutter (22608): <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:tds="http://www.onvif.or
I/flutter (22608): 👻 18:02:59.154024 INFO UI Loggy - Onvif - initialization complete
[log] OnVIFService: connected to 10.201.1.6
I/flutter (22608): 🐛 18:02:59.163917 DEBUG UI Loggy - Media2 - getProfiles
I/flutter (22608): 🐛 18:02:59.177832 DEBUG UI Loggy - LoggingInterceptors - URI: http://10.201.1.6/Media2
I/flutter (22608): 🐛 18:02:59.178787 DEBUG UI Loggy - LoggingInterceptors - REQUEST:
I/flutter (22608): <?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>admin</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">vnevNkx/gfmeGnFqpHpImil97Ds=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">VHWQZEHefc7a6VH3/CcfsQ==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2018-01-01T02:55:58.251876Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.
I/flutter (22608): 🐛 18:02:59.227557 DEBUG UI Loggy - LoggingInterceptors - RESPONSE:
I/flutter (22608): <?xml version="1.0" encoding="UTF-8"?>
I/flutter (22608): <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:tds="http://www.onvif.or
I/flutter (22608): 🐛 18:02:59.354876 DEBUG UI Loggy - Ptz - getPresets
[log] OnVIFService: got token SubStream
I/flutter (22608): 🐛 18:02:59.365670 DEBUG UI Loggy - LoggingInterceptors - URI: http://10.201.1.6/PTZ
I/flutter (22608): 🐛 18:02:59.366529 DEBUG UI Loggy - LoggingInterceptors - REQUEST:
I/flutter (22608): <?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>admin</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">fXWUDhafJl0s01KRVP4IiS+BUaM=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xsKkeq+kQNXw4SmSE+0Y+w==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2018-01-01T02:55:58.443815Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.
I/flutter (22608): ‼️ 18:02:59.406946 ERROR UI Loggy - LoggingInterceptors - ERROR:
I/flutter (22608): DioException [bad response]: This exception was thrown because the response has a status code of 400 and RequestOptions.validateStatus was configured to throw for this status code.
I/flutter (22608): The status code of 400 has the following meaning: "Client error - the request contains bad syntax or cannot be fulfilled"
I/flutter (22608): Read more about status codes at https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
I/flutter (22608): In order to resolve this exception you typically have either to verify and fix your request code or you have to fix the server code.
I/flutter (22608):
I/flutter (22608): #0 Loggy.log (package:loggy/src/loggy.dart:225:33)
I/flutter (22608): #1 Loggy.error (package:loggy/src/loggy.dart:269:7)
I/flutter (22608): #2 LoggingInterceptors.onError (package:easy_onvif/src/util/logging_interceptors.dart:28:11)
I/flutter (22608): #3 DioMixin.fetch.errorInterceptorWrapper.<anonymous closure>.handleError (package:dio/src/dio_mixin.dart:429:22)
I/flutter (22608): #4 new Future.<anonymous closure> (dart:async/future.dart:256:37)
I/flutter (22608): #5 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
I/flutter (22608): #6 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
I/flutter (22608): #7 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
I/flutter (22608): #8 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)
I/flutter (22608): ‼️ 18:02:59.411994 ERROR UI Loggy - Transport - ERROR RESPONSE:
I/flutter (22608): <?xml version="1.0" encoding="UTF-8"?>
I/flutter (22608): <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:tds="http://www.onvif.org/ve
I/flutter (22608): #0 Loggy.log (package:loggy/src/loggy.dart:225:33)
I/flutter (22608): #1 Loggy.error (package:loggy/src/loggy.dart:269:7)
I/flutter (22608): #2 Transport.sendRequest (package:easy_onvif/src/soap/transport.dart:39:17)
I/flutter (22608): <asynchronous suspension>
I/flutter (22608): #3 Ptz.getPresets (package:easy_onvif/src/ptz.dart:204:22)
I/flutter (22608): <asynchronous suspension>
I/flutter (22608): #4 OnVIFService.getPresets (package:longshot_playground/main.dart:93:21)
I/flutter (22608): <asynchronous suspension>
E/flutter (22608): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Error code: {"Code":{"Value":"SOAP-ENV:Sender","Subcode":{"Value":{"$":"wsa:ActionNotSupported"}}},"Reason":{"lang":"en","note":"The [action] cannot be processed at the receiver."},"Node":null,"Role":null,"Detail":null}
E/flutter (22608): #0 Transport.sendRequest (package:easy_onvif/src/soap/transport.dart:46:13)
E/flutter (22608): <asynchronous suspension>
E/flutter (22608): #1 Ptz.getPresets (package:easy_onvif/src/ptz.dart:204:22)
E/flutter (22608): <asynchronous suspension>
E/flutter (22608): #2 OnVIFService.getPresets (package:longshot_playground/main.dart:93:21)
E/flutter (22608): <asynchronous suspension>
E/flutter (22608):
IP IR SPEED DEOM CAMERA
5.0 MEGA PIXEL
MODEL-IP-MU50-36S/MC-B