node-coap | CoAP - Node.js style | Runtime Evironment library
kandi X-RAY | node-coap Summary
kandi X-RAY | node-coap Summary
node-coap
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- test for test server
node-coap Key Features
node-coap Examples and Code Snippets
Community Discussions
Trending Discussions on node-coap
QUESTION
We're estimating the practicability to replace our conventional HTTPS/RESTful over cellular network (4G-LTE) with CoAP/DTLS over NB-IoT, to prolong the battery life of remote devices. The IoT application we've deployed only takes a tiny proportion of 4G-LTE data bandwidth and UDP over NB-IoT is good enough; so transmission performance is not our main concern.
But the problem is, we're now using mutual authentication in SSL/TLS layer and we assign different client certificates to different sub-groups. And I'm not sure how to do that in CoAP/DTLS.
I've learned that the default credential model of CoAP/DTLS is Pre-Shared Key (PSK) and I also learned from RFC4279 that I may use the PSK identity / shared-key pair as an easy alternative to username, which could just fit my needs. But when I'm trying to figure out how to implement this, I found the internet resource is very limited. So far I've surveyed node-coap.js
and libcoap
but I can't find any hints in the documents. Both seemed to support only one credential at the same time.
What is the best practice to deploy CoAP-DTLS server that can support multiple PSK identity/shared-key sets ? Or do I need to implement the whole authentication mechanism in application layer ?
...ANSWER
Answered 2019-Nov-20 at 16:26One option for server/cloud side CoAP is Eclipse Californium. I am involved in that project and may thus be biased. That said, we have actually built Californium for exactly this purpose.
QUESTION
I want to send coap messages using an application developed on nativescript framework. Are there any available modules in nativescript or how to use node-coap for the same?
...ANSWER
Answered 2019-Mar-12 at 18:36I don't think there is any plugin as of today that supports CoAP. You might want to write one.
A quick search shows there are native clients available on respective platforms, iCoAP / spitfirefox for which you could write a plugin or directly use the apis in your project.
Read more about accessing native or third party libraries in iOS / Android from the docs.
QUESTION
Currently I'm developing an application using vue.js (MEVN)
I need to implement CoAP and OPC-UA client in vue.js Unfortunately, I can't find a suitable client library for vue.js But, I did found the library for node.js.
So, this pop up a question to me, is it possible to use the node.js library to vue.js ?
For example:
My guess, it is not... But they have the same language. So, I'm really not sure.
Please share your thought about this, or any other possible library if existed that can be used with vue.js
Thank you !
...ANSWER
Answered 2018-Jul-25 at 11:11Vue.js can use NPM library, i.e. a library that was published on NPM registry and is installed with NPM or Yarn package managers.
There's no strict definition of Node library. Usually this means that a library is intended to be used in Node.js and uses Node.js features. Sometimes it's possible to mock or polyfill them on client side (streams, buffers). Package internals should be examined in order to make a decision. E.g. joi is Node library but doesn't depend on Node.js features for the most part and is suitable for browser use with a few adjustments at build step.
node-coap
documentation clearly states that the package uses Node.js http
module, which isn't available on client side:
client and server library for CoAP modeled after the http module
Notice that it refers to CoAP client, not to client-side environment (a browser).
Since Vue.js supports server-side rendering, it's possible to use Node libraries on server side. This will work if some units don't need to be used on client side or they are used differently (load data from filesystem on server side and via AJAX request on client side). This approach won't work in this case because Node.js library functionality is needed on client side.
QUESTION
I have to develop a node.js app which can interact with another oneM2M server. In particular the node.js app need to exchange data using CoaP protocol, but I don't know how to do that in a oneM2M compliant manner.
I started my node.js project using this module: https://github.com/mcollina/node-coap but I need some support to create a CoaP client using oneM2M protocol.
Code samples are really appreciated.
...ANSWER
Answered 2017-Nov-16 at 09:55If you want to communicate with a oneM2M CSE from your application, then you should implement the Mca interface. This is the interface between a CSE and your application, technically called an Application Entity, or AE.
The simplest way is to use the REST binding. You may have a look at the oneM2M's developer guide at http://www.onem2m.org/application-developer-guide.
You also might want to read the following specifications:
- TS-0001: Functional Specification, which is the core specification document of oneM2M. Here, the basic concepts as well as all resource types are defined.
- TS-0004: Service Layer Core Protocol for further details on the actual encodings and representation of resources.
- TS-0008: CoAP Protocol Binding
- TS-0009: HTTP Protocol Binding
You can find the latest version of these and other specifications here: http://www.onem2m.org/technical/published-documents
QUESTION
I'm using node-coap in order to send data to a coap server, I need to use a custom option in the packet so I'm running this code:
...ANSWER
Answered 2017-Jun-20 at 14:54In the node-coap readme, an example of setOption uses a numeric name for the custom option.
QUESTION
I'm using node-coap (https://github.com/mcollina/node-coap) to send Coap packets, now I'm trying to do post or put requests with payload, but I haven't understand how to add payload to request. What method or property I have to use to insert the payload?
...ANSWER
Answered 2017-Jun-02 at 12:34There is an example there in their repo:
https://github.com/mcollina/node-coap/blob/master/examples/req_with_payload.js
QUESTION
I am trying to transmit sensor data from an IoT device via CoAP using node-coap. The order of the data, as it arrives to the CoAP server, is important to me. I can not find a way to preserve the sequence of data, even when using the confirmable
request option.
I have a small program below that shows what I mean.
Can CoAP not be used if order/sequence of data is important? If it can, what am I doing wrong?
...ANSWER
Answered 2017-May-31 at 15:00It can't as long you are using UDP as transport.
As per RFC7252:
As CoAP is bound to unreliable transports such as UDP, CoAP messages may arrive out of order, appear duplicated, or go missing without notice. For this reason, CoAP implements a lightweight reliability mechanism, without trying to re-create the full feature set of a transport like TCP. It has the following features:
Simple stop-and-wait retransmission reliability with exponential back-off for Confirmable messages.
Duplicate detection for both Confirmable and Non-confirmable messages.
https://tools.ietf.org/html/rfc7252
There are some efforts to make CoAP-over-HTTP in different implementations but it does not belong to CoAP RFC itself.
You may try to dig in this way if you absolutely forced to use CoAP.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-coap
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page