coapjs / coap-cli Goto Github PK
View Code? Open in Web Editor NEWA command line interface for CoAP built on node-coap
License: Other
A command line interface for CoAP built on node-coap
License: Other
The current version of coap-cli
here on GitHub currently seems to not be working anymore because of breaking API changes to the commander
module it is built upon. I would try to submit a PR with fixes for this issue soon. It might require changes to the command line interface as well, though.
Not is possible include digital certified file to realizade DTLS connection in CoAP messages
To development DTLS setup logic in client-side and to create new parameter to identify the operation when digital certified file is used.
For instance, it's necessary to investigate change points your source-code .
No additional context
Trying to (manually) use the Accept option with coap-cli, I noticed that integer-based options are currently not encoded correctly. I suppose this is caused by not using the correct (network) byte order, causing the options to be corrupted.
Invoke coap get coap://coap.me/hello -O 17,50
from the command line. Observe the CoAP network traffic (for example, using Wireshark).
An Accept option with value 50 (application/json) should be included in the request.
An Accept option with value 13161 is included.
This happens with the latest version 0.11.1.
problems with sending standard (not dtls) coap ipv6 messages to Contiki-NG node via coap-cli version 0.6.0 and upper
debian@beaglebone:~$ coap get coap://[fd00::212:4b00:1cbc:1d51]/node/dtls -p 11223344
events.js:183
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND [fd00::212:4b00:1cbc:1d51]
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
(with coap-cli version 0.5.1 all good - remote node successfully receive the message)
0.6.0, 0.6.1, 0.7.0
What is the way to make request with coAp option? #17
Itried this way, but it didn't work:
Input;
coap get -O "test" + , + "test" coap://localhost:5684/basic
Output:
Error: Option 'test' is invalid.
Please provide options in this way:
-O [Key]" + coapOptionSeperator + "[Value]
OR --coap-option [Key],[Value]
Input:
coap get --coap-option [test],[test] coap://localhost:5684/basic
Output:
Error: Option '[test],[test]' is invalid.
Please provide options in this way:
-O [Key]" + coapOptionSeperator + "[Value]
OR --coap-option [Key],[Value]
Could you provide some sample?
coap get coap://xxxx:5683/test?a=123
no matches found: coap://xxxx:5683/test?a=123
coap-client can get result
Why does this and other coap modules. not accept 8 bit tokens? Its a valid token length according to the IETF spec.. This is a fine module, but not workable with 8 bit servers.
Always getting:
throw new RangeError('Trying to access beyond buffer length');
Hello, I would like to know if it's possible to observe more than one coap server simultaneously using coap-cli. If so, how?
As you probably have seen, I have been neglecting this module for the last few months. I think it will be better if someone else does the releases, and ensures general quality of the received contributions.
some coap brokers e.g. Meshblu require authentication on most requests, and they use "headers" (aka "options" in coap) to pass credentials.
providing option -H <headers>
would help talk to these servers.
https://www.npmjs.com/package/coap#registerOption
https://www.npmjs.com/package/coap#setOption
Since the update to version 0.11.0 the CLI application does not exit anymore. The request is handled as expected but the program does not exit afterwards until forced with ctrl-c. Until 0.10.1 the application is exiting normally after the request is handled.
I didn't have time to debug it yet, but I'm guessing it has to do with upstream changes from [email protected]
.
Currently this library only supports coap options in string format, like -O 2048,HelloWorld
.
But there is no way to send coap options in hex format, which would make sense to save some overhead. An option might be to prefix the value with 0x
, e.g. -O 2048,0x61
, which would result in a lowercase "a".
Apparently using echo
in bash adds a newline character to the end of the byte array.
If you don't know this, and your server rejects the request because it has a malformed payload, you might be looking for the cause for a while.
Might it be a good idea to update the Readme to use printf
instead?
printf 'hello world' | coap post coap://localhost/message
I tried this, but didn't work.
coap get coap://127.0.0.1/.well-known/?rt=light-lux
I sniffed with wireshark and It doesnt' show filter query passed in URI.
Is your feature request related to a problem? Please describe.
coap post coaps://192.168.0.4/message
Describe the solution you'd like
Initiate a DTLS exchange and transport CoAP over that secure DTLS link
Describe alternatives you've considered
Tunnel CoAP over TCP-TLS link - may be intractable for mesh devices
Additional context
Add any other context or screenshots about the feature request here.
https://tools.ietf.org/html/rfc7252#section-9.1
Hey - this is a great tool. I'm having a small issue - maybe you've an idea.
I'm trying to send a specific value to a node.
Here's the result of the GET command:
coap get coap://10.219.114.14:5683/15011/15012/
(2.05) {"9023":"46.165.194.70","9024":"52.28.154.39","9025":"gateway","9026":"****","9032":"https://da2s1apgus9tm.cloudfront.net/gway/ota/version_info.json","9027":"YOUR_AP_SSID","9028":"****","9059":1462964924,"9060":"2016-05-11T11:08:44.051320Z","9055":100,"9062":0,"9061":0,"9029":"0.7.0032","9054":0}
But the 9032 node is a bit odd.
coap get coap://10.219.114.14:5683/15011/15012/9032
(4.04) Not Found
Using the Copper Firefox tool, I send this.
{"9032":"my value"}
How might that translate to this tool? I tried a few things and couldn't get it to work. I tried:
echo "hello" | coap put coap://10.219.114.14:5683/15011/15012/9032
Thanks very much!
Command:
coap -O Proxy-Uri,127.0.0.1:8080 get coap://localhost:8000
Error:
Please provide options in this way:
-O 2048,HelloWorld
OR --coap-option 2048,HelloWorld
Since the contributors are shown on the GitHub page and the workflow somehow does not work/keeps failing, I would consider removing both, since the additional markdown file does not have that much additional value for the project.
Would you be fine with this, @gerdemann and @Apollon77?
When trying to get a resource, I get the error message:
/usr/lib/node_modules/coap-cli/index.js:63
url.method = method
^
TypeError: Cannot set property 'method' of undefined
at Object.<anonymous> (/usr/lib/node_modules/coap-cli/index.js:63:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
I guess the issue here is the IPv6 address. It's a valid address, but it seems like the code cannot handle it.
coap get coap://[fe80::fab6:41ff:fe43:b5ab%bt0]/echo
Success
Error message
0.7.1
Hello. I know you are busy and not able to actively maintain coap-cli, but I'm reporting this in case someone else hits this bug or take the lead of the project.
When I enter a URI with an encoded character, e.g. coap://example.com:5683/ps/%2F/cached, coap-cli does not decode the character and sends %2F in the URI-Path. RFC 7252, Appendix B suggests that / (the decoded character) should be sent instead.
I'm using coap-cli 0.4.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.