Hard character limit on CC3300 fastrprint function?

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
huertanix
 
Posts: 3
Joined: Sun Aug 28, 2011 1:07 am

Hard character limit on CC3300 fastrprint function?

Post by huertanix »

I'm running into an issue where my sketch will fail silently when I try to call a node app another person hosts, with some long URL parameter values. tl;dr:

Code: Select all

if (www.connected()) {
    Serial.println(F("Sending temperature reading to The Cloud..."));
    www.fastrprint(F("GET "));
    www.fastrprint(char_array_with_long_parms);
    www.fastrprint(F(" HTTP/1.1\r\n"));
    www.fastrprint(F("Host: ")); www.fastrprint("www.somewebsite.com"); www.fastrprint(F("\r\n"));
    www.fastrprint(F("\r\n"));
    www.println();
    Serial.println(F("Sent."));
  } else {
    Serial.println(F("Connection failed"));
    return;
  }
It never makes it to "Sent" and "Connection failed" never shows up either. It just fails silently.

char_array_with_long_parms is usually 289 chars. When I changed the parameters to be much shorter though (8 chars is what I tested with), the call succeeds (although doesn't log data on the site backend, of course). There's no web standard on URL sizing, and most browsers and servers can handle URL sizes in the thousands. Why am I unable to call a URL with under 300 chars?

User avatar
huertanix
 
Posts: 3
Joined: Sun Aug 28, 2011 1:07 am

Re: Hard character limit on CC3300 fastrprint function?

Post by huertanix »

Looking at the Adafruit CC3300 library, it looks like there's a limit being set on the character buffer at 32 chars? Should that really limit the GET request length though?

In Adafruit_CC3000.h:

Code: Select all

#define TXBUFFERSIZE  32 // how much to buffer on the outgoing side
TXBUFFERSIZE is being referenced in Adafruit_CC3000_Client::fastrprint in Adafruit_CC3000.cpp but I don't know C++.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Hard character limit on CC3300 fastrprint function?

Post by adafruit_support_mike »

The buffer size limit doesn't put any limits on the size of the GET request. You just have to break the request string into 32-byte pieces.

Officially, a GET request is limited to a 1024-character URL. That's half of an Uno's memory though, and wouldn't leave room for any other code to run.

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

Return to “Arduino Shields from Adafruit”