Coder Social home page Coder Social logo

Comments (7)

shamblett avatar shamblett commented on August 28, 2024

The idea is to use the simple server from the OCF Iotivity-Lite project, however I'm a way off this yet, not only do I have to get this working as a COAP client with a normal COAP server such as coap.me for instance I then have to mod it to work with iotivity which has its own slightly different COAP implementation.

At the mo though I'm still trying to get it working reliably on IPV6 loopback, the network stack needs some work, the port from C# didn't work well with Dart, it needs to be reworked I think. This is why the package is still not published on pub. Its been a low priority package(too low!) for me for a while now.

Feel free to work on it if you wish.

from coap.

micrcx avatar micrcx commented on August 28, 2024

Is it possible to use simple server from iotivity-lite? In principle Iotivity lite simple server can work without the security layer, I've check this. In any case, in iotivity-lite, simple server/client interact with each other if them were built without the security layer. Or will there be any problems with this because of your specific implementation of CoAP?

from coap.

shamblett avatar shamblett commented on August 28, 2024

Iotivity-Lite simple client/server do interact with each other without security out of the box, I've tried this, first step, I want the coap client to interact with the simple server in the same way. I've not even thought about security yet. I don't have a specific implementation of COAP, its just vanilla COAP, its Iotovity that alters the implementation(or they certainly used to).

from coap.

micrcx avatar micrcx commented on August 28, 2024

If change one line in the lookupHost method of the CoapUtil class (coap_util.dart), as shown below:

static Future<InternetAddress> lookupHost(String host) async {
    final Completer<InternetAddress> completer = Completer<InternetAddress>();
    final List<InternetAddress> addresses =
    //    await InternetAddress.lookup(host, type: InternetAddressType.IPv6);
      await InternetAddress.lookup(host, type: InternetAddressType.IPv4);
    logResolvedAddresses(addresses);
    if (addresses != null && addresses.isNotEmpty) {
      completer.complete(addresses[0]);
    } else {
      completer.complete(null);
    }
    return completer.future;
  }

can avoid crash when running simple_client:

/usr/lib/dart/bin/dart --enable-asserts --enable-vm-service:56502 --pause-isolates-on-exit /home/michael_k/IdeaProjects/coap_dart/examples/simple_client.dart
Observatory listening on http://127.0.0.1:56502/

Resolved address : InternetAddress('127.0.0.1', IPv4)
SJH - isLinkLocal - false
SJH - isLoopback - true
SJH - isLinkMulticast - false
SJH - type - InternetAddressType: IPv4
Simple client, sending request to localhost with path .well-known/core, waiting for response....
No response received, closing client

But no more than that. Check the performance of the client is not yet possible. I tried to use ./simpleserver of iotivity-lite, changing ports, but so far I have not achieved any results. Sorry.

Using pure dart to implement iotivity-lite is a great idea. The only pity is that while nothing works. By the way, I think that writing a dart wrapper for the native code of iotivity-lite is no less difficult, therefore your approach is completely justified.

from coap.

shamblett avatar shamblett commented on August 28, 2024

IIRC Iotivity is intended to use IPV6 transport, I think you need to change the simple server to use IPV4 but I'm not sure. COAP itself is intended to use IPV6, see here, so I want to get the package to use IPV6 first, hence I'm testing this first. The intention is to publish a COAP package for Dart, with a selectable option to use Iotivity(or any other variants), not to publish an Iotivity specific package,

from coap.

micrcx avatar micrcx commented on August 28, 2024

Ok. I tried to use coap.me to check, but without success. Maybe I do not understand something. There are two lines:

  1. Crawl CoAP Server on IP Address [coap.me] on port [5683] and
  2. Or maybe crawl CoAP Server on URI [coap: //coap.me: 5683].
    Is the port you are using - really 5683, and should ".well-known / core" be specified as an IP address?

from coap.

shamblett avatar shamblett commented on August 28, 2024

Yes, this is expected, as I said above the package is not yet finished and fully tested

from coap.

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.