Giter Site home page Giter Site logo

Comments (3)

faithoflifedev avatar faithoflifedev commented on August 14, 2024

Hello @TheDizzyEgg,

Do you have some sample code for the onvif operations you are doing?

from easy_onvif.

TheDizzyEgg avatar TheDizzyEgg commented on August 14, 2024

This is the most basic example:

void main(List arguments) async {
Onvif testOnvif = await Onvif.connect(host: '192.168.0.40', username: 'admin', password: 'password');

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}}} #0 Soap.send (package:easy_onvif/src/soap.dart:43:11) <asynchronous suspension> #1 Soap.retrieveEnvelope (package:easy_onvif/src/soap.dart:59:26) <asynchronous suspension> #2 DeviceManagement.getCapabilities (package:easy_onvif/src/device_management.dart:32:22) <asynchronous suspension> #3 Onvif.initialize (package:easy_onvif/src/onvif_base.dart:124:28) <asynchronous suspension> #4 Onvif.connect (package:easy_onvif/src/onvif_base.dart:87:5) <asynchronous suspension> #5 main (file:///C:/Users/dizzy.egg/Dart/dart_onvif/bin/dart_onvif.dart:6:21) <asynchronous suspension>

from easy_onvif.

faithoflifedev avatar faithoflifedev commented on August 14, 2024

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}');
}

from easy_onvif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.