首页 > 解决方案 > SIM800A 向 Thingsboard 发送数据时出现问题

问题描述

我使用 SIM800 连接并将数据发送到 Thingsboard。我使用 AT 命令和 Hercules 终端进行测试。一切正常,直到我通过 Thingsboard 发送 API 请求 POST 支持。这是我用来向 Thingboard 发送数据的 POST 请求

POST --data "{"temperature":40,"humidity":72}" https://demo.thingsboard.io/api/v1/2kRteaplS6EYomKeziqf/telemetry --header "Content-Type:application/json"

和 Thingsboard 返回错误

  SEND OK
HTTP/1.0 400 Bad request
Cache-Control: no-cache
Connection: close
Content-Type: text/html

<html><body><h1>400 Bad request</h1>
Your browser sent an invalid request.
</body></html>

但是当我用 curl 命令检查这个 API 时,thingsboard 会收到我发送的数据

curl -v -X POST --data "{"temperature":40,"humidity":72}" https://demo.thingsboard.io/api/v1/2kRteaplS6EYomKeziqf/telemetry --header "Content-Type:application /json"

当我通过 ATcommand 发送时,我不知道 POST 请求有什么问题?请帮我。

标签: thingsboardsim800

解决方案


推荐阅读