Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 3 months ago.
Connecting without internet parameters?
I can connect by defining the internet parameters with the pins and using wifi.connect() but cannot connect using wifi.connect_secure(SSID,PASSWORD,TYPE) or wifi.connect_to_AP(SSID,PASSWORD,TYPE). They pass the if == false test and print IP: but won't print the ip address and fail the is_connected test. Here is my code:
#include "mbed.h" #include "cc3000.h" #include "main.h" #include "TCPSocketConnection.h" #include "TCPSocketServer.h" #include "TextLCD.h" using namespace mbed_cc3000; cc3000 wifi(PB_3, PB_4, PB_10, SPI(PA_7, PA_6, PA_5)); //not connecting if using this and connect_secure()/connect_to_AP() //cc3000 wifi(PB_3, PB_4, PB_10, SPI(PA_7, PA_6, PA_5), "SSID", "PASSWORD", WPA2, false); //connecting if using this and connect() Serial pc(PA_11, PA_12); int main() { init(); pc.printf("***WIFI***\n\r"); wifi.init(); if(wifi.connect_secure("NETGEAR33", "luckytomato441", WPA) == false) //NOT WORKING { pc.printf("No Internet\n\r"); } else { pc.printf("IP: %s\n\r", wifi.getIPAddress()); } /*if(wifi.connect_to_AP("NETGEAR33", "luckytomato441", WPA2) == false) //NOT WORKING { pc.printf("No Internet\n\r"); } else { pc.printf("IP: %s\n\r", wifi.getIPAddress()); } */ /* if (wifi.connect() == -1) //WORKING { pc.printf("No Internet\n\r"); } else { pc.printf("IP: %s\n\r", wifi.getIPAddress()); } */ if(wifi.is_connected()) { pc.printf("connected\n\r"); } else { pc.printf("Not Connected\n\r"); } }
Thanks for any help.
Question relating to:
1 Answer
10 years, 3 months ago.
Try this, Look at c3000.h, find #define CC3000_ETH_COMPAT 1, then change the 1 to a 0, for your connect_secure example only. I have not tried it but it may work.
Dave.
which platform are you using, i mean which mbed board have a look on the following code, it might help you out
I'm using a Nucleo F401 and a adafruit cc3000 shield
posted by Marcus Parker 04 Nov 2014