WiFi module with an SPI interface- project...

Status
Not open for further replies.
By running the CC3000 library examples on an Arudino clone, the resources needed by the examples really requires a Teensy 3 with a large amount of flash. 32K of flash, on the Arduino, won't cut it unless you are NOT running other user applications in the same sketch.
:cool:
 
XP/SP3/Seeeduino Duemilanove 328P - no optiboot

23k of 30K CC3000 library example: GeoLocation
21K of 30k CC3000 library example: Internettime
23.5K of 30k CC3000 library example: NptTest
28K of 30k CC3000 library example: SendTweet
20K of 30K CC3000 library example: WebClient

I feel a lot better using the Teensy 3 (131K) - IMHO
:cool:
 
I feel a lot better using the Teensy 3 (131K) - IMHO
:cool:
Note, since the AVR uses a different processor the sizes between AVR and ARM won't be the same. I.e. 23k in an AVR may become 15k or 45k in the ARM. But having 4 times the memory is quite helpful.
 
By running the CC3000 library examples on an Arudino clone, the resources needed by the examples really requires a Teensy 3 with a large amount of flash. 32K of flash, on the Arduino, won't cut it unless you are NOT running other user applications in the same sketch.
:cool:

Well...yes and no....

You're right the library is huge, but I've already got a couple of cases where 32K is good enough. One is a board that sends the readings from a temperature sensor and light sensor every hour to a server (and even syncs time with NTP), the other runs an extremely simple web server that pulses an IO pin that blips an optoisolator connected to a DSLR, to take pictures remotely.

Additionally, you can set the CC3000_TINY_DRIVER flag and recompile and the library will only take up ~ 4K. You'll lose most of the neat features like SmartConfig and SSID scanning, but it works great if all you need is something basic to send and receive a few dozen bytes at a time.

Having said all that...I agree with you. To do really interesting things with the CC3000 you need a Teensy 3. The CC3000 is the reason I jumped from ATMega328s to the Teensy.
 
Last edited:
Can anyone give this update a quick run on a Teensy3 and also an Arduino Uno? I don't have either hooked up to a CC3000 right now....

https://github.com/PaulStoffregen/Adafruit_CC3000_Library

This fix is so very simple, so I'm almost certain it will work. Still, Adafruit usually wants actual confirmation on both boards before they'll accept a pull request.

Uno - compiles with no errors, 'buildtest' example runs with no issues.

Teensy3 - compiles with no errors, hangs on "Initialising the CC3000 ..." in buildtest.

I don't think the Teensy3 problem is related to your patch, it looks like it's hanging on init_spi(). This is the first time I've tried the Adafruit library with a Teensy3 -- has this worked for anyone? (my test code https://github.com/cmagagna/ArduinoCC3000Test runs so I know the wiring etc. is good).
 
Uno - compiles with no errors, 'buildtest' example runs with no issues.

Teensy3 - compiles with no errors, hangs on "Initialising the CC3000 ..." in buildtest.

I don't think the Teensy3 problem is related to your patch, it looks like it's hanging on init_spi(). This is the first time I've tried the Adafruit library with a Teensy3 -- has this worked for anyone? (my test code https://github.com/cmagagna/ArduinoCC3000Test runs so I know the wiring etc. is good).

Same result here...
 
A couple quick photos.....

cc3000_1.jpg

cc3000_2.jpg
 
Here are more fixes to the library.

https://github.com/PaulStoffregen/Adafruit_CC3000_Library

With these changes I was able to get my CC3000 to detect the nearby networks with "buildtest". I tested on both Teensy2 and Teensy3. Sadly, I don't have time to run the other examples right now... several other pretty urgent things to do.

Please give this new version a try. Does it work on your Teensy? Can you confirm if it still works on Arduino Uno (it really should... these edits are only to #ifdef'd stuff)?

I'd like to hold off submitting another pull request to Adafruit until more verification has been done, so any testing you can do on real hardware will *really* help!! :)
 
Hi Paul,

No problems at all with the examples on the Uno + Adafruit board.

The samples compile fine with Teensy3 + Adafruit board and as you say 'buildtest' enumerates the nearby networks, but getMacAddress() fails as does getting an IP address via DHCP etc. 'GeoLocation' is similar, it hangs at "connecting to network...".

I will investigate further and let you know.
 
WebClient hangs here:
Code:
Hello, CC3000!

Free RAM: 8044

Initializing...

buildtest here:
Code:
Hello, CC3000!

RX Buffer : 131 bytes
TX Buffer : 131 bytes
Free RAM: 8148

Initialising the CC3000 ...
Firmware V. : 1.19
MAC Address : Networks found: 3
================================================
SSID Name    : 
RSSI         : 83
Security Mode: 3

SSID Name    : LinkME
RSSI         : 43
Security Mode: 1

SSID Name    : westell7517
RSSI         : 33
Security Mode: 2

================================================

Deleting old connection profiles

Attempting to connect to GMJLinksys

ntpTest here:
Code:
Hello, CC3000!

Free RAM: 8164

Initialising the CC3000 ...
Firmware V. : 1.19

Deleting old connection profiles

Attempting to connect to GMJLinksys
 
Some small progress....

It looks like the library is actually getting further along than it says, it's just not printing anything. At line 185 in Adafruit_CC3000.cpp:

Code:
#if defined(UDR0) || defined(UDR1)
  CC3KPrinter = &Serial;
  #else
  CC3KPrinter = 0;
  // no default serial port found
  #endif

Teensyduino doesn't know about UDR0 or UDR1 so here's a quick hack to force the issue:

Code:
//  #if defined(UDR0) || defined(UDR1)
  CC3KPrinter = &Serial;
//  #else
//  CC3KPrinter = 0;
//  // no default serial port found
// #endif

Now when I run 'buildtest' the device's MAC address prints out and I can see more status updates.

Unfortunately it's still not working; it loops forever timing out while trying to connect to my network, but hopefully this is still progress.

Attached is a modified version of Adafruit_CC3000.cpp if you want to try it out and don't want to edit the file yourself.

View attachment Adafruit_CC3000.cpp
 
Thanks. That's actually one of many things I patched, but didn't push to github. I've been trying to keep the public patches as simple as possible, so Adafruit's people will have an easier time accepting a pull request.

I must confess, yesterday when I saw it detect the SSIDs of networks, I didn't go any further. Instead I spent the rest of the day trying to figure out why Windows adds a delay when enumerating.

I'll dig deeper into the CC3000 library today and hopefully find & fix this problem.
 
I just tried buildtest, this time with my ssid and key. It seems to work. It was failing to print some info (but working), because of the missing CC3KPrinter definition. I've pushed that to github:

https://github.com/PaulStoffregen/Adafruit_CC3000_Library

One other thing I discovered is you must use an array of binary data if using a WEP key. For example:

Code:
#define WLAN_SECURITY   WLAN_SEC_WEP
//#define WLAN_PASS       "526F62694E"  // <--- this format will NOT work!
const char WLAN_PASS[6] = {0x52, 0x6F, 0x62, 0x69, 0x4E, 0};  // <--- this works :-)
 
I personally verified this works on Teensy 2.0, Teensy 3.0 and Arduino Uno (wired it up on a prototype shield this morning). I'm going to submit it as a pull request now.
 
Hi Paul,

I just downloaded & tried your latest push, and everything is working as advertised...builttest, geolocation, internettime examples all run using an Adafruit board with the stock 1.19 firmware.

Everything is still failing with a Teensy3 + Adafruit board I upgraded to the new T.I. firmware version 1.24, but since the new firmware isn't officially supported by Adafruit I don't think it's something I'm going to worry about.

Thanks for all your help on this.
 
Adafruit has merged the changes to the official library. :)

My one and only Adafruit CC3000 breakout board has firmware 1.19. Sounds like I should probably leave it as-is.
 
Paul S said ... using 1.19 firmware
I personally verified this works on Teensy 2.0, Teensy 3.0 and Arduino Uno

Potatotron said ...
Everything is still failing with a Teensy3 + Adafruit board I upgraded to the new T.I. firmware version 1.24

Question - @ Potatotron does 1.19 work on the Teensy 3 and all of the examples? :confused:
 
I tried most of the examples (not smartconfig or sendtweet) and they all compiled an ran fine on the 1.19 firmware on a Teensy 3.0
 
Paul S said ... using 1.19 firmware


Potatotron said ...


Question - @ Potatotron does 1.19 work on the Teensy 3 and all of the examples? :confused:

Sorry for the confusion. Everything works great with a Teensy 3 and an Adafruit board running 1.19. I tried buildtest, GeoLocation, InternetTime, and WebClient. All good.

In other good news I've just found the problem with firmware 1.24, or I should say I found out my router was to blame...it didn't like the MAC address of the upgraded board (which was 6 random bytes I made up while porting the firmware upgraded). I changed the first 5 bytes to match the working board and now all is well.

I'm now confident that the board, firmware, library, and Teensy 3 are all playing nice now so I can finally start working on a web server. More details soon....
 
For network devices that have no manufacturer assigned MAC address, such as the WizNet modules, I've long used the IEEE defined "self administred" MAC address range.
In this range, no devices with manufacturer define addresses should exist. So you manage the addresses in this self administered range , rather than hoping, or swiping a MAC assigned by some NIC or WiFi vendor.

simply use a MAC address with bit 1 of the MSB set. Like 0x02 xx xx xx ...
where you choose the xx's

In one case, I took high order parts of the MAC address of an 802.15.4 radio to use as the xx bytes - and used that for the WizNet modules. Ensured that the self administered address was unique and I didn't have to keep records of what I'd already used.

Just don't expose a device with a self administered MAC address to the WAN/internet - which wouldn't happen if you have a router tied to a modem of some sort. Indeed, Verizon's LTE modems don't have a public address at all. They double-NAT IPv4 unroutable addresses in net 10 on the LAN side AND the WAN side.
 
Just curious... will the CC3000 be compatible with IPv5?;)
whoops I mean IPv6?
 
Last edited:
Status
Not open for further replies.
Back
Top