This coap repository is based on master
branch @b425b150
commit of libcoap.
For further information related to CoAP, see https://coap.technology.
CoAP package Path in menuconfig
:
RT-Thread online packages/IoT/CoAP
.
Config in menuconfig
:
RT-Thread Components/Command shell/Using mode shell
Modify MSH consle buffer in menuconfig
:
Set RT-Thread Kernel/Kernel Device Object/the buffer size for console log printf
as 512
If there are some errors
after compiled , please refer to the following Notes
Use coap_client to request coap.me/test
Using -m
param to select coap client request method , it only realize get
method.
msh />coap_client -m get coap:https://coap.me/test
uri.path.s = test; uri.host.s = coap.me/test
server_host = coap.me
DNS lookup succeeded. IP=134.102.218.18
welcome to the ETSI plugtest! last change: 2018-01-15 13:55:19 UTC
msh />coap_server
Default coap server uri is coap:https://yourserveripaddr/rtthread
, use another coap_client to request this server as coap_client -m get coap:https://yourserveripaddr/rtthread
, then client will return Hello rtthread!
message.
Modify libcoap/include/coap/encode.h
at line 13 as #if (BSD >= 199103) || defined(WITH_CONTIKI) || defined(RTTHREAD_VERSION)
Config in menuconfig
:
Don't select RT-Thread Component/Device virtual file system/Enable BSD socket/Toolchain sys/select.h
and Toolchain sys/socket.h
.
Config in menuconfig
:
The RT-Thread Component/Device virtual file system/The maximal number of opened files
value need to greater or equal to RT-Thread Component/Network stack/light weight TCP/IP stack/The number of raw connection
value.
1 CoAP Official website: https://coap.technology/
2 CoAP test server: coap.me