If your passphrase is a series of HEX digits, you can't simply enter it as a literal string. Instead you have to define is as an actual binary sequence.
For example, if your passphrase is 8899aabbccdd, you would define it as follows (note the 0x00 at the end! It's important!):
// #define WLAN_PASS "8899aabbccdd" //don't do it this way! //do it this way: const char WLAN_PASS = {0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0x00};
#define WLAN_SECURITY WLAN_SEC_WEP
There is no way to know the actual range you will get unless you experiment with your setup since there is so many variables, but the ceramic antenna gets about the same range we expect with an every day cellphone
WiFi device IPs are dynamic 99% of the time, but it is possible to assign a static IP if your router permits it. Check out this forum post for how to go about it
The CC3000 only operates on channels 1 through 11. Outside of the United States, you may be able to configure your router to a channel number outside of that range. Make sure your router is configured for a channel in the range 1 through 11.
A lockup during initialization is a very common issue when there isn't enough power to supply both the Arduino and CC3000 board. Make sure you're powering the Arduino from a 1 amp or higher rated external power supply. Don't try to power the Arduino from a computer/laptop USB port because those ports typically can't provide enough power and will cause lockups!
If you're using an Arduino UNO you can plug in a 7-12 volt power supply to the barrel jack on the board. A supply like this 9V 1amp wall wart is perfect for the Arduino UNO and CC3000.
Also if your Arduino supports changing the voltage of the digital I/O pins (like some 3rd party Arduino clones), make sure the voltage is set to 5 volts and not 3.3 volts.
Unfortunately there is a well known internal issue with the CC3000 which can cause lock ups and instability over time or under heavy load. This thread on the Spark Core forums dives deeply into the issue and investigation with Texas Instruments. Ultimately the latest firmware version 1.13 was released with a potential fix for the stability problems. If you'd like to upgrade to firmware version 1.13 see the page on firmware upgrades in this guide.
By default the CC3000 is configured to get an IP address automatically from your router using DHCP. In most cases this works well, however if you run into trouble getting an IP address or DNS server you should consider setting a static IP address and DNS server.
To set a static IP address make sure you have the latest version of the CC3000 library and load the buildtest example. Scroll down to the commented section of code in the setup function which discusses setting a static IP address:
/*
uint32_t ipAddress = cc3000.IP2U32(192, 168, 1, 19);
uint32_t netMask = cc3000.IP2U32(255, 255, 255, 0);
uint32_t defaultGateway = cc3000.IP2U32(192, 168, 1, 1);
uint32_t dns = cc3000.IP2U32(8, 8, 4, 4);
if (!cc3000.setStaticIPAddress(ipAddress, netMask, defaultGateway, dns)) {
Serial.println(F("Failed to set static IP!"));
while(1);
}
*/
Remove the /* and */ comment delineators and fill in the IP address, net mask, default gateway, and DNS server values for your network. You might need to check your router's configuration page to find these details.
Run the buildtest sketch and the CC3000 should be configured to use the static IP address and configuration you assigned. You can actually remove or comment out the IP assignment code because the CC3000 will remember the configuration in its internal non-volatile storage.
If you'd ever like to enable DHCP again, load buildtest and uncomment the section below the static IP address configuration:
/*
if (!cc3000.setDHCP()) {
Serial.println(F("Failed to set DHCP!"));
while(1);
}
*/
Unfortunately these networks are difficult or sometimes impossible for the CC3000 to connect to because they require using a web browser to authenticate with the network. However a couple options to pursue are:
- Try contacting the network support team / administrator and see if they can allow the CC3000 onto the network based on its MAC address. When you run the buildtest sketch it will print out the CC3000 MAC address so you can copy it from there. This option is the easiest and most reliable way to get onto the network, but might not be available depending on the network's policies.
- The second option is to clone the MAC address of a laptop or device you've gotten on the network already. For this you'll want to find the MAC address of the laptop/computer (usually in network settings, search online to get a direct answer depending on the OS you're using). Then uncomment and adjust the commented code in the setup function of the buildtest example which sets the MAC address of the CC3000. Fill in your laptop/computer's MAC address and run the sketch to have the CC3000 start using the provided MAC addres. Unfortunately at this point you have to turn off the cloned laptop/computer or at least disconnect it from the network because two devices with the same MAC can't be on the network at the same time (they'll get confused and start seeing each other's traffic).
The IPAddress class is not compatible with the IP addresses the CC3000 classes expect. However you can switch to using the CC3000.IP2U32 function to generate an IP address. See this line in the buildtest example for how to use this function, and what type to use to store the IP address (an unsigned 32-bit integer). Unfortunately the Arduino compiler will try to convert an IPAddress into this type so ethernet library code might compile, but when the code actually runs it will fail because the data is not in the right order. Stick to using the IP2U32 function!
Text editor powered by tinymce.