CGDCONTzzz13com
zzz13com 时间:2021-03-24 阅读:(
)
SkywireDevelopmentKitSocketDialExampleNimbeLinkCorpUpdated:August2019PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
1TableofContentsTableofContents2Introduction3Prerequisites3SocketDial4Overview4SetupAPN(IfApplicable)4ConfigureSocket(IfApplicable)5ActivateSkywireSocket5InitiateSocketDial6SendDataviaHTTP7ReceiveDataviaHTTP7ShutdowntheSocketConnection8WorkingExample1:dweet.
io9Overview9GetIMEIofModem9InitiateSocketDial9SendDataviaHTTP10ReceiveDataviaHTTP10Troubleshooting11NewLine/CarriageReturn11Appendix-SocketDialFlowCharts12Introduction12NL-SW-HSPAFlowChart13NL-SW-LTE-TSVG-xFlowChart14PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
21.
Introduction1.
1.
PrerequisitesThisdocumentassumesyouhavecompletedtheinitialsetupofyourmodemanddevelopmentkit.
Ifyouhavenotcompletedthosesteps,refertotheSkywireDevelopmentKitUserManualandcompletethemodemsetupbeforeproceeding.
Ifapplicable,themodemmustalreadybeprovisioned.
SeetheDevelopmentKitUserManualfordetailsonhowtoaccomplishthesesteps.
Note:IfyourSkywiremodemisnotlistedhere,pleasevisititsrespectivepageonwww.
nimbelink.
comforthesocketdialprocedure.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
32.
SocketDial2.
1.
OverviewSocketdialingisusefulforuploadingordownloadinginformationtoorfromawebsiteordatabaseviaHTTPcommands.
Belowisanexampleforconnectingtoaserver,uploadingdata,downloadingdata,andthendisconnectingfromtheserver.
2.
2.
SetupAPN(IfApplicable)Forthefollowingmodems:-NL-SW-GPRS-NL-SW-HSPA-NL-SW-HSPA-B-NL-SW-LTE-TEUG-NL-SW-LTE-TNAG-NL-SW-LTE-TNAG-B-NL-SW-LTE-TC4EU-NL-SW-LTE-TC4NAG(AT&TFirmware)typethefollowingcommandintotheterminalprogram:AT+CGDCONT=1,"IP","[yourapn]"where[yourapn]istheAPNforyourcarrier,followedbytheEnterkey.
Theterminalshouldrespondwith:OKForexample,ifyouareusinganAT&TSIMandyourAPNis:iot0718.
com.
attzyouwouldtype:AT+CGDCONT=1,"IP","iot0718.
com.
attz"followedbytheEnterkey.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
4Forthefollowingmodem:-NL-SW-LTE-TSVG-NL-SW-LTE-TC4NAG(VerizonFirmware)typethefollowingcommandintotheterminalprogram:AT+CGDCONT=3,"IP","[yourapn]"where[yourapn]istheAPNforyourcarrier,followedbytheEnterkey.
Forexample,ifyourVerizonAPNis:nimblink.
gw12.
vzwentpyouwouldtype:AT+CGDCONT=3,"IPV4V6","nimblink.
gw12.
vzwentp"followedbytheEnterkey.
2.
3.
ConfigureSocket(IfApplicable)Forthefollowingmodem:-NL-SW-LTE-TSVG-NL-SW-LTE-TC4NAGtypethefollowingcommandintotheterminalprogram:AT#SCFG=1,3,300,90,600,50followedbytheEnterkey,andtheterminalshouldrespondwith:OKSinceVerizonmodemsusePDPContext3,thissetupisrequiredtousePDPcontext3withthefirstsocket.
2.
4.
ActivateSkywireSocketForthefollowingmodems:-NL-SW-1xRTT-A-NL-SW-1xRTT-S-NL-SW-1xRTT-V-NL-SW-EVDO-A-NL-SW-EVDO-V-NL-SW-GPRS-NL-SW-HSPA-NL-SW-HSPA-BPN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
5-NL-SW-LTE-TEUG-NL-SW-LTE-TNAG-NL-SW-LTE-TNAG-B-NL-SW-LTE-TC4EU-NL-SW-LTE-TC4NAG(AT&TFirmware)typethefollowingcommandintotheterminalprogram:AT#SGACT=1,1followedbytheEnterkey,andtheterminalshouldrespondwith:#SGACT:"www.
xxx.
yyy.
zzz"OKwherewww.
xxx.
yyy.
zzzistheIPaddressofyourSkywiremodem.
Forthefollowingmodem:-NL-SW-LTE-TSVG-NL-SW-LTE-TC4NAG(VerizonFirmware)typethefollowingcommandintotheterminalprogram:AT#SGACT=3,1FollowedbytheEnterkey,andtheterminalshouldrespondwith:#SGACT:"www.
xxx.
yyy.
zzz"OKwherewww.
xxx.
yyy.
zzzistheIPaddressofyourSkywiremodem.
2.
5.
InitiateSocketDialIntheterminalprogram,typethefollowingcommand:AT#SD=1,0,80,"example.
com"where1isthesocketyouwouldliketoconnectwith(1–6),0isthetransmissionprotocolyou'dliketouse(0–TCP,1–UDP),80istheportnumberyou'dliketoconnectto(1–65535),andexample.
comisthehostnameorIPaddressyou'dliketoconnectto,followedbytheenterkey.
Afterashortdelaytheterminalprogramshouldrespondwith:CONNECTandthecursorwillbeonthenextline.
Note:Forthesocketnumber,usethesocketyousetupinSection2.
3above.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
6Note:TheTCPport(thirdparameter)thatistypicallyusedisport80,whichistheTCPPortforHTTP.
Dependingonyourapplication,youmayuseadifferentport.
2.
6.
SendDataviaHTTPInordertosenddatatothewebsite,youcanusetheHTTPPOSTcommand.
ThesyntaxofthePOSTcommandisasfollows:POST/test/demo_form.
aspHTTP/1.
1POSTistheHTTPcommandbeingissued,/text/demo_form.
aspistheendpointontheserver,andHTTP/1.
1istheHTTPversionyouwillbeusing.
Note:Forthisstep,youwillnotbeabletoseethetextyouaretyping.
Toensurethatthedataisaccurate,itisrecommendedtocopyandpasteinthedata.
However,thisisnotnecessary.
Intheterminalprogram,enterthePOSTdatayouwouldliketosendaccordingtotheabovesyntax.
Makesurethatthedataisformattedtohowyourserverisexpectingit.
Onceyoutypethedata,pressCTRL+MCTRL+JCTRL+MCTRL+J.
Thiswillenterthetwosetsofcarriagereturn/newlinecharactersnecessarytosignaltotheserverthatdatatransmissioniscomplete.
Afterashortdelay,theterminalprogramshoulddisplay:HTTP/1.
12xxOK[textresponsefromserver]NOCARRIERwhere2xxisthesuccessfulresponsecodeoftheHTTPserver.
200isthegeneralHTTP/1.
1responseofOK,meaningthattheresponsewasreceivedproperly.
Therearederivationsofthe2xxresponse,however.
Ifyoureceiveanunexpectedvalue,pleaseconsulttheHTTP/1.
1ProtocolDocumentationatthefollowingURL:http://www.
w3.
org/Protocols/rfc2616/rfc2616-sec10.
html2.
7.
ReceiveDataviaHTTPInordertoreceivedatafromawebsite,youmustusetheHTTPGETcommand.
ThesyntaxoftheGETcommandissimilartothePOSTcommand,andisasfollows:GET/test/demo_form.
aspHTTP/1.
1whereGETistheHTTPcommandbeingissued,/text/demo_form.
aspisthelocationofthedata,andHTTP/1.
1istheHTTPversionyouwillbeusing.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
7Note:Forthisstep,youwillnotbeabletoseethetextyouaretyping.
Toensurethatthedataisaccurate,itisrecommendedtocopyandpasteinthedata.
However,thecommandstillworksiftypedcorrectly.
Intheterminalprogram,entertheGETdatayouwouldliketorequestaccordingtotheabovesyntax.
Makesurethatthedataisformattedtohowyourserverisexpectingit.
Onceyoutypethedata,pressCTRL+MCTRL+JCTRL+MCTRL+J.
Thiswillenterthetwosetsofcarriagereturn/newlinecharactersnecessarytosignaltotheserverthatdatatransmissioniscomplete.
Afterashortdelay,theterminalprogramshoulddisplay:HTTP/1.
1xxxOK[textresponsefromserver]NOCARRIERwhere2xxisthesuccessfulresponsecodeoftheHTTPserver.
200isthegeneralHTTP/1.
1responseofOK,meaningthattheresponsewasreceivedproperly.
Therearederivationsofthe2xxresponse,however.
Ifyoureceiveanunexpectedvalue,pleaseconsulttheHTTP/1.
1ProtocolDocumentationatthefollowingURL:http://www.
w3.
org/Protocols/rfc2616/rfc2616-sec10.
html2.
8.
ShutdowntheSocketConnectionIntheterminalprogram,typethefollowingcommand:+++followedbytheEnterkey,andtheterminalshouldrespondwith:NOCARRIERThiscommand(threeplussigns)istheescapecommandtosuspendthedataconnectioninthesocketconnection.
Toclosethesocket,typethefollowingcommandintotheterminalprogram:AT#SH=xwherexisthesocketopenedintheprevioussteps,followedbytheenterkey,andtheterminalshouldrespondwith:OKThedataconnectionandsocketconnectionhasnowbeenterminated.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
83.
WorkingExample1:dweet.
io3.
1.
OverviewThissectionwillprovideaworkingexampleofsendingandreceivingdataviaanHTTPtransferusingaSkywireNL-SW-LTE-TSVGmodemusinga4GVerizonLTESIM.
dweet.
ioisalightweightmessagingservicespecificallydesignedforIoT(InternetofThings)devices.
Inadditiontobeinglightweight,dweet.
iodoesnotrequireanaccounttogetupandrunning.
Atwww.
dweet.
io,theyhaveanexcellent"helloworld"examplewewillbeusing.
3.
2.
GetIMEIofModemdweet.
iorequiresauniquedevicenameinordertosendandreceivedata.
Forthis,wewillbeusingtheIMEIofourmodem,whichisuniquetoourmodem.
TodisplaytheIMEI,typethefollowingcommandintotheterminalprogram:AT+GSNfollowedbytheEnterkey,andtheterminalwillrespondwithsomethingsimilarto:xxxxxxxxxxxxxxxOKThenumbershouldbeidenticaltotheIMEIprintedonthetopofthemodemlabel.
3.
3.
InitiateSocketDialUsingthesyntaxdescribedinSection2.
3,typethefollowingcommandintotheterminalprogram:AT#SD=1,0,80,"dweet.
io"followedbytheenterkey,andtheterminalprogramshouldrespondwithCONNECTInthiscase,1isthesocketweareusingontheSkywiremodem,0meansweareusingtheTCPtransmissionprotocol,80istheTCPportweareusing(TCPport80isusedforHTTP),anddweet.
ioisthehostnameweareconnectingto.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
93.
4.
SendDataviaHTTPUsingthesyntaxdescribedinstep2.
4,enterthefollowingcommandintotheterminalprogram:POST/dweet/for/xxxxxxxxxxxxxxxhello=worldHTTP/1.
1wherethestringofx'sisyourIMEIfromsetup3.
2,followedbytheenterkey.
PressCTRL+MCTRL+JCTRL+MCTRL+J,andafterashortdelaytheterminalprogramshouldrespondwithsomethingsimilarto:HTTP/1.
1200OKAccess-Control-Allow-Origin:*Content-Type:application/jsonContent-Length:150Date:[today'sdate]Connection:keep-alive{"this":"succeeded","by":"dweeting","the":"dweet","with":{"thing":"xxxxxxxxxxxxxxx","created":"[today'sdate]","content":{"hello":"world"}}}wherexxxxxxxxxxxxxxxisyourIMEI.
Bygoingtothewebsitehttps://dweet.
io/get/latest/dweet/for/xxxxxxxxxxxxxxx,replacingthex'sattheendwithyourIMEI,youwillseethefollowingtext:{"this":"succeeded","by":"getting","the":"dweets","with":[{"thing":"xxxxxxxxxxxxxxx","created":"[today'sdate]","content":{"hello":"world"}}]}Thistextisthesameasthetextatthebottomoftheterminalresponse,indicatingasuccessfulHTTPtransaction.
3.
5.
ReceiveDataviaHTTPUsingthesyntaxdescribedinstep2.
5,enterthefollowingcommandintotheterminalprogram:GET/get/latest/dweet/for/xxxxxxxxxxxxxxxwherethestringofx'sisyourIMEIfromsetup3.
2,followedbytheenterkey.
PressCTRL+MCTRL+JCTRL+MCTRL+J,andafterashortdelaytheterminalprogramshouldrespondwithsomethingsimilarto:HTTP/1.
1200OKPN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
10Access-Control-Allow-Origin:*Content-Type:application/jsonContent-Length:152Date:[today'sdate]Connection:keep-alive{"this":"succeeded","by":"getting","the":"dweets","with":[{"thing":"xxxxxxxxxxxxxxx","created":"[today'sdate]","content":{"hello":"world"}}]}wherexxxxxxxxxxxxxxxisyourIMEI.
ThisindicatesthatwesuccessfullyreceivedtheHTTPinformation.
4.
Troubleshooting4.
1.
NewLine/CarriageReturnIfCTRL+MCTRL+Jdoesnotinsertthenecessarynewline/carriagereturncharacters,orifyourterminalprogramhandlesnewlinesdifferently,trypressingCTRL+JonlyinsteadofCTRL+MCTRL+J.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
115.
Appendix-SocketDialFlowCharts5.
1.
IntroductionNimbeLinkhascreatedexampleflowchartsforthesocketdialprocess,aswellaswhattodointheeventofafailure.
NimbeLinkrecommendsataminimumfollowingthesechartsandimplementingthenecessaryerrorhandling.
PleaseseetherespectiveATcommandmanualformoreinformationonATcommands.
PN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
125.
2.
NL-SW-HSPAFlowChartPN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
135.
3.
NL-SW-LTE-TSVG-xFlowChartPN30050rev10NimbeLinkCorp.
2019.
Allrightsreserved.
14
[六一云迎国庆]转盘活动实物礼品美国G口/香港CTG/美国T级超防云/物理机/CDN大促销六一云 成立于2018年,归属于西安六一网络科技有限公司,是一家国内正规持有IDC ISP CDN IRCS电信经营许可证书的老牌商家。大陆持证公司受大陆各部门监管不好用支持退款退现,再也不怕被割韭菜了!主要业务有:国内高防云,美国高防云,美国cera大带宽,香港CTG,香港沙田CN2,海外站群服务,物理机,...
收到10gbiz发来的7月份优惠方案,中国香港、美国洛杉矶机房VPS主机4折优惠码,优惠后洛杉矶VPS月付2.36美元起,香港VPS月付2.75美元起。这是一家2020年成立的主机商,提供的产品包括独立服务器租用和VPS主机等,数据中心在美国洛杉矶、圣何塞和中国香港。商家VPS主机基于KVM架构,支持使用PayPal或者支付宝付款。洛杉矶VPS架构CPU内存硬盘带宽系统价格单核512MB10GB1...
前天,还有在"Hostodo商家提供两款大流量美国VPS主机 可选拉斯维加斯和迈阿密"文章中提到有提供两款流量较大的套餐,这里今天看到有发布四款庆祝独立日的七月份的活动,最低年付VPS主机13.99美元,如果有需要年付便宜VPS主机的可以选择商家。目前,Hostodo机房可选拉斯维加斯和迈阿密两个数据中心,且都是基于KVM虚拟+NVMe整列,年付送DirectAdmin授权,需要发工单申请。(如何...
zzz13com为你推荐
sonicchat深圳哪里有卖汽车模型?今日油条天天吃油条,身体会怎么样www.jjwxc.net有那个网站可以看书?www.7788dy.comwww.tom365.com这个免费的电影网站有毒吗?avtt4.comCOM1/COM3/COM4是什么意思??/lcoc.topeagle solder stop mask top是什么层广告法中华人民共和国广告法中,有哪些广告不得发布?www.99vv1.comwww.in9.com是什么网站啊?www.dm8.cc有没有最新的日本动漫网站?www.javlibrary.com跪求一个JAVHD.com的帐号
php空间租用 187邮箱 香港服务器99idc windows主机 香港主机 香港托管 轻博客 抢票工具 地址大全 最好的免费空间 国外代理服务器软件 网通服务器托管 搜索引擎提交入口 免费私人服务器 万网空间管理 宏讯 秒杀品 空间服务器 深圳主机托管 广东服务器托管 更多