0
\$\begingroup\$

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

Serial.println("Read Response");
mySerial.println("AT+QHTTPREADS=30");

// 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?
\$\endgroup\$
  • \$\begingroup\$ Does your modem have an IP address? \$\endgroup\$ – jippie Sep 28 '13 at 16:15
  • \$\begingroup\$ 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 \$\endgroup\$ – andrebruton Sep 30 '13 at 13:22
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – jippie Sep 30 '13 at 18:49
  • \$\begingroup\$ 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. \$\endgroup\$ – andrebruton Oct 19 '13 at 4:34
  • \$\begingroup\$ 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. \$\endgroup\$ – user39389 Mar 27 '14 at 21:08
1
\$\begingroup\$

It will work,

first of all you have to set the access point called APN. Then Also you should use AT+QHTTPREAD instead AT+QHTTPREADS which is wrong command.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.