gpt4 book ai didi

at-command - 无法从 sim900 连接到 no-ip 更新服务器

转载 作者:行者123 更新时间:2023-12-02 18:47:15 25 4
gpt4 key购买 nike

首先,无论谁能帮助我,我都衷心感谢你们。这非常令人沮丧。当我执行 GET 请求时,收到 603 错误。

好的。我正在使用 sim900 并希望向 no-ip.com 的更新服务器发送 HTTP get 请求。更新 URL 的格式在此处给出 -> http://www.noip.com/integrate/request

我创建了一个免费帐户,并希望从 sim900 更新我的域名(其形式为“xyz.ddns.net”),因为我要将其连接到微 Controller 并将其配置为像服务器一样运行将数据发送到 PC(数据将是一些传感器数据。)使用像 noip 这样的动态 DNS 服务对于我从工作 PC 连接到我的设置非常有帮助,因为只要用户按下 GUI 界面中的按钮。

我使用的命令是这些->

AT //Just to check
AT+CSQ // To check the signal quality
AT+CGATT=1 //Attach to a GPRS network
At+CIPSHUT //to close any earlier session
AT+SAPBR =3,1,"CONTYPE","GPRS" //I am using context ID 1
AT+SAPBR = 3,1,"APN","airtelgprs.com"
AT+SAPBR=4,1 // This prints out the expected output with the updated APN and CONTYPE
AT+SAPBR =1,1

//Now I open a HTTP session
AT+HTTPINIT
AT+HTTPPARA="URL", "http://myusername:mypassword@dynupdate.no-ip.com/nic/update?hostname=xyz.ddns.net" //The my ip part is optional according to the no-ip guys.

AT+HTTPPARA="REDIR","1"
AT+HTTPPARA="CID","1" //Actually CID is 1 by default. Still typed this command. No difference.
AT+HTTPACTION=0 //GET request

Output of this is: 0,603,0

SIMComm 文档说这意味着 DNS 错误。我在上述命令或设置中错过了什么导致此错误?如果你们需要更多信息,请告诉我们。

提前再次感谢。

最佳答案

根据我的经验,发送这样的更新请求总是失败,Dyndns documentation解释如何发送 RAW HTTP 请求。我用过它并且效果很好。检查 No-ip 文档以获取确切的原始 Http 请求。

Dyndns documentation提到您正在使用的网络浏览器和实用程序的方法。

Authentication in URL

For web-browsers or utility programs (fetch, curl, lwp-request) that can parse authentication section in URL.

http://username:password@members.dyndns.org/nic/update?hostname=yourhostname&myip=ipaddress&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG

Raw HTTP GET Request

Actual HTTP request should look like following fragment. Note that there is the bare minimum set of headers. Request should be followed by sending an empty line.

Fragment base-64-authorization should be represented by Base 64 encoded username:password string.

GET /nic/update?hostname=yourhostname&myip=ipaddress&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG
HTTP/1.0 Host: members.dyndns.org Authorization: Basic
base-64-authorization User-Agent: Company - Device - Version Number

Please note that although POST requests are permitted and will be processed, we don’t encourage developers to use them. We might stop processing of POST requests at any time, without notice.

关于at-command - 无法从 sim900 连接到 no-ip 更新服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27746718/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com