SIM 800 GPRS调制解调器,用于HTTP GET和POST到AWS IoT和AWS API网关 [英] SIM 800 GPRS modem for HTTP GET and POST to AWS IoT and AWS API gateway

查看:284
本文介绍了SIM 800 GPRS调制解调器,用于HTTP GET和POST到AWS IoT和AWS API网关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用SIM 800模块分别在AWS云中发布和获取一些JSON数据。我最初通过终端UART软件直接从我的PC上试用它并手动输入AT命令。

I was trying to POST and GET some JSON data to and from the AWS cloud respectively using the SIM 800 module. I'm initially trying it out directly from my PC over a terminal UART software and inputting AT commands in manually.

HTTP GET在SSL上工作正常( AT + HTTPSSL = 1 )对于像Google和Quora这样的网站,他们会返回< html> 数据。

HTTP GET is working fine over SSL (AT+HTTPSSL=1) for websites like Google and Quora, as in, they return back <html> data.

1)我首先使用HTTP查看了AWS IoT路由,如链接此处。但它不仅需要一个HTTP SSL证书,还需要根CA证书和私钥,我想不可能在SIM 800上使用AT命令将这些证书添加到单个证书中。如果有办法为了这样做,那么任何人都可以详细说明它的流程和命令吗?

1) I looked into first going through the AWS IoT route using HTTP as mentioned in the link here. But it requires not only a single certificate for HTTP SSL but also requires the root CA certificate and the private key and I guess it is not possible to add these apart from a single certificate using AT commands on the SIM 800. If there is a way to do so then can anyone please elaborate on it like the process flow and commands to do so?

2)然后我试着去API路线。我在AWS中创建了一个API网关,它与一些云逻辑内部链接。我想实际向AWS云执行HTTP POST(技术上是https)JSON数据,但是我为HTTP GET创建了一个测试API网关,它添加了在URL中编写的操作数,并以JSON的形式发回数据。然而,通过SSL的HTTP GET到 https://XXXX.execute-api.us-west-2.amazonaws.com/XXX/calc/4/2/+ 606错误代码失败。在SIM 800 606的SSL应用程序注释中,错误代码表示

2) I then tried to go the API route. I created an API gateway in AWS which is internally linked with some cloud logic. I want to actually do HTTP POST (https technically) of JSON data to the AWS cloud but I created a test API gateway for HTTP GET which does the addition of operands written in the URL and sends back data in the form of JSON. An HTTP GET over SSL however to a URL like https://XXXX.execute-api.us-west-2.amazonaws.com/XXX/calc/4/2/+ fails with a 606 error code. In the SSL application note of SIM 800 606 error code means


SSL警报消息,其中包含直接$ b $的致命结果b终止连接

"SSL alert message with a level of fatal result in the immediate termination of the connection"

我在这里做错了什么?

另外,我也在 https://httpbin.org/ip 上尝试了基于SSL的HTTP GET并获得了同样606错误。是因为SIM 800需要一个< html> 而是获得JSON还是其他东西?

Also, I tried HTTP GET over SSL on https://httpbin.org/ip too and got the same 606 error. Is it because the SIM 800 expects an <html> and instead it gets JSON or is it something else?

对于我在PC上通过终端软件从SIM 800上的AT命令例程,我通常会做(对于API网关方法):

For my AT command routine on the SIM 800 from the PC via Terminal software I usually do (for API gateway method):

AT+SAPBR=3,1,"CONTYPE","GPRS"
AT+SAPBR=3,1,"APN","XXXX"
AT+SAPBR=1,1
AT+HTTPINIT
AT+HTTPSSL=1
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","https://XXXX.execute-api.us-west-2.amazonaws.com/XXX/calc/4/2/+"
AT+HTTPACTION=0

提前致谢。

推荐答案

方法2即API网关。我不认为通过方法1即AWS IoT可以做到这一点。

The way to do it is method 2 i.e. API Gateway. I don't think its possible to do it through method 1 i.e. AWS IoT.

@mich @ patrick-fischer 是正确的,我也怀疑同样但不知道解决方案。我和我的团队联系了AWS支持,他们告诉我们解决方案。

@mich and @patrick-fischer are correct with the reason and I too was suspecting the same but didn't know the solution. I and my team contacted AWS support and they told us the solution.

显然,您是通过AWS CloudFront完成的。您必须使用API​​网关的链接创建CloudFront分配(在我的情况下 https://XXXX.execute-api.us-west-2.amazonaws.com/XXX/calc/ 4/2 / + )。在创建此分发时,您可以提及是否接受传入的HTTP,HTTPS或两者。

Apparently, you do it through AWS CloudFront. You have to go and create a CloudFront distribution with the link of your API Gateway (in my case https://XXXX.execute-api.us-west-2.amazonaws.com/XXX/calc/4/2/+). While creating this distribution you can mention whether to accept incoming HTTP, HTTPS or both.

在其中一个部分(不记得部分的名称),它允许您提及允许传入请求的TLS / SSL版本。对于SIM 800,TLSv1.0是必须在CloudFront分配中设置的最高支持版本。

In one of the sections (don't remember the name of the section), it allows you to mention which TLS/SSL version to allow incoming requests from. In the case of SIM 800, TLSv1.0 is the highest supported version which has to be set in the CloudFront distribution.

CloudFront所做的是允许来自某些来源的流量参数类似于HTTP的版本,TLS版本.etc。

What CloudFront does is allow traffic from sources with certain parameters like the version of HTTP, TLS version .etc.

这篇关于SIM 800 GPRS调制解调器,用于HTTP GET和POST到AWS IoT和AWS API网关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆