[Solved] Need Help with WiFi Connection

I know this is a long shot, but....
I have been trying to connect to my local LAN for with a Wee Serial module.

As an interface I am using an XBee Shield which is plugged into an Uno.

I am using the library linked at the bottom of the product wiki page.

I have tried the examples and get a bunch of errors :

Connection example:

setup begin
FW Version: 0018000902
to station ok
Join AP failure
setup end

Test example:

setup begin
set uart is error
1-3

AT+CWJAP_DEF?busy p...

AT+CWJAP_DEF?busy p...

AT+CWSAP?
ERROR

AT+CWLIF
ERROR

the state of DHCP:AT+CWDHCP?
ERROR

AT+CWDHCP?
ERROR

get the station mac: AT+CIPSTAMAC?
ERROR

it is error
get the station mac: AT+CIPSTAMAC?
ERROR

get the station's ipAT+CIPSTA?
ERROR

set station's ip is error
get the station's ipAT+CIPSTA?
ERROR

get the ap's apAT+CIPAP?
ERROR

set ap's is is error
get the ap's apAT+CIPAP?
ERROR

start smartconfig is error
stop smartconfig is error
get the current status of connection:STATUS:5
save trans link is error
setup end

iTead support has not been very helpful.

Any idea how I can interact with the module with AT commands?

Anybody...?
SurferTim?
zoomkat?

I know you 2 guys are experts in this area :slight_smile:

I wish I could help you. It has been a while since I've used AT commands. That was way back in the Hayes modem days.

This is obviously the command that is failing.
AT+CWJAP=ssid,passphrase

This is the page I'm getting this stuff from:
http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module

edit: The ssid and passphrase must be in quotes.
AT+CWJAP="myssid","mypassphrase"

These are the 2 pieces of code which produced the above results....

/**
 * @example ConnectWiFi.ino
 * @brief The ConnectWiFi demo of library WeeESP8266. 
 * @author Wu Pengfei<pengfei.wu@itead.cc> 
 * @date 2015.03
 * 
 * @par Copyright:
 * Copyright (c) 2015 ITEAD Intelligent Systems Co., Ltd. \n\n
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version. \n\n
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
#include "ESP8266.h"
/*
#define SSID        "ITEAD"
#define PASSWORD    "12345678"
*/
#define SSID        "AISNetworking"
#define PASSWORD    "...edited out..."


ESP8266 wifi(Serial);

void setup(void)
{
    Serial.begin(9600);
    while(!Serial);
    Serial.print("setup begin\r\n");

    Serial.print("FW Version: ");
    Serial.println(wifi.getVersion().c_str());
    
    
    if (wifi.setOprToStation()) {
        Serial.print("to station ok\r\n");
    } else {
        Serial.print("to station err\r\n");
    }

    if (wifi.joinAP(SSID, PASSWORD)) {
        Serial.print("Join AP success\r\n");
        Serial.print("IP: ");       
        Serial.println(wifi.getLocalIP().c_str());
    } else {
        Serial.print("Join AP failure\r\n");
    }
    
    Serial.print("setup end\r\n");
}

void loop(void)
{
}
/**
 * @example ConnectWiFi.ino
 * @brief The ConnectWiFi demo of library WeeESP8266. 
 * @author Wu Pengfei<pengfei.wu@itead.cc> 
 * @date 2015.03
 * 
 * @par Copyright:
 * Copyright (c) 2015 ITEAD Intelligent Systems Co., Ltd. \n\n
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version. \n\n
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
#include "ESP8266.h"
/*
#define SSID        "ITEAD"
#define PASSWORD    "12345678"
*/
#define SSID        "AISNetworking"
#define PASSWORD    "...edited out..."
/*


ESP8266 wifi(Serial);

void setup(void)
{
    Serial.begin(9600);
    while(!Serial);
    Serial.print("setup begin\r\n");

    Serial.print("FW Version: ");
    Serial.println(wifi.getVersion().c_str());
    
    
    if (wifi.setOprToStation()) {
        Serial.print("to station ok\r\n");
    } else {
        Serial.print("to station err\r\n");
    }

    if (wifi.joinAP(SSID, PASSWORD)) {
        Serial.print("Join AP success\r\n");
        Serial.print("IP: ");       
        Serial.println(wifi.getLocalIP().c_str());
    } else {
        Serial.print("Join AP failure\r\n");
    }
    
    Serial.print("setup end\r\n");
}

void loop(void)
{
}

iTead tell me the above code works, but is doesn't work for for me.
Can you see any obvious issues?

I found this. Yours is returning "busy p...".
ESP_RST should be pulled up. It has to be activated if the module returns busy p... message.

Correction! The earlier code and results I posted was using the module plugged into an iBoardex.

This is the code and result using the shield and Uno;

/*
ESP8266 library

When you use with UNO board, uncomment the follow line in uartWIFI.h.
#define UNO

When you use with MEGA board, uncomment the follow line in uartWIFI.h.
#define MEGA

Connection:
When you use it with UNO board, the connection should be like these:
ESP8266_TX->D0
ESP8266_RX->D1
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

FTDI_RX->D3			//The baud rate of software serial can't be higher that 19200, so we use software serial as a debug port
FTDI_TX->D2

When you use it with MEGA board, the connection should be like these:
ESP8266_TX->RX1(D19)
ESP8266_RX->TX1(D18)
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you want to output the debug information, please use DebugSerial. For example,

DebugSerial.println("hello");


Note:	The size of message from ESP8266 is too big for arduino sometimes, so the library can't receive the whole buffer because  
the size of the hardware serial buffer which is defined in HardwareSerial.h is too small.

Open the file from \arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.h.
See the follow line in the HardwareSerial.h file.

#define SERIAL_BUFFER_SIZE 64

The default size of the buffer is 64. Change it into a bigger number, like 256 or more.





*/

/*
#define SSID       "Itead_1(Public)"
#define PASSWORD   "27955416"
*/
#define SSID        "AISNetworking"
#define PASSWORD    "... edited ..."


#include "uartWIFI.h"
#include <SoftwareSerial.h>
WIFI wifi;


void setup()
{
  
  wifi.begin();
  bool b = wifi.Initialize(STA, SSID, PASSWORD);
  if(!b)
  {
    DebugSerial.println("Init error");
  }
  delay(8000);  //make sure the module can have enough time to get an IP address 
  String ipstring  = wifi.showIP();
  DebugSerial.println("My IP address:");
  DebugSerial.println(ipstring);		//show the ip address of module
  
  String wifistring  = wifi.showJAP();
  DebugSerial.println(wifistring);  	//show the name of current wifi access port
  
}
void loop()
{
  

}

AT+RST
AT+CWMODE=1
AT+RST
AT+CWJAP="AISNetworking","...edited out..."
AT+CIFSR
AT+CIFSR
AT+CWJAP?

I can't tell if it's connecting or not....?

I managed to resolve this issue.
Turns out sketch does not like having a backslash in the password.