gan*_*bra 5 gprs at-command sim900
我有一个使用 post 方法接受 json 数据的网站。当我尝试从 POSTMAN 休息客户端发送请求时,它工作正常。当我尝试使用 AT 命令进行相同操作时,它失败了。
这是我尝试过的 AT 序列
AT
AT+CREG?
AT+CGATT?
AT+CIPSHUT
AT+CIPSTATUS
AT+CIPMUX=0
AT+CGDCONT=1,"IP","airtelgprs.com"
AT+CSTT="airtelgprs.com"
AT+CIICR
AT+CIFSR
AT+CIPSTATUS
AT+CIPSTART= "TCP","obdsam.herokuapp.com","80"
AT+CIPSEND
>
POST /newtasks HTTP/1.1 (Ctrl+M + Ctrl+J)
HOST: obdsam.herokuapp.com" (Ctrl+M + Ctrl+J)
Accept: application/json (Ctrl+M + Ctrl+J)
Content-Type: application/json (Ctrl+M + Ctrl+J)
{"RPM":"41","ECT":"20"} (Ctrl+M + Ctrl+J)
(ctrl+j)(ctrl+z)
Run Code Online (Sandbox Code Playgroud)
可能是什么问题?
这是串行终端的回复
解决了问题。AT+CIPSEND 之后的消息必须是这样的 >
POST /newtasks HTTP/1.1 (Ctrl+M + Ctrl+J)
HOST: obdsam.herokuapp.com (Ctrl+M + Ctrl+J)
Accept: application/json (Ctrl+M + Ctrl+J)
Content-Type: application/json(Ctrl+M + Ctrl+J)
Content-Length: 23 (Ctrl+M + Ctrl+J) (Ctrl+M + Ctrl+J)
{"RPM":"55","ECT":"55"} (Ctrl+M + Ctrl+J)(ctrl+j)(ctrl+z)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7027 次 |
| 最近记录: |