Giter Club home page Giter Club logo

coapnet's People

Contributors

chkr1011 avatar ms-sk avatar vankooch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coapnet's Issues

CoapClient.Dispose blocking for some reason

For some reason, that I wasn't able to find yet, the Dispose function of the client is somehow blocked / won't exit.
It doesn't matter If I run the code in a unit test or a console application.
I'm using a using statement, just like in the sample code. The code runs fine. I implemented a couple of functions to work with the Ikea Gateway.

But as soon as my code hits the end of the using statement, it will just run forever.
I also tried the example code from the wiki and I have the same behavior. So that could serve as my example code for the issue. But if I could provide any more details that can help you fix that, please let me know.

I'm using a MacBook Pro with Big Sur 11.2.3 and .NET 5 (5.0.102).

Wiki gone?

I can't find the wiki with examples any more. Is it gone ?

ZigBee Clusters and Ikea Symfonisk Volume Control

Hi,

I have been trying to get the Ikea Tradfri Symfonisk device to report its events via Observe in this library. The device is connected sucessfully and I can ask the gateway for its details and it even send random updates using Observe, however it will not report click and rotation events.

A clue as to why may be in the following comment within the deconz project. The developer says:

"bind the client OnOff cluster to a group. And then the client Level Control cluster. After that, it now behaves normally, waking up to send commands on click and turn. " (dresden-elektronik/deconz-rest-plugin#1898 (comment))

Is there the ability to do this in CoAPnet? I would really love to get this device working. So many uses for it.

Cheers!

Found & fixed bug in Block2

According to the standard, in a Block2 transfer the client should set the "more" bit in Block2 option as 0. Although this shouldn't pose an issue, it's still technically a requirement.
I added "receivedBlock2OptionValue.HasFollowingBlocks = false;" in the loop CoapClientBlockTransferReceiver.ReceiveFullPayload method

Data race in response payload for parallel requests

Hi, I was playing around with Tradfri (thanks a lot for this library BTW). And when I started making parallel requests I started noticing that there are weird situations where the message is trimmed (but maybe I'm even getting response to another request, it is difficult to tell in async context and given that all the responses are the same - device info to be exact).

I was able to fix this by augmenting CoapMessage with byte[] PayloadBytes and using that in CoapMessageToResponseConverter. I assign PayloadBytes here by just doing message.PayloadBytes = message.Payload.ToArray(); and voila the problem is gone (quick and dirty, but it did the job).

I didn't do more digging, but it makes me wonder whether the array segments aren't reused somewhere and reassigned before the converter has chance to pick up the data for the response.

This problem also occurs the most during jitting in steady state it is much less likely to occur.

I'll be happy to provide you with more feedback or a sample provided tou have a gateway to test it on ๐Ÿ˜‰.

Block1 blockwise transfer?

Does this library have support for Block1 blockwise transfer (request payload)? If so, do you have any sample of this working?

We are trying to do a Coap Push with a large file payload but we can't see how to use blockwise transfer to send it.

Tradfri Pre Shared Key Generation

Hi,

Great library! You have done an amazing amount of work.

One question, in the example for using IKEA Tradfri (https://github.com/chkr1011/CoAPnet/wiki/CoAP-Client-Examples), you mention the following link to create the pre shared key (home-assistant/core#10252). I have tried to do this using the functions available in your library, trying various permutations of parameters etc, however I cannot get it to come back with a result due to timeouts. Is the basic functionality there in the DTLS libs to be able to string something together, or does there need to be additional work done in the WithDtlsTransportLayer function?

Kind Regards.

CoAPServer?

I cannot find any code for the server - is this another repo?

New version of libraries not connecting to Tradfri

So, I got this code to connect to an IKEA Tradri:

`public static async Task ConnectTradfri(ICoapClient theClient, string IP, string ID, string secretKey) {
Console.WriteLine("< CONNECTING...");

        var connectOptions = new CoapClientConnectOptionsBuilder()
            .WithHost(IP)
            .WithPort(5684)
            .WithDtlsTransportLayer(o => o.WithPreSharedKey(ID, secretKey))
            .Build();

        using (var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(taskTimout))) {
            await theClient.ConnectAsync(connectOptions, cancellationTokenSource.Token);
        }
        
    }`

That works perfectly well when using the libs from version [1.0.9], but now that I upgraded to version [1.1.0] the same code is unable to connect. It now needs .ConfigureAwait(false); at the end.

Has something changed that I am missing? Or why could this be happening?

Identity Example

Following this note: "Please note that the identity and key must be generated first using the security token on the back of the device."

Doing so with a python lib is easy, but is there a way to do this with CoAPnet?

If so, could you point me in the right direction to do so?

Thank you!

Example Client has an error?

Hello,

In the example, it says to create a connection the builder is setup as:

var connectOptions = new CoapClientConnectOptionsBuilder()
.WithHost("GW-B8D7AF2B3EA3.fritz.box")
.WithPort(5684)
.WithDtlsTransportLayer(new DtlsCoapTransportLayerOptionsBuilder()
.WithPreSharedKey("IDENTITY", "lqxbBH6o2eAKSo5A")
.Build())
.Build();

However, when the package is downloaded from the nuget link, yhis line doesnt seem to be accepted:

.WithDtlsTransportLayer(new DtlsCoapTransportLayerOptionsBuilder()

And Visual studio only seems to find:

.WithTransportLayer

How will the example be setup in this case?

Thank you!

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.