CC3000 restarts when adding "#include <SD.h>" to example ske

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
420gandhi
 
Posts: 4
Joined: Wed Sep 10, 2014 9:48 pm

CC3000 restarts when adding "#include <SD.h>" to example ske

Post by 420gandhi »

I would like to use the CC3000's SD card slot when running the HTTPServer sketch.

The example sketch runs fine itself:

Code: Select all

Hello, CC3000!

Free RAM: 821

Initializing...

Attempting to connect to myWifi
Connected!
Request DHCP

IP Addr: 192.168.1.3
Listening for connections...
Client connected.
Processing request
Action: GET
Path: /
Client disconnected

But when I include the one line "#include <SD.h>", each time I try to navigate to the ip address in my browser, the arduino restarts itself:

Code: Select all

Hello, CC3000!

Free RAM: 215

Initializing...

Attempting to connect to myWifi
Connected!
Request DHCP

IP Addr: 192.168.1.3
Listening for connections...
Hello, CC3000!

Free RAM: 215

Initializing...

Attempting to connect to myWifi
Connected!
Request DHCP

IP Addr: 192.168.1.3
Listening for connections...
Hello, CC3000!

Free RAM: 215

Initializing...

Attempting to connect to myWifi
Connected!
Request DHCP
That is the only change I make to the script. I notice that Ram moves from 800~ to 200~.
I checked my soldering and I don't think that that is a problem...
http://i.imgur.com/HYnYNKc.jpg
http://i.imgur.com/eAFclVT.jpg
http://i.imgur.com/u2uHTht.jpg
Any thoughts?

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

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by adafruit_support_mike »

That sounds like a power issue. What are you using as a power supply?

User avatar
420gandhi
 
Posts: 4
Joined: Wed Sep 10, 2014 9:48 pm

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by 420gandhi »

I'm been powering it from the USB cable from my computer. I've read elsewhere sometimes this can be a problem but I want to look at the serial output at the same time...

User avatar
Franklin97355
 
Posts: 23938
Joined: Mon Apr 21, 2008 2:33 pm

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by Franklin97355 »

Try using a powered hub or a AC power brick (7.5 - 9.0 VDC)

User avatar
DigitalCowboy
 
Posts: 22
Joined: Sat Apr 05, 2014 9:05 pm

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by DigitalCowboy »

franklin97355 wrote:Try using a powered hub or a AC power brick (7.5 - 9.0 VDC)
Specifically a power source that can supply 1A or more.

"Make sure your Arduino is powered by a 1 amp or higher rated external power supply
when using with the CC3000! Powering an Arduino + CC3000 from a computer/laptop
USB port will lead to unstable behavior and lockups because the USB port can't supply
enough power!"

User avatar
420gandhi
 
Posts: 4
Joined: Wed Sep 10, 2014 9:48 pm

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by 420gandhi »

I switched to a 9v, 1A power supply and the Arduino still appears to be restarting when I add the line "#include <SD.h>".

The restarting happens during the "listening for connections" serial output.

Code: Select all

Hello, CC3000!

Free RAM: 205

Initializing...

Attempting to connect to Forbidden_Forest
Connected!
Request DHCP

IP Addr: 192.168.1.3
Listening for connectYns...
Hello, CC3000!

Free RAM: 205

Initializing...

Attempting to connect to Forbidden_Forest

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

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by adafruit_support_mike »

Try removing the "#include <SD.h>" line and adding another copy of the line that checks the free RAM after the CC3000 makes its connection to the network.

User avatar
420gandhi
 
Posts: 4
Joined: Wed Sep 10, 2014 9:48 pm

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by 420gandhi »

Here is the serial output with the "#include <SD.h>" removed. The RAM stays the same at 811. The code works well and I see the "hello world" message when I navigate to 192.168.1.3 in my browser.

Code: Select all

Free RAM: 811

Initializing...

Attempting to connect to Forbidden_Forest
Connected!
Request DHCP

IP Addr: 192.168.1.3
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DHCPsrv: 192.168.1.1
DNSserv: 192.168.2.1
Free RAM: 811

NOTE: This sketch may cause problems with other sketches
since the .disconnect() function is never called, so the
AP may refuse connection requests from the CC3000 until a
timeout period passes.  This is normal behaviour since
there isn't an obvious moment to disconnect with a server.

Listening for connections...
Client connected.
Processing request
Action: GET
Path: /
Client disconnected
Client connected.
Processing request
Action: GET
Path: /favicon.ico
Client disconnected
And here is it with the "#include <SD.h>" line added. RAM stays the same at 205 but the code still seems to restart itself :( Navigating to 192.168.1.3 in my browser does not work.

Code: Select all

Hello, CC3000!

Free RAM: 205

Initializing...

Attempting to connect to Forbidden_Forest
Connected!
Request DHCP

IP Addr: 192.168.1.3
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DHCPsrv: 192.168.1.1
DNSserv: 192.168.2.1
Free RAM: 205

NOTE: This sketch may cause problems with other sketches
since the .disconnect() function is never called, so the
AP may refuse connection requests from the CC3000 until a
timeout period passes.  This is normal behaviour since
there isn't an obvious moment to disconnect with a server.

Listening™or connections...
Hello, CC3000!

Free RAM: 205

Initializing...

Attempting to connect to Forbidden_Forest
Connected!
Request DHCP

IP Addr: 192.168.1.3
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DHCPsrv: 192.168.1.1
DNSserv: 192.168.2.1
Free RAM: 205

NOTE: This sketch may cause problems with other sketches
since the .disconnect() function is never called, so the
AP may refuse connection requests from the CC3000 until a
timeout period passes.  This is normal behaviour since
there isn't an obvious moment to disconnect with a server.

Listening™or connections...
 

Also I'm using an Arduino UNO, and I have not soldered the three MOSI SCK MISO tabs on the bottom of the CC3000. Does this information help?

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

Re: CC3000 restarts when adding "#include <SD.h>" to example

Post by adafruit_support_mike »

WRT the SPI connections, could you post a photo of your hardware please? That kind of thing is easier to show than to explain.

WRT the output from the sketch, this line looks suspicious:

Code: Select all

Listening™or connections...
Something is causing a glitch in the Serial output buffer. Try adding a couple more calls to freeRAM() before and after the line which prints that output.

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

Return to “Other Arduino products from Adafruit”