Arduino + CC3000 + Ethernet Shield Webserver with AP

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

Hi,

I want to create a webserver on my Arduino that runs off of the CC3000 or the Ethernet Shield. Here are my requirements:
1. Use SimpleLink protocol to sync CC3000 with my router via my cell phone (as shown in your example code for the CC3000 library - Thanks!)
2. Connect to my network over DHCP using the Ethernet module (Per the Ethernet library example code)
3. Start Arduino unconnected to Wifi or Ethernet. Ethernet takes priority when connected but Arduino will have the capability to switch between Ethernet and Wifi (e.g. Ethernet cable unplugged or WiFi goes dead). Both should use the same top layer to talk to the server for HTTP requests.

Not sure how I would do this without parallel processing. Perhaps ISR when the Ethernet gets plugged in? Maybe there is another clever solution?

Where do I start? Do you have any examples that you could recommend?

User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

Any thoughts?

User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

The Ethernet shield and CC3000 shield don't seem to being playing well together. I stack them and only the bottom stack works on my Uno. Is there a SPI conflict? Any suggestions on how to fix this?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by adafruit_support_rick »

Both the CC3000 shield and the Arduino Ethernet shield use pin 10 as chip select. You can change this on the CC3000 by cutting the trace between the WCS pad and pin 10, and then soldering a jumper from WCS to some unused pin.

Apart from the SPI pins (11, 12, 13), The Ethernet shield also uses pin 4, and the CC3000 also uses pins 3 and 5

User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

Got it. And what about connecting them to a Due (stacked)? The Due seems to work only with ICSP. I put a stackable header on the CC3000 ICSP connector but that didn't seem to work. Any suggestions?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by adafruit_support_rick »

Did you solder the ICSP jumpers closed on the back of your CC3000 shield?

User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

Yes. When I plug it into the Due by itself everything is good. The issue is with the two stacked. I'm assuming that this is solely to do with the WCS. Am I right?

Also, I want to use the Sparkfun XBee shield with the CC3000 but it requires pins 2 and 3 for software serial. Will I run into bus contention if I run them at the same time? I stacked them and run my XBee code only and all was good but I have not tried to talk to both yet.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by adafruit_support_rick »

Yes, the problem would be WCS.

Also, I just noticed that both the CC3000 and the Ethernet Shield use pin 4 for the SD Card CS. If you only use one card (or no cards), then that shouldn't be an issue.

Can you remap the XBee shield to use another pair of pins? If not, you'll have to cut the trace between IRQ and Pin 3 on the CC3000, and jumper IRQ to some other pin. Note that this may limit you to using only the Due, since it can support external interrupts on any pin (other Arduinos can only support the external interrupt the CC3000 library requires on a limited number of pins: http://arduino.cc/en/Reference/AttachInterrupt ).

User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

Sounds good. Will make the change. Can you please upload the .brd file for the CC3000 Arduino Shield so I can find all the traces and layers that they are on?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by adafruit_support_rick »

I'll see about getting the files posted to github. Meanwhile, the WCS-Pin10 trace is on top of the board and indicated in silkscreen. The IRQ-Pin3 is a long trace on the bottom of the board. It's easy to see.

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by adafruit2 »


User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

Awesome. Thanks.

If I run out of pins on the digital side can I use the analog ones? From the software end an example would look like this:
#define ADAFRUIT_CC3000_CS A0

Did I get that write? Do I need to change anything else in the software to let the chip know that it's now a digital I/O versus analog?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by adafruit_support_rick »

You can use the analog pins. However, you would refer to them by their digital names (D14 for A0, D15 for A1, etc.).

[EDIT]
No wait - you're using a Due, right? In that case, I don't think you can use the analog pins as digital pins.

User avatar
amahpour
 
Posts: 108
Joined: Mon Feb 03, 2014 4:16 pm

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by amahpour »

Well. I'm actually doing this for both an Uno and Due. Any chance I can get away with the same code?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino + CC3000 + Ethernet Shield Webserver with AP

Post by adafruit_support_rick »

Remember that you *must* connect the CC3000 IRQ to either digital 2 or 3 on the Uno. That means moving the I/O on your XBee board.

Otherwise, the Due has a D14, so if you write the code to refer to pin 14, you can run it on either a Due or a Uno (using A0 as D14)

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

Return to “General Project help”