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

Exception while running Discovery #10

Open
guyluz11 opened this issue Jan 27, 2023 · 7 comments
Open

Exception while running Discovery #10

guyluz11 opened this issue Jan 27, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@guyluz11
Copy link

/home/myUser/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart --enable-asserts /home/myUser/Documents/git/network_tools/network_tools/example/test.dart
ERROR: FormatException: ERROR: Failed to parse device description. XmlParserException: Expected a single root element at 1:10 - http://192.168.31.237:9080
#0      DiscoveredClient.getDevice (package:upnp2/src/discovery.dart:376:7)
<asynchronous suspension>
#1      main.<anonymous closure> (file:///home/myUser/Documents/git/network_tools/network_tools/example/test.dart:9:19)
<asynchronous suspension>

Example code that I used

import 'package:upnp2/upnp.dart';

// NOTE: Open the example directory to see more elaborate examples
main() async {
  final disc = DeviceDiscoverer();
  await disc.start(ipv6: false);
  disc.quickDiscoverClients().listen((client) async {
    try {
      final dev = await client.getDevice();
      print('Found device: ${dev!.friendlyName}: ${dev.url}');
    } catch (e, stack) {
      print('ERROR: $e - ${client.location}');
      print(stack);
    }
  });
}

Debugged the response in discovery.dart file line 372 and the value of the content variable is status=ok

This IP belongs to my LGwebOSTV

@daniel-naegele
Copy link
Owner

It seems, that the XML send back from the device has some formatting errors, could you maybe provide the output http://192.168.31.237:9080 ? Or debug the issue and look what the response returned from the device is?

@guyluz11
Copy link
Author

The response from the device is status=ok

image

@daniel-naegele
Copy link
Owner

I need the body (see Response tab when inspecting a request) of the message, maybe you could paste it here

@daniel-naegele daniel-naegele added the bug Something isn't working label Jan 31, 2023
@guyluz11
Copy link
Author

guyluz11 commented Feb 1, 2023

We'll test it again at the end of the week when I will get back to the same WiFi

@guyluz11
Copy link
Author

guyluz11 commented Feb 2, 2023

Ha ha,
as expected it is the same
image

@daniel-naegele
Copy link
Owner

What kind of device is this? This does not seem to be in accordance with the UPnP specification

@guyluz11
Copy link
Author

guyluz11 commented Feb 3, 2023

Smart TV made by LG.
it is like android tv but is not android at all, and operating system called webos

https://en.m.wikipedia.org/wiki/WebOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants