My smartphone can't recognize ESP8266

I have a problem with my project. My My smartphone doesn't recognize ESP8266 and I can't connect it for controlling my robot with the app. Can anyone help me?

You started a topic in the Uncategorised category of the forum when its description explicitly tells you not to

Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics

This is my Arduino code:

/* include library */
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
WiFiClient client;

/* defining server prt */
ESP8266WebServer server(80);

/* Define WiFi Credentials */
const char* ssid = "hash";/* Your SSID */
const char* password = "12345678";/* Your Password*/

String data="";

#include "HCPCA9685.h"
/* I2C slave address for the device/module. For the HCMODU0097 the default I2C address
is 0x40 */
#define  I2CAdd 0x40
int pos1=0;
int pos2=100;
int pos3=200; 
int pos5=150;
const float pos4=80.0/pos5;
/* Create an instance of the library */
HCPCA9685 HCPCA9685(I2CAdd);

void setup() {
Serial.begin(115200);
Serial.println("GPIO test!");

/*connecting to WiFi */
server.begin();
Serial.println("server started");

HCPCA9685.Init(SERVO_MODE);
  /* Wake the device up */
HCPCA9685.Sleep(false);
  unsigned int Pos;
}
  
/* Move Forward */
void move_forward() {
    /* Initialise the library and set it to 'servo mode' */
HCPCA9685.Init(SERVO_MODE);
  /* Wake the device up */
HCPCA9685.Sleep(false);
  unsigned int Pos;
  
  HCPCA9685.Servo(2, pos1);
  HCPCA9685.Servo(5, pos1);
}

void loop() {
/* Handling Request */
server.handleClient();
String data = server.arg("Key");
Serial.println(data);

if (data == "F") {
  move_forward(); /* If data B moves forward */
}
}

void handleRequest() {
  if (server.hasArg("Key")) {
    Serial.println(server.arg("Key"));
  }
  if (server.hasArg("Speed")) {
    Serial.println(server.arg("Speed"));
  }
  server.send(200,"text/html","");
  delay(1);
}

void connectingToWiFi() {
  delay(3000);
  WiFi.disconnect();
  delay(1000);
  Serial.println("Connecting to WiFi");
  WiFi.begin(ssid, password);
  while ((!(WiFi.status() == WL_CONNECTED))) {
    delay(1000);
    Serial.print("...");
  }
  Serial.println("Connected");
  Serial.println("Local IP is : ");
  Serial.print((WiFi.localIP().toString()));
  delay(5000);
}


You need to give more details of what you are trying to do

Please post the code that is running on the ESP8266, using code tags when you do. Which 'phone app are you using ?

thank you for your notice.I will be more careful next time

My smartphone model is Samsung A31

does the ESP8266 serial monitor output display connection to your network and display its IP address?
if so the smartphone should then be able to connect to the same WiFi network and a web client enter the IP address as the URL to view the web page
post your serial monitor output (as text not a screen image)

maybe easier for the ESP8266 to run an Access Point with web server - the smartphone then connects to the access point to view the web page

no serial monitor doesn't display connection

I used MIT App inventor to make android app

after compiling and uploading what does it display?

displays this message:

. Variables and constants in RAM (global, static), used 29016 / 80192 bytes (36%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ DATA     1504     initialized variables
╠══ RODATA   976      constants       
╚══ BSS      26536    zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 60491 / 65536 bytes (92%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ ICACHE   32768    reserved space for flash instruction cache
╚══ IRAM     27723    code in IRAM    
. Code in flash (default, ICACHE_FLASH_ATTR), used 270544 / 1048576 bytes (25%)
║   SEGMENT  BYTES    DESCRIPTION
╚══ IROM     270544   code in flash   
esptool.py v3.0
Serial port COM8
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 30:83:98:82:a7:38
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 304896 bytes to 221421...
Writing at 0x00000000... (7 %)
Writing at 0x00004000... (14 %)
Writing at 0x00008000... (21 %)
Writing at 0x0000c000... (28 %)
Writing at 0x00010000... (35 %)
Writing at 0x00014000... (42 %)
Writing at 0x00018000... (50 %)
Writing at 0x0001c000... (57 %)
Writing at 0x00020000... (64 %)
Writing at 0x00024000... (71 %)
Writing at 0x00028000... (78 %)
Writing at 0x0002c000... (85 %)
Writing at 0x00030000... (92 %)
Writing at 0x00034000... (100 %)
Wrote 304896 bytes (221421 compressed) at 0x00000000 in 19.8 seconds (effective 123.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

That is not the Serial monitor output

Nothing is displayed there

before starting the server you need to connect to the WiFi network, e.g.

void setup() {
  Serial.begin(115200);
  delay(3000);
  Serial.println("GPIO test!");
  WiFi.begin(ssid, password);
  Serial.println("");
  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  /*connecting to WiFi */
  server.begin();

did you test the WiFi and server before adding the HCPCA9685 code
are you sure the HCPCA9685 works on the ESP8266?
did you test it in a separate program before attempting the control it via a web page

how have you connected and powered the HCPCA9685 and servo?

Yes. I tested HCPCA9685 with this code

#include "HCPCA9685.h"
 
/* I2C slave address for the device/module. For the HCMODU0097 the default I2C address
 
is 0x40 */
 
#define  I2CAdd 0x40
int pos1=0;
int pos2=100;
int pos3=200; 
int pos5=150;
const float pos4=80.0/pos5;

/* Create an instance of the library */
 
HCPCA9685 HCPCA9685(I2CAdd);
 
void setup()

{
  /* Initialise the library and set it to 'servo mode' */
 
HCPCA9685.Init(SERVO_MODE);
 
  /* Wake the device up */
 
HCPCA9685.Sleep(false);
 
  unsigned int Pos;

  HCPCA9685.Servo(2, pos1);
  HCPCA9685.Servo(5, pos1);
  HCPCA9685.Servo(8, pos1);
  HCPCA9685.Servo(11, pos1);

 HCPCA9685.Servo(1, pos1);
 HCPCA9685.Servo(4, pos1);
 HCPCA9685.Servo(7, pos1);
 HCPCA9685.Servo(10, pos1);

  HCPCA9685.Servo(0, pos2);
  HCPCA9685.Servo(3, pos2);
  HCPCA9685.Servo(6, pos2);
  HCPCA9685.Servo(9, pos2);

for(Pos = pos1; Pos< pos5; Pos++)
   {
 HCPCA9685.Servo(2, Pos);
 HCPCA9685.Servo(5, Pos);
 HCPCA9685.Servo(8, Pos);
 HCPCA9685.Servo(11, Pos);
 HCPCA9685.Servo(1, Pos*pos4);
 HCPCA9685.Servo(4, Pos*pos4);
 HCPCA9685.Servo(7, Pos*pos4);
 HCPCA9685.Servo(10, Pos*pos4);
 delay(2);
 }  


}
 
void loop()
 
{

}

It works correctly

I tested your code but the result didn't changed.

The serial monitor should display at least:

GPIO test!

If it does not are you using the right speed on the serial monitor?
Press the reset button on the board.

you have a function connectingToWiFi() which you don't call - try

void setup() {
  Serial.begin(115200);
  delay(3000);
  Serial.println("GPIO test!");
  connectingToWiFi();
  /*connecting to WiFi */
  server.begin();
  Serial.println("server started");

if I then run your code the serial monitor displays

GPIO test!
Connecting to WiFi
.......................................Connected
Local IP is : 
192.168.1.91server started

I reset the board but nothing changed