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

远程登录VNC无法连接出现

今天有网友提到自己在Linux服务器中安装VNC桌面的时候安装都没有问题,但是在登录远程的时候居然有出现灰色界面,有三行代码提示"Accept clipboard from viewers,Send clipboard to viewers,Send primary selection to viewers"。即便我们重新登录也不行,这个到底如何解决呢?这里找几个可以解决的可能办法,我们多多尝试。...

CYUN(29元/月)美国、香港、台湾、日本、韩国CN2,续费原价

关于CYUN商家在之前有介绍过一次,CYUN是香港蓝米数据有限公司旗下的云计算服务品牌,和蓝米云、蓝米主机等同属该公司。商家主要是为个人开发者用户、中小型、大型企业用户提供一站式核心网络云端部署服务,促使用户云端部署化简为零,轻松快捷运用云计算。目前,CYUN主要运营美国、香港、台湾、日本、韩国CN2线路产品,包括云服务器、站群服务器和独立服务器等。这次看到CYUN夏季优惠活动发布了,依然是熟悉的...

80VPS:香港服务器月付420元;美国CN2 GIA独服月付650元;香港/日本/韩国/美国多IP站群服务器750元/月

80vps怎么样?80vps最近新上了香港服务器、美国cn2服务器,以及香港/日本/韩国/美国多ip站群服务器。80vps之前推荐的都是VPS主机内容,其实80VPS也有独立服务器业务,分布在中国香港、欧美、韩国、日本、美国等地区,可选CN2或直连优化线路。如80VPS香港独立服务器最低月付420元,美国CN2 GIA独服月付650元起,中国香港、日本、韩国、美国洛杉矶多IP站群服务器750元/月...

zzz13com为你推荐
neworiental我国最好的英语学校是在哪里?access数据库什么是ACCESS数据库sss17.com为什么GAO17.COM网站打不开了51sese.comwww.51xuanh.com这是什么网站是骗人的吗?yinrentangweichentang产品功效好不好?dadi.tv海信电视机上出现英文tvservice是什么意思?汴京清谈求好看的鼠猫文~官人放题戴望舒的《狱中题壁》彪言彪语寻找一个电影和里面的一首歌,国产的,根据真实故事改编的校园爱情电影,里面的男主角是个屌丝但很会弹钢4399宠物连连看2.5我是华为手机,想下载宠物连连看2.5单机游戏
me域名注册 qq空间域名 息壤主机 万网优惠券 最好的空间 韩国网名大全 qq数据库下载 天互数据 linux空间 帽子云 徐正曦 服务器干什么用的 web服务器安全 网页提速 cxz 谷歌台湾 免费蓝钻 免备案jsp空间 web是什么意思 机柜尺寸 更多