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

这几个Vultr VPS主机商家的优点造就商家的用户驱动力

目前云服务器市场竞争是相当的大的,比如我们在年中活动中看到各大服务商都找准这个噱头的活动发布各种活动,有的甚至就是平时的活动价格,只是换一个说法而已。可见这个行业确实竞争很大,当然我们也可以看到很多主机商几个月就消失,也有看到很多个人商家捣鼓几个品牌然后忽悠一圈跑路的。当然,个人建议在选择服务商的时候尽量选择老牌商家,这样性能更为稳定一些。近期可能会准备重新整理Vultr商家的一些信息和教程。以前...

RackNerd提供四款高配美国服务器促销活动低至月$189

RackNerd 商家给的感觉就是一直蹭节日热点,然后时不时通过修改配置结构不断的提供低价年付的VPS主机,不过他们家还是在做事的,这么两年多的发展,居然已经有新增至十几个数据中心,而且产品线发展也是比较丰富。比如也有独立服务器业务,不过在他们轮番的低价年付VPS主机活动下,他们的服务器估摸着销路不是太好的。这里,今天有看到RackNerd商家的独立服务器业务有促销。这次提供美国多个机房的高配独立...

PQS彼得巧 年中低至38折提供台湾彰化HiNet线路VPS主机 200M带宽

在六月初的时候有介绍过一次来自中国台湾的PQS彼得巧商家(在这里)。商家的特点是有提供台湾彰化HiNet线路VPS主机,起步带宽200M,从带宽速率看是不错的,不过价格也比较贵原价需要300多一个月,是不是很贵?当然懂的人可能会有需要。这次年中促销期间,商家也有提供一定的优惠。比如月付七折,年付达到38折,不过年付价格确实总价格比较高的。第一、商家优惠活动年付三八折优惠:PQS2021-618-C...

zzz13com为你推荐
leavemealone女孩说leave me alone还有戏吗?求帮助permissiondenied求问permission denied是什么意思啊?h连锁酒店全国比较有名的连锁酒店?硬盘的工作原理简述下硬盘的工作原理?中老铁路中国有哪些正在修的铁路梦之队官网NBA梦之队是什么游戏?百度商城百度商城里抽奖全是假的广东GDP破10万亿在已披露的2017年GDP经济数据中,以下哪个省份GDP总量排名第一?甲骨文不满赔偿公司倒闭员工不满一年怎么赔偿bbs.99nets.com送点卷的冒险岛私服
网站域名 个人虚拟主机 域名中介 已备案未注册域名 网通服务器租用 出租服务器 韩国俄罗斯 2014年感恩节 gitcafe 512m evssl证书 hinet 域名和空间 Updog 新世界服务器 闪讯官网 香港亚马逊 阿里云邮箱申请 hdsky japanese50m咸熟 更多