CC3000 Wifi: Enable Debug How do I enable debugging using Adafruit CC3000?

I am using the Adafruit_CC3000_Library.  I've followed the WebClient.ino example sketch.  I'm able to make 300 to 400 HTTP requests, but eventually the connection will hang.

I have looked at the CC3000 source and utilities and found that the Adafruit_CC3000_Library has a &amp;Printer reference in a local variable called CC3KPrinter.  I can't figure out how to enable or activate CC3KPrinter, as it is in a code block contingent on CHECK_PRINTER.  I thought that #define-ing some variables in my sketch would help:

// None of these flags seem to enable debug within the CC3000 code.
#define _CC3000_DEBUG  1
#define DEBUG_MODE     1
#define ENABLE_CC3K_PRINTER 1


An example code snippet within the CC3000 library that I'm trying to enable is at line 916:

  CHECK_PRINTER {
    CC3KPrinter-&gt;println(F("Timed out waiting to connect"));
  }
To enable debugging, you need to 


uncomment ENABLE_CC3K_PRINTER in Adafruit_CC3000.h
If you want to pass in some debug stream other than the default Serial, you should pass a pointer to the object (which should inherit from Print, such as SD or Client) as the last argument to the constructor in your sketch:

Adafruit_CC3000(uint8_t csPin, uint8_t irqPin, uint8_t vbatPin, uint8_t spispeed = SPI_CLOCK_DIVIDER, Print* cc3kPrinter = CC3K_DEFAULT_PRINTER);

In utility/debug.h, change the value of DEBUG_MODE to 1 (or any non-zero value)


I don't know what caused your issue but you shouldn't put this in your code:

#define _CC3000_DEBUG  1


Because most of utility/debug.h is wrapped in the usual:

#ifndef _CC3000_DEBUG
.
.
.
#endif


Your #define, depending on where it's placed, could cause most of the file to be skipped by the compiler and result in compilation errors. To be on the safe side, get rid of it and simply include utility/debug.h as needed.