coap

CoAP: Group similar resources under one

試著忘記壹切 提交于 2020-06-01 02:27:30
问题 I am using libcoap implementation of CoAP for one of my IOT application. Query: I want to group more than one resource under one topic. For example, I want to group 'current time' resource and 'date' resource under 'TIME' resource. On GET request to '/TIME' resource, server should provide date and current time to client. On GET request to '/TIME/current time' resource, server should provide current time to client. On GET request to '/TIME/date' resource, server should provide today's date to

CoAP and DTLS integration

萝らか妹 提交于 2020-03-14 06:59:26
问题 I have implementation of CoAP (libcoap), and implementation of DTLS (tinyDTLS). How can I make integration CoAP (libcoap) with DTLS (tinyDTLS)? I will be grateful for the any advice. 回答1: Unfortunately, I don't have enough reputation to place a comment, even though this is not an answer. Here is my attempt to do the exact same thing, using the client-server examples from both libcoap and tinydtls. Feel free to fork the code, and please sumbit a pull request if you figure out why my client and

NB-IoT 学习开发和应用 第四讲

假装没事ソ 提交于 2020-02-25 00:15:05
NB-IoT 学习开发和应用 第四讲 阿里云物联网平台中的CoAP协议学习和分析 CoAP协议:CoAP协议的底层协议是 UDP (比喻:打电话,单方通信,无需保持链接) 应用范围: NB-IoT、超低功耗应用、野外数据采集监控系统、远程抄表等 特点 :只能数据上报(注:在CoAP协议的定义中,非底层的UDP协议),服务器无法对数据进行下发控制指令。 CoAP协议报文(一共只有4个) 分别是: 1、CON报文(连接请求报文),给服务器发报文,并且发送完以后,服务器必须要发送ACK报文给设备端(即响应报文) 2、NON报文(发送给服务器,服务器无需回复) 3、ACK报文 (响应报文) 4、RST报文(代表数据发送错误,提醒用户重新发送正确的数据给服务区) 注:且在阿里云物联网平台中的的CoAP协议中,只支持 CON 报文的数据类型。其他数据格式或者协议,服务器均不支持。 同时,在阿里云物联网服务器中,上传的数据有两种形式(CON的两种形式) 1、设备认证报文 2、数据上传报文 CoAP协议报文的格式组成形式: Ver+T+TKL+Code+Messige ID+Token+Options+0xff(分隔字符)+Payload 拆分分析: Ver : 版本号 2bit T : 报文类型 2bit (CON : 00 NON : 01 ACK : 10 RST : 11 ) TKL :

Coap协议学习:1-有关概念

冷暖自知 提交于 2020-02-16 10:43:40
COAP协议简介 不像人接入互联网的简单方便,由于物联网设备大多都是资源限制型的,有限的CPU、RAM、Flash、网络宽带等。对于这类设备来说,想要直接使用现有网络的TCP和HTTP来实现设备实现信息交换是不现实的。于是为了让这部分设备能够顺利接入网络,CoAP协议(详细规范定义在 RFC 7252)就被设计出来了。 Coap(Constrained Application Protocol)是一种在物联网世界的类web协议,COAP名字翻译来就是“受限应用协议”,顾名思义,使用在资源受限的物联网设备上。 Constrained Application Protocol (CoAP) is a specialized Internet Application Protocol for constrained devices, as defined in RFC 7252 . It enables those constrained devices called "nodes" to communicate with the wider Internet using similar protocols. CoAP is designed for use between devices on the same constrained network (e.g., low-power,

物联网应用层协议选择和分析--MQTT、CoAP 、HTTP、XMPP、SoAP

心已入冬 提交于 2020-01-07 17:05:04
MQTT协议 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)最早是IBM开发的一个即时通讯协议,MQTT协议是为大量计算能力有限且工作在低带宽、不可靠网络的远程传感器和控制设备通讯而设计的一种协议。 MQTT协议的优势是可以支持所有平台,它几乎可以把所有的联网物品和互联网连接起来。 它具有以下主要的几项特性: 1、使用发布/订阅消息模式,提供一对多的消息发布和应用程序之间的解耦; 2、消息传输不需要知道负载内容; 3、使用 TCP/IP 提供网络连接; 4、有三种消息发布的服务质量: QoS 0:“最多一次”,消息发布完全依赖底层 TCP/IP 网络。分发的消息可能丢失或重复。例如,这个等级可用于环境传感器数据,单次的数据丢失没关系,因为不久后还会有第二次发送。 QoS 1:“至少一次”,确保消息可以到达,但消息可能会重复。 QoS 2:“只有一次”,确保消息只到达一次。例如,这个等级可用在一个计费系统中,这里如果消息重复或丢失会导致不正确的收费。 5、小型传输,开销很小(固定长度的头部是 2 字节),协议交换最小化,以降低网络流量; 6、使用 Last Will 和 Testament 特性通知有关各方客户端异常中断的机制; 在MQTT协议中,一个MQTT数据包由:固定头(Fixed header)、 可变头(Variable

How to transform CoAP to HTTP?

佐手、 提交于 2019-12-23 02:42:10
问题 I searched but did not found any example showing on how to convert CoAP request or response to HTTP request. Basically what I want to do is CoAP request POST some data from device to a server which will translate it and do HTTP request POST to other server to be save inside the database. While the part to save the data is not a major problem right now, I did not managed to find any example script showing how to convert from CoAP to HTTP. I already looked at coapthon , aiocoap but since

CoAP and MQTT support in Wildfly 8.0.0.Final

巧了我就是萌 提交于 2019-12-14 02:35:34
问题 We have an enterprise solution deployed on Wildfly 8.0.0 server, we intend to support CoAP and MQTT also as communication protocol. We explored extensively but we couldn't find even any oblique reference to our problem case. Is it possible to add CoAP and MQTT support without destabilizing Wildfly setup ?? 回答1: I think theoretically it is possible to use a https://www.eclipse.org/californium/ within an EE server for CoAP. The main issue here is that Californium listens to an UDP port (and

Californium CoAP Server Error on addEndpoints

烂漫一生 提交于 2019-12-12 03:25:09
问题 I am trying one of example CoAP server program from https://github.com/eclipse/californium.core/tree/master/cf-helloworld-server/src/main/java/org/eclipse/californium/examples/HelloWorldServer.java I have used library CoAP from http://mvnrepository.com/artifact/org.eclipse.californium/californium-core/1.0.1 When I run below code to addEndpoints, I get an exception: private void addEndpoints() { for (InetAddress addr : EndpointManager.getEndpointManager().getNetworkInterfaces()) { // only

How to retrieve updated content on an Observed resource in Leshan?

我怕爱的太早我们不能终老 提交于 2019-12-12 03:20:20
问题 Currently I am working on proof of concept using Leshan to recieve log messages from devices on regular basis. We found that Observe request is the best way to go for this approach. So temporarily, since we don't have a custom object yet(Wakama client not ready yet), on the server side when the client registers, I observe resource 15 on Device in LeshanClientExample. Here is the Observe code in LeshanServer.java: this.clientRegistry.addListener(new ClientRegistryListener() { .... @Override

Cant use Micro-Coap library for arduino

别来无恙 提交于 2019-12-11 20:33:18
问题 I am trying to get the micro-coap librarby (https://github.com/1248/microcoap) to work on my arduino. When I try to compile it in the Arduino IDE, it reports that <sys/socket.h> dependency in main-posix.c can not be found. Searches for the problem were not helpful, except for some general C++ answer that was hinting that there is no sys/socket.h on Windows. But this should not have anything to do with Arduino right? I looked at the ethernet library for arduino and there is a socket.h but it