WiFi module with an SPI interface- project...

Status
Not open for further replies.
I have a library for that module, https://github.com/cmagagna/ArduinoCC3000. There are prototype boards with the module, like the CC3000EM, but none have standard pinouts. Last weekend I made a breadboard-friendly board, https://github.com/cmagagna/CC3000-Breakout-Board. I've got prototype boards on order from Osh Park so hope to have them running in 3-4 weeks.

As for the module itself, DigiKey has them for $12.51 in qty 1, http://www.digikey.com/product-detail/en/CC3000MODR/296-35512-1-ND/3768439.
 
Yep that's the one I'm using right now for developing the library. I think it's out of stock everywhere right now, but I think the CC3000BOOST is available -- same module and support chips, slightly different form factor.

photo.JPG
 
I have two of TI's BoosterPack boards - these stack. Using them with the TI 802.15.4 radio Eval Module that plugs in.
Testing '15.4 minus ZigBee, via UART and SPI - to the Teensy3 eventually. Starting now with UART to PC, developing in C++, then move to T3. Using TI's firmware on the radios that provides UART/SPI, so no altering of radio's firmware is needed.
 
Last edited:
Without the console output its a bit hard to troubleshoot ;-)

Code:
In file included from /home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/sntp.h:275:0,
                 from ntpTest.ino:32:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/socket.h:113:0: warning: "ENOBUFS" redefined [enabled by default]
In file included from /home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/errno.h:14:0,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/cc3000_common.h:50,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:25,
                 from ntpTest.ino:26:
/home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/sys/errno.h:153:0: note: this is the location of the previous definition
In file included from /home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/sntp.h:275:0,
                 from ntpTest.ino:32:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/socket.h:172:0: warning: "FD_SET" redefined [enabled by default]
In file included from /home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/stdio.h:46:0,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Print.h:5,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Stream.h:24,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/HardwareSerial.h:54,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/WProgram.h:16,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Arduino.h:1,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:21,
                 from ntpTest.ino:26:
/home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/sys/types.h:232:0: note: this is the location of the previous definition
In file included from /home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/sntp.h:275:0,
                 from ntpTest.ino:32:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/socket.h:173:0: warning: "FD_CLR" redefined [enabled by default]
In file included from /home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/stdio.h:46:0,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Print.h:5,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Stream.h:24,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/HardwareSerial.h:54,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/WProgram.h:16,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Arduino.h:1,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:21,
                 from ntpTest.ino:26:
/home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/sys/types.h:233:0: note: this is the location of the previous definition
In file included from /home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/sntp.h:275:0,
                 from ntpTest.ino:32:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/socket.h:174:0: warning: "FD_ISSET" redefined [enabled by default]
In file included from /home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/stdio.h:46:0,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Print.h:5,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Stream.h:24,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/HardwareSerial.h:54,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/WProgram.h:16,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Arduino.h:1,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:21,
                 from ntpTest.ino:26:
/home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/sys/types.h:234:0: note: this is the location of the previous definition
In file included from /home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/sntp.h:275:0,
                 from ntpTest.ino:32:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/socket.h:175:0: warning: "FD_ZERO" redefined [enabled by default]
In file included from /home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/stdio.h:46:0,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Print.h:5,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Stream.h:24,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/HardwareSerial.h:54,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/WProgram.h:16,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Arduino.h:1,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:21,
                 from ntpTest.ino:26:
/home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/sys/types.h:235:0: note: this is the location of the previous definition
In file included from /home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/sntp.h:275:0,
                 from ntpTest.ino:32:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/socket.h:156:3: error: conflicting declaration 'typedef struct _types_fd_set _types_fd_set'
In file included from /home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/stdio.h:46:0,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Print.h:5,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Stream.h:24,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/HardwareSerial.h:54,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/WProgram.h:16,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Arduino.h:1,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:21,
                 from ntpTest.ino:26:
/home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/sys/types.h:228:3: error: '_types_fd_set' has a previous declaration as 'typedef struct _types_fd_set _types_fd_set'
In file included from ntpTest.ino:32:0:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/sntp.h:357:1: warning: 'typedef' was ignored in this declaration [enabled by default]
ntpTest.ino:56:83: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ntpTest.ino: In function 'void setup()':
ntpTest.ino:150:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ntpTest.ino:154:57: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ntpTest.ino:154:57: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ntpTest.ino:172:16: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
ntpTest.ino:172:85: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 
I'll take a look shortly.

My initial impression is this library tries to implement the BSD standard sockets API. If it's only ever been tested on AVR, where avr-libc has no sockets stuff, it probably conflicts when used with newlib which has sockets stuff.
 
I pushed a couple more commits, to fix more C library conflicts and add const to the pointers to constant strings.

Please give this code a try and let me know if it works with Teensy3 and Adafruit's module?

Also, if anyone has one of these modules connected to a normal Arduino Uno, please run this modified code. It will almost certainly work... but Adafruit will ask if anyone has verified this before they accept the changes to the official version of the library.
 
Also, if anyone has one of these modules connected to a normal Arduino Uno, please run this modified code. It will almost certainly work... but Adafruit will ask if anyone has verified this before they accept the changes to the official version of the library.

Just tested with a Uno, it compiled with no errors and the example 'buildtest' ran with no issues.

I will test with a Teensy 3 later tonight.
 
Tested with a Teensy 3.0 and Adafruit's "buildtest" example. Seems to connect to my Netgear router, but fails when pining to outside world:

Code:
Networks found: 3
================================================
SSID Name    : Ed
RSSI         : 32
Security Mode: 1

SSID Name    : 
RSSI         : 83
Security Mode: 3

SSID Name    : LinkME
RSSI         : 40
Security Mode: 1

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

Deleting old connection profiles

Attempting to connect to XXXXXXXXX
Started AP/SSID scan




Connecting to XXXXXXXXX...Waiting to connect...Connected!
Request DHCP

IP Addr: 10.0.0.5
Netmask: 255.255.255.0
Gateway: 10.0.0.1
DHCPsrv: 10.0.0.1
DNSserv: 10.0.0.1
www.adafruit.com -> 207.58.139.247

Pinging 207.58.139.247...0 replies


Closing the connection
 
Next tried my Linksys router using the Adafruit "InternetTime" sketch and it worked...

Code:
Firmware V. : 1.19
MAC Address : 0x08 0x00 0x28 0x01 0xA8 0x28

Deleting old connection profiles

Attempting to connect to Linksys
Started AP/SSID scan




Connecting to Linksys...Waiting to connect...Connected!
Request DHCP

IP Addr: 192.168.1.13
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DHCPsrv: 192.168.1.1
DNSserv: 8.8.8.8
Locating time server...
Attempting connection...
Connect to 198.199.87.75:123
connected!
Issuing request...
Awaiting response...OK
Current UNIX time: 1377874531 (seconds since 1/1/1970 UTC)
Current UNIX time: 1377874546 (seconds since 1/1/1970 UTC)
Current UNIX time: 1377874561 (seconds since 1/1/1970 UTC)
Current UNIX time: 1377874576 (seconds since 1/1/1970 UTC)

Adafruit "buildtest" also worked:
Code:
Firmware V. : 1.19
MAC Address : 0x08 0x00 0x28 0x01 0xA8 0x28
Started AP/SSID scan


Networks found: 1
================================================
SSID Name    : 
RSSI         : 83
Security Mode: 3

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

Deleting old connection profiles

Attempting to connect to Linksys
Started AP/SSID scan




Connecting to Linksys...Waiting to connect...Connected!
Request DHCP

IP Addr: 192.168.1.13
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DHCPsrv: 192.168.1.1
DNSserv: 8.8.8.8
www.adafruit.com -> 207.58.139.247

Pinging 207.58.139.247...5 replies
Ping successful!
www.adafruit.com -> 207.58.139.247

Pinging 207.58.139.247...5 replies
Ping successful!
www.adafruit.com -> 207.58.139.247

Pinging 207.58.139.247...5 replies
Ping successful!
www.adafruit.com -> 207.58.139.247

Pinging 207.58.139.247...5 replies
Ping successful!
 
Last edited:
Thanks for that info, using a local address works fine...

Code:
Firmware V. : 1.19
MAC Address : 0x08 0x00 0x28 0x01 0xA8 0x28
Started AP/SSID scan


Networks found: 2
================================================
SSID Name    : 
RSSI         : 83
Security Mode: 3

SSID Name    : westell7517
RSSI         : 36
Security Mode: 2

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

Deleting old connection profiles

Attempting to connect to Netgear
Started AP/SSID scan




Connecting to Netgear...Waiting to connect...Connected!
Request DHCP

IP Addr: 10.0.0.5
Netmask: 255.255.255.0
Gateway: 10.0.0.1
DHCPsrv: 10.0.0.1
DNSserv: 10.0.0.1
www.adafruit.com -> 207.58.139.247

Pinging 207.58.139.247...0 replies


eMachines.local -> 10.0.0.11

Pinging 10.0.0.11...3 replies
Ping successful!
eMachines.local -> 10.0.0.11

Pinging 10.0.0.11...5 replies
Ping successful!
eMachines.local -> 10.0.0.11

Pinging 10.0.0.11...5 replies
Ping successful!
eMachines.local -> 10.0.0.11

Pinging 10.0.0.11...5 replies
Ping successful!
 
Sounds like the router firmware doesn't have the correct list of which address ranges/classes are public/private.
That's pretty gross.
 
Right. 10.x.x.x is a non-routable address. If it's use as the destination of IP traffic, say ICMP/ping, it would not be NATed out to the WAN. It would be used with the switch's ARP tables to decide where in the LAN to send the packet.

THere should be no difference between 10.x.x.x and 192.168.x.x so long as the subnet masks are correct.
 
Hello all,

I've got an alpha version of my Arduino-fied CC3000 firmware upgrader. The repository is here:

https://github.com/cmagagna/CC3000Patch

The code currently works on a Uno, or any ATMega328 board with OptiBoot (it's too big for the other bootloaders). I'll be working on Teensy 3 support this weekend.

This will upgrade a CC3000 to service pack 1.11.1 / firmware version 1.24 (T.I. has an interesting way of naming). They've fixed the weird 10.x.x.x bug as well as several other issues:

http://processors.wiki.ti.com/index.php/CC3000_Release_Notes
 
If anybody is using the AdaFruit Library for the CC3000 and Teensy 3.0, be aware that the latest commits no longer work for the Teensy 3.0:

Code:
Arduino: 1.0.5 (Linux), Board: "Teensy 3.0"
In file included from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:25:0,
                 from InternetTime.ino:26:
/home/jimm/sketchbook/libraries/Adafruit_CC3000/utility/cc3000_common.h:171:23: error: conflicting declaration 'typedef long unsigned int time_t'
In file included from /home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/stdio.h:46:0,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Print.h:35,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Stream.h:24,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/HardwareSerial.h:87,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/WProgram.h:16,
                 from /home/jimm/arduino/hardware/teensy/cores/teensy3/Arduino.h:1,
                 from /home/jimm/sketchbook/libraries/Adafruit_CC3000/Adafruit_CC3000.h:21,
                 from InternetTime.ino:26:
/home/jimm/arduino/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/include/sys/types.h:109:18: error: 'time_t' has a previous declaration as 'typedef long int time_t'

Paul's version still works.
 
Looks like I need to work on another pull request. Will probably work on it early next week. Remind me if I don't post a followup here by the middle of the week.

I'll definitely need help with testing, since I don't have a CC3000 set up right now. Adafruit wants at least a check the patch works on Teensy and Arduino Uno before accepting the code.

I have a couple ideas for reworking this so it'll survive future code updates from TI. I want to give that a try, rather than just redoing this the same way as last time.

Edit: this is also being discussed on Adafruit's forum.
 
Last edited:
Status
Not open for further replies.
Back
Top