Jump to content
43oh

Recommended Posts

Dear All,

I am working on a RedbearLab Wifi Micro module (https://redbear.cc/product/wifi/wifi-micro-kit.html) which although connects to the network unfortunately it does not take an IP Address and it sticks at the while loop printing dots. This module used to work about 2 months ago.

I have also scanned the network getting the following output. I am trying to connect to "forth public access" but I can see that it shows 3 networks of the same name while it should be only one. In my mobile I can see only one.

//--------------------------------------------------------------

Scanning available networks...
** Scan Networks **
number of available networks:12
0) eduroam    Signal: -81 dBm    Encryption: WPA
1) forth public access    Signal: -81 dBm    Encryption: None
2) eduroam    Signal: -86 dBm    Encryption: WPA
3) AMI_WIFI    Signal: -87 dBm    Encryption: None
4) AMI_Lobby    Signal: -86 dBm    Encryption: None
5) eduroam    Signal: -86 dBm    Encryption: WPA
6) HP-Print-9c-Color LaserJet MFP    Signal: -53 dBm    Encryption: WPA
7) AMI_WIFI    Signal: -77 dBm    Encryption: None
8) AMI_Lobby    Signal: -76 dBm    Encryption: None
9) eduroam    Signal: -76 dBm    Encryption: WPA
10) forth public access    Signal: -76 dBm    Encryption: None
11) forth public access    Signal: -59 dBm    Encryption: None

//--------------------------------------------------------------

The code I have uploaded is the following ....

Any help will be really appreciated.

Best,

George

 

/*
  Web client

 This sketch connects to a website (http://www.google.com)
 using a WiFi shield.

 This example is written for a network using WPA encryption. For
 WEP or WPA, change the Wifi.begin() call accordingly.

 This example is written for a network using WPA encryption. For
 WEP or WPA, change the Wifi.begin() call accordingly.

 Circuit:
 * WiFi shield attached

 created 13 July 2010
 by dlf (Metodo2 srl)
 modified 31 May 2012
 by Tom Igoe
 */


#ifndef __CC3200R1M1RGC__
// Do not include SPI for CC3200 LaunchPad
#include <SPI.h>
#endif
#include <WiFi.h>

// your network name also called SSID
char ssid[] = "forth public access";
// your network password
//char password[] = "launchpad";

// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(50,62,217,1);  // numeric IP for Google (no DNS)
char server[] = "energia.nu";    // name address for Google (using DNS)

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
WiFiClient client;

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  delay(5000);
  // attempt to connect to Wifi network:
  Serial.print("Attempting to connect to Network named: ");
  // print the network name (SSID);
  Serial.println(ssid);
 
  // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
  WiFi.begin(ssid);
 // WiFi.begin(ssid, password);
  while ( WiFi.status() != WL_CONNECTED) {
    // print dots while we wait to connect
    Serial.print(".");
    delay(300);
  }
 
  Serial.println("\nYou're connected to the network");
  Serial.println("Waiting for an ip address");
 
  while (WiFi.localIP() == INADDR_NONE) {
    // print dots while we wait for an ip addresss
    Serial.print(".");
    delay(300);
  }

 

  Serial.println("\nIP Address obtained");
  printWifiStatus();

  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("connected to server");
    // Make a HTTP request:
    client.println("GET /hello.html HTTP/1.1");
    client.println("Host: energia.nu");
    client.println("Connection: close");
    client.println();
  }
}

void loop() {
  // if there are incoming bytes available
  // from the server, read them and print them:
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting from server.");
    client.stop();

    // do nothing forevermore:
    while (true);
  }
}


void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

 

 

Link to post
Share on other sites

If you connect to that network with your PC, does your PC acquire an IP address?

The reason that you are seeing  3 of them in the Serial terminal is that there are in fact 3 AP's with the SSID "forth public access". The CC3200 will list all AP's whereas your PC will only show it as one.

Robert

Link to post
Share on other sites

Hello Robert,

Thank you very much for your reply.
I just tested it at home and it works fine. It seems that the problem is the multiple identical SSIDs it gets from the network at my work.
Do you have any suggestion on solving this issue or I should report it to the Network Admins?
Best,
George
 
Link to post
Share on other sites

hmm, it should not matter if there are multiple AP's with the same SSID. The CC3200 associates with the one with the strongest RSSI and will from thereon negotiate an IP address just as if there was only one AP. Curious if the AP only hands out IP addresses to know stations and rejects others. Either way, I have not seen this issue before. Your network admin will be able to look at the log of the DHCP server and from there on figure out what is going wrong.

Link to post
Share on other sites

Hello Robert,

The problem is solved out. The issue is related to the access point next to my office. When I switch that AP off, the device takes an IP from another AP successfully.

Thanks again for your great support!

Best,

George

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...