COAP-CLIENT(5) | coap-client Manual | COAP-CLIENT(5) |
coap-client - CoAP Client based on libcoap
coap-client [-A type1, type2 ,...] [-t type] [-b [num,]size] [-B seconds] [-e text] [-f file] [-m method] [-N] [-o file] [-P addr[:port]] [-p port] [-s duration] [-O num,text] [-T token] [-v num] [-a addr] [-U] URI
coap-client is a CoAP client to communicate with 6LoWPAN devices via the protocol CoAP (RFC 7252) using the URI given as argument on the command line. The URI must have the scheme coap (or coaps when coap-client was built with support for secure communication). The URI’s host part may be a DNS name or a literal IP address. Note that, for IPv6 address references, angle brackets are required (c.f. EXAMPLES).
-a addr
-b [num,]size
-e text
-f file
-m method
-o file
-p port
-s duration
-t type
text/plain (plain) application/link-format (link, link-format) application/xml (xml) application/octet-stream (binary, octet-stream) application/exi (exi) application/json (json) application/cbor (cbor)
-v num
-A type
-B seconds
-N
-O num,text
-P addr[:port]
-T token
-U
coap-client coap://coap.me
Query resource / from server coap.me (via the GET method).
coap-client -m get coap://[::1]/
Query on localhost via the GET method.
coap-client -m get coap://[::1]/.well-known/core
Quite the same, except on the resource .well-known/core on localhost.
echo -n "mode=on" | coap-client -m put \ coap://[2001:db8:c001:f00d:221:2eff:ff00:2704]:5683/actuators/leds?color=r -f-
Send text mode=on to resource actuators/leds?color=r on the endpoint with address 2001:db8:c001:f00d:221:2eff:ff00:2704 and port 5683. Note that the port 5683 is the default port and isn’t really needed to append.
coap-client -m put coap://[fec0::3]/ck -T 3a -t binary -f to_upload
Put the contents of file to_upload with content type binary (i.e. application/octet-stream) into resource ck on fec0::3 by usage of a token 3a via the PUT method.
There are no configuration files.
0
1
Please report bugs on the mailing list for libcoap: libcoap-developers@lists.sourceforge.net
The libcoap project <libcoap-developers@lists.sourceforge.net>
2017-02-05 | coap-client 4.1.2 |