I have a bit of a puzzle brewing with the (awesome) Adafruit CC3000 breakout board. I was originally working with it paired with an Arduino UNO while trying to get the Xively http://learn.adafruit.com/adafruit-cc30 ... and-xively example up, running and stable. I had no compile issues and everything started off working well. I rather quickly found that shortly, but not as predictably soon, as the serial (via USB) is disconnected the Arduino seems to hang/freeze.
I was reading what I could find that seemed on topic, hoping not to have to trouble anyone else with my problem, and thought that perhaps I was running out of SRAM. Believing that may be the problem, I swapped out the Arduino UNO with a PJRC Teensy 3. There are two reasons I did this, one being the capabilities of the Teensy 3 (faster, larger flash program size, more interrupts etc) the other is the roughly 6.5 times SRAM available. Unfortunately the problem persists: It will run well indefinitely (hours at least) while connected to USB/serial; if it is separately powered, when the USB is disconnected, it will continue to put sensor readings to Xively for anywhere from 10 mins to 2 hours; if started straight from external power it will run for between 5 mins and an hour.
With the Teensy 3, the compile output is:
Binary sketch size: 28,388 bytes (of a 131,072 byte maximum)
Estimated memory use: 3,944 bytes (of a 16,384 byte maximum)
With an UNO, the output is:
Binary sketch size: 24,072 bytes (of a 32,256 byte maximum)
There's a good chance I've got something messed up somewhere although I've followed the example exactly as presented in the tutorial (coincidentally I'm looking to monitor temperature and humidity along with a number of other things, but I started with the example as is; all I've changed in the main code is the WLAN_SSID, WLAN_PASS, API_KEY & feedID). To get the DHT11 working with the TEENSY 3 I had to modify a delay in DHT.cpp as suggested and verified on the PJRC forum. This involved changing line ~120 from delayMicroseconds(1) to delayMicroseconds(4). http://forum.pjrc.com/threads/16806-T3- ... 0no%20time.
I realize this question is sort of wordy and long-winded; just wanted to make sure I put in all the pertinent details.
Many thanks in advance!
Please let me know if there is any other info I can provide that could help resolve this problem.
<edit>
I have now seen it hang while connected to USB / Serial with a monitor window open here's the output (I've removed the SSID, API Key, the Feed ID and the Request ID; I can add them but I don't think they are causing the problem as it does work some of the time):
(Normal serial returns are before this)
I hope this is not something to do with the CC3000 as I really like it so far (except for the obvious) and have 2 more shipping to me this week.Started AP/SSID scan
Connecting to (SSID removed)...Waiting to connect...Connected!
Request DHCP
api.xively.com -> 216.52.233.120Data length128
PUT /v2/feeds/(Feed removed).json HTTP/1.0
Host: api.xively.com
X-ApiKey: (API Key removed)
Content-Length: 128
Connection: close
{"version":"1.0.0","datastreams" : [ {"id" : "Temperature","current_value" : "64"},{"id" : "Humidity","current_value" : "35"}]}
Connect to 216.52.233.120:80
Connected!
-------------------------------------
HTTP/1.1 200 OK
Date: Tue, 26 Nov 2013 03:32:02 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 0
Connection: close
X-Request-Id: (ID Removed)
Cache-Control: max-age=0
Vary: Accept-Encoding
-------------------------------------
Disconnecting
Started AP/SSID scan
Connecting to Brackass...Waiting to connect...Connected!
Request DHCP
api.xively.com -> Couldn't resolve!
Couldn't resolve!
Couldn't resolve!
Couldn't resolve!
Couldn't resolve!
Couldn't resolve!
Couldn't resolve!
Couldn't resolve!
Couldn't resolve!
(and this continues endlessly)
</edit>
lax.ste