AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET
AT commands to do HTTP GET AT commands to do HTTP GET
AT commands to do HTTP GET
Go Back  Xtreme Visual Basic Talk > > > AT commands to do HTTP GET


Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2010, 05:46 PM
mshamblott mshamblott is offline
Newcomer
 
Join Date: Sep 2010
Posts: 2
Default AT commands to do HTTP GET


I'm having trouble with a VB.NET application that is supposed to communicate with a cell phone. The phone has a dataplan and I can send phone calls and sms without a problem. I want to connect to an internet resource called Interfax so that I send my account text and interfax sends it as a FAX to the specified number. I have an account and have confirmed with the company that this strategy SHOULD work.

I use MSComm.Output commands to send the strings below. The indented lines are responses from ATT and Interfax. I have changed the number, username, password and return IP but other than that this is exactly what I try to send. I have confirmed with the company that the & should be inside the string quote (ie "&Password")


AT+CGDCONT=1,IP,WAP.CINGULAR
AT#USERID=WAP@CINGULARGPRS.COM
AT#PASSW=CINGULAR1
AT#GPRS=0
AT#GPRS=1
+IP:10.28.198.143
AT#sktd=0,80,ws.interfax.net
CONNECT
GET /dfs.asmx/SendCharFax?Username=XX123&Password=XX123&FaxNumber=0014100000000&Data =TEST-FAX&FileType=TXT
HTTP/1.1"& vbCrLf & "Host: ws.interfax.net" & vbCrLf


Here is a code sample used to send the final GET.

TextToSend = "TEST-FAX"
Dim faxmess As String = "GET /dfs.asmx/SendCharFax?Username=" & username & "&Password=" & password & "&FaxNumber=" & "001" & FAXnum & "&Data=" & TextToSend & "&FileType="TXT" & "HTTP/1.1" & vbCrLf
faxmess = faxmess & "Host: ws.interfax.net" & vbCrLf
AxMSComm2.Output = faxmess


The problem comes with the get command. I've tried leaving off the CrLf or
changing it to Cr only. I think the "Host: ws....." might be the problem since
when i type directly into hyperterminal then hit enter after the HTTP:/1.1 I get the same bad request error.

I know this is a long post but i'm hoping one the VB gurus I read on this site would be willing to help out a struggling newbie. If there is a more modern way to address cell phone/modems by AT command i'd like to hear about that too-but this should work!

:confused
Reply With Quote
  #2  
Old 09-16-2010, 01:10 AM
GraniteGuy GraniteGuy is offline
Newcomer
 
Join Date: Sep 2010
Location: Manchester
Posts: 6
Default

May not help, but there are two things I would suggest:

1. Try HTTP 1.0 instead of 1.1 - I can't remember the reason why, but I spent countless hours before I found this out.

2. Look into using .Net classes rather than MSComm. If nothing else, I think you will get more people able to help.
Reply With Quote
  #3  
Old 09-16-2010, 09:48 AM
AtmaWeapon's Avatar
AtmaWeaponAT commands to do HTTP GET AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

I'm pretty sure HTTP 1.1 requires that the last line of the request is a blank line. Try adding an extra CRLF to the end. If that doesn't work, I dunno; you might want to look for a forum that specializes in cell phone communications, talk to the manufacturer of what you're using to connect to the cell phone, contact the data provider, etc.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #4  
Old 09-17-2010, 02:19 PM
mshamblott mshamblott is offline
Newcomer
 
Join Date: Sep 2010
Posts: 2
Default 2 VbCrLf was the answer

Thanks,
A second VbCrLf was required. No change in HTTP 1.1 needed!
Reply With Quote
Reply

Tags
at command, http get, mscomm


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET AT commands to do HTTP GET
AT commands to do HTTP GET
AT commands to do HTTP GET
 
AT commands to do HTTP GET
AT commands to do HTTP GET
 
-->