Comments (5)
Hi,
I made this with a simple test Console App where I put all the required calls and noted the response afterwards.
You can surely do everything required with COAPnet.
You basically need to follow this instructions: home-assistant/core#10252
Instead of using the coap-client application you can send the same requests with COAPnet.
Best regards
Christian
from coapnet.
OK, so can you help me understand this, its literally this command the one I am having trouble to interpret:
coap-client -m post -u "Client_identity" -k "SECURITY_CODE" -e '{"9090":"IDENTITY"}' "coaps://IP_ADDRESS:5684/15011/9063"
It clearly is a POST type, but I am assuming this has to happen before this:
var connectOptions = new CoapClientConnectOptionsBuilder()
.WithHost(address)
.WithPort(5684)
.WithDtlsTransportLayer(o => o.WithPreSharedKey(myID, secretKey))
.Build();
await coapClient.ConnectAsync(connectOptions, CancellationToken.None);
so my problem here is how to put in the POST the address and the "Client_identity", I am clearly miss understanding something, so my POST command so far is like this:
var request = new CoapRequestBuilder()
.WithMethod(CoapRequestMethod.Post)
.WithPath("15011/9063")
.WithQuery(GatewayCode)
.WithPayload("{"9090":"" + Identity + ""}")
.Build();
var response = await theClient.RequestAsync(request, CancellationToken.None).ConfigureAwait(false);
What am I missing?
Thank you in advance!
from coapnet.
Hello @chkr1011 , I was wondering if you could give me some guidance here, I am still stuck with it.
from coapnet.
Your code looks fine to me. I also used it to communicate with TRADFRI devices. My code is here:
CoAPnet/Source/CoAP.TestClient/Program.cs
Line 59 in 3433938
from coapnet.
Right! I was locating the Query in the wrong place.
Thank you for your help!
from coapnet.
Related Issues (12)
- New version of libraries not connecting to Tradfri HOT 2
- Data race in response payload for parallel requests HOT 9
- Wiki gone? HOT 3
- CoAPServer? HOT 1
- Block1 blockwise transfer?
- Found & fixed bug in Block2
- CoAP Server supported by package?
- Example Client has an error? HOT 2
- CoapClient.Dispose blocking for some reason HOT 9
- Tradfri Pre Shared Key Generation HOT 2
- ZigBee Clusters and Ikea Symfonisk Volume Control HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coapnet.