Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ESP8266 web communication problem

Status
Not open for further replies.

Ranbeer Singh

Full Member level 5
Full Member level 5
Joined
Jul 30, 2015
Messages
259
Helped
22
Reputation
44
Reaction score
22
Trophy points
1,298
Location
Faridabad India
Activity points
3,266
Hello,

I was working with ESP8266 wifi module. I have successfully connected it with PC and my phone via hostpot. It's responding according to AT command with UART communication but it is not founding when i search it's wifi address with web browser.

I sets undermentioned AT commands.

AT+CWMODE=3;
AT+CIPMODE=0;
AT+CIPMUX=1;

AT+CWJAP="SSID","PASSWORD";

When i send AT+CWJAP? inquiry command, it sends SSID name and when i send AT+SIFSR? command it send back me that it got a IP address. I think it's ok.

AT for making a server

AT+CIPSTO=180;
AT+CIPSERVER=1,1234;


No error massage occurred by module. All time comes OK response.

I am wonder, where am i wrong?



Please advice.

- - - Updated - - -

I am using station IP address in web browser.
 

Hay can you try using station IP and port number in web browser? Like if your station IP is 192.168.1.10 and here in your device server opened on port number 1234, so try "192.168.1.10:1234" in your browser.
 

Hi,

No, I tried it without port number like 192.168.1.10. I tried it with Arduino IDE sketch program also. But nothing is happening.
 

In web browser if you type IP address without the port number, it will by default try asking server for the connection on the port number 80. Here in your ESP module when you try AT command :
Code:
AT+CIPSERVER=1,1234;
You are actually opening server on port number 1234.

So from web browser you need to specifically ask this port number instead of default port number 80. And for that you need to type "192.168.1.10:1234" in your web browser. Please try this and update the result.
 

Last edited:

Hi Ranbeer,

If you are doing according to what you have mention, I think you are doing fine. Even if you are not getting the results then you need to check it step by step. If you are ok with that then please follow this.

  1. I advice you to post this on ESP community forum "here" as well, so no stone upturned. Also do back linking in both for reference.
  2. Please strictly follow this steps: (This is what gave me success on my module)

    Code:
    // Reset the device
    AT+RST\r\n
    
    // Restore the device
    AT+RESTORE\r\n
    
    // Get version info
    AT+GMR\r\n
    
    // Set WiFi mode as station mode
    AT+CWMODE_CUR=1\r\n
    
    // List available APs 
    AT+CWLAP\r\n
    
    // Connect to AP, for current
    AT+CWJAP_CUR="YourSSID","YourPassword"\r\n
    
    // Check network connection status
    AT+CIPSTATUS\r\n
    
    // Get local IP address (Please note down the IP)
    AT+CIFSR\r\n
    
    // Show remote IP and port with "+IPD" (optional but try for now)
    AT+CIPDINFO=1\r\n
    
    // Enable multiple connections
    AT+CIPMUX=1\r\n
    
    // Configure as TCP server
    AT+CIPSERVER=1,80\r\n
    
    // Check network connection status
    AT+CIPSTATUS\r\n
  3. If all goes well at this point you may go to your browser and try to connect to the IP address you received in the response of "AT+CIFSR".
  4. Check again network status
    Code:
    // Check network connection status
    AT+CIPSTATUS\r\n
  5. If you have been successful up to this point, you may reply to your browser query by this:
    Code:
    // Send data
    AT+CIPSEND=<YourLinkID>,3$0D$0A
    
    // data
    123
    
    // Close TCP connection
    AT+CIPCLOSE=<YourLinkID>\r\n
    
    // Check network connection status
    AT+CIPSTATUS\r\n
  6. Please try all the steps and post the responses from module / device here.
  7. Cross check the responses with the AT command manual, if anything is wrong.
Note:
  • YourSSID == Your WiFi name.
  • YourPassword == Your WiFi Password
  • <YourLinkID> == ID number of connection (0~4) (5 will close all the connection).
I gave up on AT command firmware, and switched to Arduino based development of firmware for ESP8266. I highly recommend that to you as well.
 
Last edited:
Community will be glad that it has helped you. Please share your result / changes / suggestion here, so it will provide the reference for future. I am interested in your changes, may be it can solve many of my problem. If you have got your answer, please mark the thread as solved.
 

My working ESP8266 configuration codes are given below.
Code:
void config_ESP8266()
{
	char a[7];
	char index = 0, val = 1;

	while(val)
	{
		if(esp8266_isStarted() == 0)
		{
			a[0] = esp8266_restart();
			a[1] = esp8266_echoCmds(0);
			a[2] = client_or_server(1);
			a[3] = esp8266_connect(id, password);
			a[4] = check_wifi_in_range();
			a[5] = Single_Multi(1);
			a[6] = Set_Server();

			while(index<7)
			{
				if(a[index] == 0) val = 0;
				else { val = 1; }
				index++;
			}
		}
	}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top