1

Topic: ESP8266 connection to Android.

I get an error message when I try to connect the Arduino Uno/ESP8266 to my Android  using the RemoteXY app on my cellphone. The message is: "Device not reply. Receive time out error".  When I try to connect the ESP8266 blinks a few times, so the transmission works but apparently the ESP8266 does not send a correct return signal.

The settings in the Arduino sketch are as follows:
// RemoteXY connection settings 
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 9600
#define REMOTEXY_WIFI_SSID "192.168.4.1"
#define REMOTEXY_WIFI_PASSWORD ""
#define REMOTEXY_SERVER_PORT 9000

In the RemoteXY app the WiFi settings are:
Port: 9000
DoitWiFi_Config

I could not get the posting program's code insert to work. Also, I was unable to insert a screen dump image of the RemoteXY design and the ESP8266 settings.

1. Would anyone recognize this error and know how to correct it?
2. Would anyone be willing to share an ESP8266 project that works as an example?

Kindest Regards,
MJM

2

Re: ESP8266 connection to Android.

1.Default baud rate of ESP8266 is 115200
2.I do not know is SSID correct? "192.168.4.1"? Try to remove dots.

3

Re: ESP8266 connection to Android.

After trying the suggested values I still get the same error when I try to connect the Arduino Uno/ESP8266 to my Android  using the RemoteXY app on my cellphone.
The message is: "Device not reply. Receive time out error".  Again the ESP8266 blinks a few times, so the transmission works but apparently the ESP8266 does not send a correct return signal.
The updated settings in the Arduino sketch are as follows:

#include <RemoteXY.h>
// RemoteXY connection settings 
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "DoitWiFi_Config"
#define REMOTEXY_WIFI_PASSWORD ""
#define REMOTEXY_SERVER_PORT 9000

In the RemoteXY app the WiFi settings are:
   Port: 9000
   DoitWiFi_Config   

When I start the RemoteXY the settings of the ESP8266 are:
ESP8266 Serial WiFi Settings:
    Baud:        115200
    Databits:            8
    Parity:        None
    Stopbits:            1
Access Point (AP):
    AP Name:     DoitWiFi_Config
AP Password:            12345678
    Encript Method: Open
    Hide AP        No
    AP IP address:     192.168.4.1
    AP Netmask:    255.255.255.0
    AP Gateway
    Address:             192.168.4.1
Station: Enable:    No
    AP Name:            Doit
    DHCP enable:    Yes
Network Settings:
    Socket type:    Server
Transport type:     TCP
    Local Port:     9000

ESP_IOT_SDK_v1.4.0

1. Would anyone recognize the connection problem and know how to correct it?
2. Would anyone be willing to share an ESP8266 project that works as an example?

Kindest Regards,
MJM

4

Re: ESP8266 connection to Android.

Try to connect with the IP (192.168.4.1) instead of name.

5

Re: ESP8266 connection to Android.

Guillaume: Thanks. The RemoteXY app does not let you put in the IP, it only lets you select from a list of available access points. What surprises me is that particularly the return signals don't connect properly. Any ideas?

6 (edited by Guillaume 2017-03-02 22:20:34)

Re: ESP8266 connection to Android.

Sorry I've read too fast, I thought your esp8266 was in STA mode.

Do you really need your arduino between the esp and the smartphone? You can use esp as an arduino... it's 5-10x faster than most arduino boards, and has more memory. smile

That said, you shouldn't have problems, it works for many people so you are obviously doing something wrong but I have no idea what. At least post some code.

7

Re: ESP8266 connection to Android.

I used the RemoteXY system to automatically produce the program for the Arduino Uno/ESP8266 combination.The program listing (with added delay statements) is:

/* 
   -- ESP8266_Test -- 
    
   This source code of graphical user interface  
   has been generated automatically by RemoteXY editor. 
   To compile this code using RemoteXY library 2.2.5 or later version  
   download by link http://remotexy.com/en/library/ 
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                    
     - for ANDROID 3.7.1 or later version; 
     - for iOS 1.0.7 or later version; 
     
   This source code is free software; you can redistribute it and/or 
   modify it under the terms of the GNU Lesser General Public 
   License as published by the Free Software Foundation; either 
   version 2.1 of the License, or (at your option) any later version.     
*/ 

////////////////////////////////////////////// 
//        RemoteXY include library          // 
////////////////////////////////////////////// 

// RemoteXY select connection mode and include library  
#define REMOTEXY_MODE__ESP8266POINT_HARDSERIAL

#include <RemoteXY.h> 

// RemoteXY connection settings  
#define REMOTEXY_SERIAL Serial 
#define REMOTEXY_SERIAL_SPEED 9600 //don't use a high speed for UNO. 
#define REMOTEXY_WIFI_SSID "DoitWiFi_Config" 
#define REMOTEXY_WIFI_PASSWORD "" //No password needed, the ESP*@^^ is open
#define REMOTEXY_SERVER_PORT 9000 


// RemoteXY configurate   
#pragma pack(push, 1) 
uint8_t RemoteXY_CONF[] = 
  { 1,0,13,0,6,5,1,1,0,25
  ,41,12,12,2,79,78,0 }; 
   
// this structure defines all the variables of your control interface  
struct { 

    // input variable
  uint8_t button_ON; // =1 if button pressed, else =0 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY; 
#pragma pack(pop) 

///////////////////////////////////////////// 
//           END RemoteXY include          // 
///////////////////////////////////////////// 

#define PIN_BUTTON_ON 13


void setup()  
{ 
  RemoteXY_Init ();  
  delay(2); // Make sure ESP can catch up. 
  pinMode (PIN_BUTTON_ON, OUTPUT);
} 

void loop()  
{  
  RemoteXY_Handler (); 
  delay(2); // Make sure ESP can catch up.  
  digitalWrite(PIN_BUTTON_ON, (RemoteXY.button_ON==0)?LOW:HIGH);
}

I have not programmed the ESP8266 directly because I haven't got the Serial/USB connector yet. The simple example of what I am trying to work on is shown on the app image:

[img]c:\Temp\RemoteXY_Test_Project.jpg[/img]

Thanks for any suggestion you may have!

8

Re: ESP8266 connection to Android.

Try to open serial monitor of your Arduino. What do you see after reset? Copy to here.
If all right you should see the following:

AT 
AT+RST 
ATE0 
AT+CWMODE=2 
AT+CWDHCP=0,1 
AT+CWSAP="RemoteXY","12345678",10,4 
AT+CIPMODE=0 
AT+CIPMUX=1 
AT+CIPSERVER=1,6377

9

Re: ESP8266 connection to Android.

I had the same problem as You and figure it out that the connection speed between ESP and Arduino is not right.
As You mentioned your ESP8266 speed is 115200 but it RemoteXY communicate at speed of 9600 now even if you change the speed it still has problems ( now the difference between you and me I'm using soft serial which doesn't allow speeds more than 19200) so I solve it be writing esp8266 firmware with speed of 9600 ( changing baud rate using AT+IPR=9600 doesn't work and set the ESP in lock state). now back to you you are using hardware serial which allows higher speed but I don't know why you have this problem.
For diagnosing my problem I enabled this line

//#define REMOTEXY__DEBUGLOGS Serial

in

Arduino/library/RemoteXY/remoteXY.h

But I don't think this will work because you are already connecting pin 0-1 to communicate with ESP and opening the Arduino terminal will block all communication.
Finally as Guillaume said

Do you really need your arduino between the esp and the smartphone? You can use esp as an arduino... it's 5-10x faster than most arduino boards, and has more memory. smile

Arduino takes longer time connecting to wifi due to serial communication so eliminate the middle man unless you have something  specific
Here in this picture you can see two setups on the left the ESP8266 standalone as nodemcu controller and on the right Arduino with ESP as wifi stations both working OK https://s21.postimg.org/bitd8da0n/IMG_1943.jpgupload picscertificity.com

10

Re: ESP8266 connection to Android.

Excuse Me new here
As is well known programs for controller must be assembler written.
Especially for 8 and 4 bit versions. May be lack of such code is the very point with mistakes encountered?
Moreover, if any need of asm progs for 16 bit and 8 bit assembler please ask.

11 (edited by sanoopam7 2020-07-25 05:30:58)

Re: ESP8266 connection to Android.

/*
   -- 8 relay switch by sanoop --
   
   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                   
     - for ANDROID 4.5.1 or later version;
     - for iOS 1.4.1 or later version;
   
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.   
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266WIFI_LIB
#include <ESP8266WiFi.h>

#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "Asianet_Broadband@sanoop"
#define REMOTEXY_WIFI_PASSWORD "navani484"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate 
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,0,0,134,0,10,30,1,
  130,1,0,28,65,50,203,129,0,4,
  7,60,5,1,72,65,76,76,32,47,
  84,86,47,32,83,85,66,32,67,79,
  78,84,82,79,108,0,129,0,14,17,
  32,6,204,49,57,50,46,49,54,56,
  46,48,46,53,0,130,1,2,30,59,
  46,208,2,0,30,34,22,11,36,8,
  31,31,79,78,0,79,70,70,0,2,
  0,30,55,22,11,36,8,31,31,79,
  78,0,79,70,70,0,130,1,6,32,
  20,20,140,129,0,12,38,8,6,247,
  84,86,0,130,1,6,53,20,18,154,
  129,0,11,58,11,6,15,115,117,98,
  0 };
 
// this structure defines all the variables and events of your control interface
struct {

    // input variables
  uint8_t switch_1; // =1 if switch ON and =0 if OFF
  uint8_t switch_2; // =1 if switch ON and =0 if OFF

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_SWITCH_1 D4
#define PIN_SWITCH_2 D3






void setup()
{
   Serial.begin(115200); // Start the serial monitor.
  delay(20); // Give it a moment.
  // Connect to WiFi network:
  Serial.println("Connect to WiFi network");
  IPAddress ip(192, 168, 0, 5);
  IPAddress gateway(192, 168, 0, 1);
  IPAddress subnet(255, 255, 255, 0);
  IPAddress dns(192, 168, 0, 1);
  WiFi.config(ip,dns,gateway,subnet);
  Serial.println("wifi Asianet_Broadband@sanoop ");
  Serial.println("ip IPAddress 192.168.0.5 ");
  WiFi.begin(REMOTEXY_WIFI_SSID, REMOTEXY_WIFI_PASSWORD);
  RemoteXY_Init ();
 
  pinMode (PIN_SWITCH_1, OUTPUT);
  pinMode (PIN_SWITCH_2, OUTPUT);
 
  // TODO you setup code
 
}

void loop()
{
  RemoteXY_Handler ();
 
  digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?HIGH:LOW);
  digitalWrite(PIN_SWITCH_2, (RemoteXY.switch_2==0)?HIGH:LOW);
 
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay()


}

12

Re: ESP8266 connection to Android.

void setup()
{
   Serial.begin(115200); // Start the serial monitor.
  delay(20); // Give it a moment.
  // Connect to WiFi network:
  Serial.println("Connect to WiFi network");
  IPAddress ip(192, 168, 0, 5);
  IPAddress gateway(192, 168, 0, 1);
  IPAddress subnet(255, 255, 255, 0);
  IPAddress dns(192, 168, 0, 1);
  WiFi.config(ip,dns,gateway,subnet);
  Serial.println("wifi Asianet_Broadband@sanoop ");
  Serial.println("ip IPAddress 192.168.0.5 ");
  WiFi.begin(REMOTEXY_WIFI_SSID, REMOTEXY_WIFI_PASSWORD);
  RemoteXY_Init ();