# Correct AT Commands sequence for Quectel M95 GSM module

I have easily managed to connect the M95 GSM module to an Arduino and can communicate. I want to have a very basic way of posting data to a website from the Arduino. It seems the AT commands are suppose to be easy to use.

I can send basic commands like AT etc very easy and get the reply. Now I want to post data and it does not work. Here is the sequence I use, in Arduino code:

Serial.println("Talking to Modem: AT");
mySerial.println("AT");
delay(1000);

// I get correct response: OK

Serial.println("Check if SIM is locked");
mySerial.println("AT+CPIN?");
delay(1000);

// I get correct response: +CPIN: READY

Serial.println("Setting up URL");
mySerial.println("AT+QHTTPURL=31,30");
mySerial.println("www.somedomain.co.za/api/");
delay(2000);

// I get response: OK. Not too sure if the /api/ must be in the URL

Serial.println("Sending Data");
mySerial.println("AT+QHTTPPOST=31,30,10");
mySerial.println("usersID=2");
delay(2000);

// Get the response: CONNECT

// Get the response: CME ERROR: 3 (Cause for PPP/IP Stack)


I'm not too sure what next to do:

1. Why do I have to send string lengths before I post the URL? Why can't I just post the complete URL? Is there an AT command to just post an URL?
• Does your modem have an IP address? – jippie Sep 28 '13 at 16:15
• I guess so. It should get an IP address when it connects to the network. I'm not too concerned about that side. The indicator light shows it has connected to the network. I'm just battling to find an easy way, using an AT command, to POST or GET data to a website – andrebruton Sep 30 '13 at 13:22
• Don't assume. If the modem supports IP connectivity, you can query the IP address and netmask. You should probably be able to ping another host too. – jippie Sep 30 '13 at 18:49
• The modem works fine. I found out the standard Arduino GSM library works well with the modem. No need to re-invent the wheel, but I would still like to find out how to use AT commands on the modem. – andrebruton Oct 19 '13 at 4:34
• You might try examples from Quectel's site under HTTP_AT_Commands....pdf or something like this. And I suggest you to check your website. If you are using php and something based on \$_GET['usersID'] then you might use HTTP GET example not POST. It will work. – user39389 Mar 27 '14 at 21:08