CC3000 Hang/reset

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
cododd
 
Posts: 3
Joined: Wed Feb 12, 2014 11:01 am

CC3000 Hang/reset

Post by cododd »

I'm using a brand-new CC3000 breakout with an Arduino Mega. The CC3000 is running firmware version 1.24 and the latest adafruit library.

I'm using the module to read in a string from a client and respond with an NMEA sentence from a GPS. I can read and write the data fine, but immediately after writing the NMEA string the CC3000 hangs. Usually it will reset after being frozen for a minute, which makes it useless for any real-time data acquisition. this happens every time I write a long NMEA string.

I suspected SRAM could be an issue, but when I run the exact same code but printing to the Serial port instead of the CC3000, it works just fine.

I then ran the echo server example included in the adafruit library, completely unmodified. I had the client continuously send a 10-byte message. The arduino will correctly receive and retransmit the message three times before the CC3000 hangs and resets again. This happens every time regardless of the interval between sending the initial messages.

The wifi signal is very strong in this area, and when the CC3000 does transmit it does so quickly and correctly. So what can I do to stop this hanging/resetting behavior?

User avatar
tdicola
 
Posts: 1074
Joined: Thu Oct 17, 2013 9:11 pm

Re: CC3000 Hang/reset

Post by tdicola »

How quickly are you having clients send messages to the echo server example? There's an issue we've been tracking down here https://github.com/adafruit/Adafruit_CC ... /issues/51 where if you continually send data too quickly the CC3000 will run out of buffers and hang. There's a workaround to use a non-blocking send mode, but it requires delaying after you send any message. Ultimately there's a limit to how fast data can be sent before the CC3k can't keep up and has to start dropping packets.

For the send issue, how long is the NMEA sentence you're sending, and is it all going in a single request? Unfortunately you can only send a few hundred bytes at a time before the send buffer is full and you get lockups. Try sending the message in chunks of about 100 bytes at a time.

User avatar
cododd
 
Posts: 3
Joined: Wed Feb 12, 2014 11:01 am

Re: CC3000 Hang/reset

Post by cododd »

I tried a number of speed ranges, from as fast as the labView client could cycle to a 50ms repeat, 100ms, 250, 500, and eventually 1 and 2 second intervals. All of them had the same behavior. Three responses and then a hangup. I also tried breaking the NMEA sentence, (which is quite large), into 50 byte segments and printing one segment per cycle. It still froze after the first transmission, though the entire segment did go through.

User avatar
tdicola
 
Posts: 1074
Joined: Thu Oct 17, 2013 9:11 pm

Re: CC3000 Hang/reset

Post by tdicola »

I have a feeling you're hitting the same issue of cc3k buffers not being available and the driver blocking indefinitely. To try this workaround, open socket.cpp in the utility folder and add this line near the top with other defines:

#define SEND_NON_BLOCKING 1

Then in your sketch code, after every fastrprint or fastrprintln add a small delay like delay(5). This is to give the cc3k time to send the message--sends are asynchronous and actually get queued up internally with the cc3k from what I understand. Don't use the print or println functions on the client instance since they'll write a character at a time without any delays and characters will be dropped.

User avatar
cododd
 
Posts: 3
Joined: Wed Feb 12, 2014 11:01 am

Re: CC3000 Hang/reset

Post by cododd »

That did the trick! Both sketches run perfectly now!

Thanks for your help, it's much appreciated

User avatar
mackr21
 
Posts: 5
Joined: Wed Mar 25, 2015 2:30 pm

Re: CC3000 Hang/reset

Post by mackr21 »

Has there been any development on this issue? I'm struggling with this on a web server hosted by the cc3000 that jams while trying to access the webpage.

User avatar
sokkederheld
 
Posts: 1
Joined: Sun May 03, 2015 7:18 am

Re: CC3000 Hang/reset

Post by sokkederheld »

Thank you, this worked for me as well!

User avatar
gofredo
 
Posts: 3
Joined: Sun Jul 31, 2016 3:41 pm

Re: CC3000 Hang/reset

Post by gofredo »

A year later and still getting the same issue.... This fix works for me too, until I power off. Upon restart, the CC3000 keeps initializing again. The only fix I found is to open the socket.cpp file, delete the line you gave us then and re-add it again... Happens every time I have to unplug. Kind of annoying, but whatever... it works for now. I ordered a the ATWINC1500 WiFi Breakout to replace it. Will try that and see what happens

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

Return to “Other Arduino products from Adafruit”