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
Hostodo近日发布了美国独立日优惠促销活动,主要推送了四款特价优惠便宜的VPS云服务器产品,基于KVM虚拟架构,NVMe阵列,1Gbps带宽,默认分配一个IPv4+/64 IPv6,采用solusvm管理,赠送收费版DirectAdmin授权,服务有效期内均有效,大致约为7折优惠,独立日活动时间不定,活动机型售罄为止,有需要的朋友可以尝试一下。Hostodo怎么样?Hostodo服务器好不好?...
georgedatacenter怎么样?georgedatacenter这次其实是两个促销,一是促销一款特价洛杉矶E3-1220 V5独服,性价比其实最高;另外还促销三款特价vps,大家可以根据自己的需要入手。georgedatacenter是一家成立于2019年的美国vps商家,主营美国洛杉矶、芝加哥、达拉斯、新泽西、西雅图机房的VPS、邮件服务器和托管独立服务器业务。georgedatacen...
提速啦的来历提速啦是 网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑 由赣州王成璟网络科技有限公司旗下赣州提速啦网络科技有限公司运营 投资1000万人民币 在美国Cera 香港CTG 香港Cera 国内 杭州 宿迁 浙江 赣州 南昌 大连 辽宁 扬州 等地区建立数据中心 正规持有IDC ISP CDN 云牌照 公司。公司购买产品支持3天内退款 超过3天步退款政策。提速啦的市场定位提速啦主...
zzz13com为你推荐
安徽汽车网在安徽那个市的二手车最好?甲骨文不满赔偿不签合同不满一年怎么补偿刘祚天Mc浩然的资料以及百科谁知道?百度关键词价格查询百度关键词排名价格是多少同一服务器网站同一服务器上可以存放多个网站吗?8090lu.com《8090》节目有不有高清的在线观看网站啊?抓站工具抓鸡要什么工具?kb123.net股市里的STAQ、NET市场是什么?www4399com4399是什么网站啊???www.175qq.com请帮我设计个网名
国外空间租用 深圳域名空间 香港vps主机 中文域名申请 谷歌域名邮箱 轻博客 轻量 英文站群 52测评网 智能骨干网 dd444 中国电信测速112 架设服务器 七夕促销 789电视网 亚马逊香港官网 vip购优惠 服务器监测 卡巴斯基免费试用版 西安主机 更多