3G GPRS Error

Adafruit cellular platform - SMS and IoT over celluar

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
PabloOyarzo
 
Posts: 36
Joined: Sat Mar 01, 2014 7:42 am

3G GPRS Error

Post by PabloOyarzo »

What am I doing wrong?
Attachments
fona.png
fona.png (10.5 KiB) Viewed 384 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 3G GPRS Error

Post by adafruit_support_rick »

The FonaTest 'w' command doesn't work on the 3G. AT_HTTPTERM and AT_HTTPINIT are Fona 800/808 commands

User avatar
Tkall
 
Posts: 96
Joined: Wed Aug 19, 2015 10:11 pm

Re: 3G GPRS Error

Post by Tkall »

The FonaTest 'w' command doesn't work on the 3G. AT_
Wow....that could have been written in big red letters somewhere.

smgs
 
Posts: 194
Joined: Thu Dec 10, 2015 7:25 am

Re: 3G GPRS Error

Post by smgs »

I'm working on adapting this code to be something simple to do a get or post

Code: Select all

// *********************************
// Notes on the AT command functions
// sendReceiveATCommand function send a command to 3G module and only expect for a defined time and waits for the result.
// sendReceiveATCommand2 function send a command to 3G module and compare the result to a given string, when there's a match it stops waiting.
// *********************************


//Send URL Request

  Serial.println("\r\nChecking that things are set up now...\r\n"); 
  sendReceiveATCommand("AT+CREG?",2000);
  delay(1000);
  sendReceiveATCommand("AT+CGSOCKCONT=1,\"IP\",\"internet\"", 4000);  // Internet is for the optus WAN

  Serial.println("\r\nStarting to send commands...\r\n"); 
  sendReceiveATCommand2("AT+CHTTPACT=\"my.sqlserver\",80", "\r\n+CHTTPACT: REQUEST","\r\nERROR", 5000);
  delay(100);
  Serial.print("GET /mysqlserver.php?ID=");
  Serial.print(AssetID);
  Serial.print("&PH=");
  Serial.print(UserPhoneNumber);
  Serial.print(" HTTP/1.1\r\n");
  fonaSS.print("GET /mysqlserver.php?ID=");
  fonaSS.print(AssetID);
  fonaSS.print("&PH=");
  fonaSS.print(UserPhoneNumber);
  fonaSS.print(" HTTP/1.1\r\n");
  delay(100);
  Serial.print("Host: my.sqlserver\r\n");
  fonaSS.print("Host: my.sqlserver\r\n");

  delay(100);
  Serial.print("Connection: close\r\n\r\n");
  fonaSS.print("Connection: close\r\n\r\n");
  delay(100);
  fonaSS.write(0x1A);
  delay(100);

} // end of sendPHP


//////////////////////////////////////////////////////
// sendReceiveATCommand function send a command to 3G module and only expect for a defined time and waits for the result.

String sendReceiveATCommand(const char *toSend, unsigned long milliseconds) 
{
  String result;
  Serial.print("Sending: ");
  Serial.println(toSend);
  fonaSS.println(toSend);
  unsigned long startTime = millis();
  Serial.print("Received: ");
  while (millis() - startTime < milliseconds) 
  {
    if (fonaSS.available()) 
    {
      char c = fonaSS.read();
      Serial.write(c);
      result += c;  // append to the result string
    } // end of if (fonaSS.available()) 
  } // end of while (millis() - startTime < milliseconds) 
  
Serial.println();  // new line after timeout.
return result;
} // end of string


//////////////////////////////////////////////////////
// sendReceiveATCommand2 function send a command to 3G module and compare the result to a given string, when there's a match it stops waiting.

String sendReceiveATCommand2(const char *toSend, const char *toCheck1, const char *toCheck2, unsigned long milliseconds) 
{
  char answer_check [3];
  String result;
  char result_char[50];
  Serial.print("Sending: ");
  Serial.println(toSend);
  fonaSS.println(toSend);
  unsigned long startTime = millis();
  Serial.print("Received: ");
  while (millis() - startTime < milliseconds) 
  {
    if (fonaSS.available()) 
    {
      char c = fonaSS.read();
      Serial.write(c);
      result += c;  // append to the result string
      result.toCharArray(result_char, 50);
      if(strcasestr(result_char,toCheck1) || strcasestr(result_char,toCheck2))
      {
        milliseconds = 0;
      } // end of if(strcasestr(result_char,toCheck1) || strcasestr(result_char,toCheck2))
    } // if (fonaSS.available())     
  } // end of while (millis() - startTime < milliseconds) 
  
Serial.println();  // new line after timeout.
return result;
} // end of string

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 3G GPRS Error

Post by adafruit_support_rick »

Tkall wrote:
The FonaTest 'w' command doesn't work on the 3G. AT_
Wow....that could have been written in big red letters somewhere.
Sorry. It does actually warn of this on the product page:
Please note! We've had a lot of requests for a 3G cell module and we're happy to oblige but this module has many small differences between it and the FONA 800 and 808, so it is not a drop-in replacement! In particular the data functionality is not as easy to use. We are adapting our FONA library to support the 3G chipset and right now we have SMS, calling, and basic functionality working but it will be a while until we get full GPRS TCP/IP and HTTP support. Also, the GPS is not as fast and low-power as the one on the FONA 808. We recommend this module for people who are able to handle a more advanced experience. Beginners will like our FONA 80x series more.

User avatar
Tkall
 
Posts: 96
Joined: Wed Aug 19, 2015 10:11 pm

Re: 3G GPRS Error

Post by Tkall »

Is the 800 series 2G?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 3G GPRS Error

Post by adafruit_support_rick »

Tkall wrote:Is the 800 series 2G?
Yes.

User avatar
Tkall
 
Posts: 96
Joined: Wed Aug 19, 2015 10:11 pm

Re: 3G GPRS Error

Post by Tkall »

The 800 series is 2G and the 2G networks are shutting down. I was using Cricket Wireless and they recently discontinued 2G service so I bought a bunch of the 3G FONA's. I understand the library is in development but I wonder if any progress is being made or if Adafruit did just enough work to bring the 3G to market and then stopped working on it.

Sure I would rather use the box of 800's I already have but I don't have access to the 2G network any longer. So some of us have no choice but to use the 3G FONA and it is tricky trying to plan jobs with vague statements such as:

"it will be a while until we get full GPRS TCP/IP and HTTP support."

User avatar
adafruit2
 
Posts: 22200
Joined: Fri Mar 11, 2005 7:36 pm

Re: 3G GPRS Error

Post by adafruit2 »

there is no ETA - the 3G modules from SIMCOM are not easy to use, we haven't found a good way to add all support!

User avatar
Tkall
 
Posts: 96
Joined: Wed Aug 19, 2015 10:11 pm

Re: 3G GPRS Error

Post by Tkall »

And there you have it boys and girls, we are on our own.

User avatar
adafruit2
 
Posts: 22200
Joined: Fri Mar 11, 2005 7:36 pm

Re: 3G GPRS Error

Post by adafruit2 »

hiya - tkall, please email support@adafruit for a refund on this module. we have no other 3G module at this time.

User avatar
Tkall
 
Posts: 96
Joined: Wed Aug 19, 2015 10:11 pm

Re: 3G GPRS Error

Post by Tkall »

I don't want a refund....I just don't want to work any harder than I have to.

smgs
 
Posts: 194
Joined: Thu Dec 10, 2015 7:25 am

Re: 3G GPRS Error

Post by smgs »

Would it be possible to get a breakdown of where the development is up to and the current stumbling blocks?

Locked
Please be positive and constructive with your questions and comments.

Return to “FONA”