简体   繁体   English

设备未向 LWM2M 代理发送数据

[英]Device not sending data to LWM2M Agent

I'm having trouble with LWM2M device sending data to the IOT Agent.我在 LWM2M 设备向 IOT 代理发送数据时遇到问题。 The device connects to the server successfully.设备成功连接服务器。

However, it seems the device isn't sending data to the IOT Agent, with no helpful tip, sending the command:但是,设备似乎没有向 IOT 代理发送数据,没有有用的提示,发送命令:

curl --request POST \
   --header 'Content-Type: text/plain' \
   --header 'Fiware-Service: workshop' \
   --header 'Fiware-ServicePath: /' \
   --header 'X-Auth-Token: NULL' \
   --data 't|30' \
   -v \
     'http://localhost:4041/iot/d?k=workshop-devices&i=robot1'

It returns the message:它返回消息:

* About to connect() to localhost port 4041 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4041 (#0)
> POST /iot/d?k=workshop-devices&i=robot1 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:4041
> Accept: */*
> Content-Type: text/plain
> Fiware-Service: workshop
> Fiware-ServicePath: /
> X-Auth-Token: NULL
> Content-Length: 4
> 
* upload completely sent off: 4 out of 4 bytes
< HTTP/1.1 404 Not Found
< X-Powered-By: Express
< Fiware-Correlator: 32da2092-8032-427a-86f2-19ae81a1ab47
< Content-Security-Policy: default-src 'self'
< X-Content-Type-Options: nosniff
< Content-Type: text/html; charset=utf-8
< Content-Length: 145
< Date: Mon, 24 Sep 2018 10:30:25 GMT
< Connection: keep-alive
<
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /iot/d</pre>
</body>
</html>
* Connection #0 to host localhost left intact

Not sure if anyone understands what's going here please.不知道是否有人明白这里发生了什么。

Have you followed the steps of https://github.com/telefonicaid/lightweightm2m-iotagent/blob/master/docs/deviceProvisioning.md ?您是否遵循了https://github.com/telefonicaid/lightweightm2m-iotagent/blob/master/docs/deviceProvisioning.md的步骤?

I ask this because using LWM2M, it is not possible to use curl commands to send observations from devices.我问这个是因为使用 LWM2M,不可能使用 curl 命令从设备发送观察结果。 You need to use an LWM2M client for that purpose.为此,您需要使用 LWM2M 客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM