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.