• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

EPS32 not connected to Wifi Internet

Q&A Forum › Category: ESP32 › EPS32 not connected to Wifi Internet
0 Vote Up Vote Down
paulfjujo asked 1 year ago

Hello,
I tried to re-use an ESP32 application wich was running OK 2 years ago.

ESP32 Plot Sensor Readings in Charts (Multiple Series)

Now i can’t connect to my WIFI  LAN freebox ..i am sure about SSID and Password . I only can connect when create a new wifi Lan on my Phone  .. I can connect my application,  from original version

on this Wifi, i get  no link with internet
.. because  i must modifiy index.html and  include  the script  highcharts.js into the “data” directory
<script type=”text/javascript” src=”https://www.google.com/jsapi”></script&gt;
<!– <script src=”https://code.highcharts.com/highcharts.js”></script>–&gt;
<script src=”highcharts.js”></script>
With this change ,i get  a good result.. and open the web page at 192.168.86.30
if i try to use my Freebox Wifi LAN, i get  impossible to get AP
This Wifi Lan cover the range 192.168.0.100 to  … 113
I don’t know to find out the problem ?

/*********
  V.O. Rui Santos
  Complete instructions at https://RandomNerdTutorials.com/esp32-plot-readings-charts-multiple/
 rev paulfjujo
*********/
#define VERSION "2024-0210"
#define WithNTP
//#define With_MCP
//.... MCP HS !!!
//#define VERSION "2024-0209"
//#define WithNTP
// SANS MCP connecté
//#define VERSION "2022-0716"   // 09H00
//#define VERSION "2022-0627"   // 14H41
//#define WithNTP      // uncomment this line to use Ntpserver
// PB DS18B20 non rafraichie ..si Ntpserver utilisé
//#define VERSION "2022-0625"   // 12H20
// rajout afichage heure Mn, rajout 3 essais possible pour recuperer la connection au NTP serveur
//#define VERSION "2022-0624"   // 12H20
// rajout 6em Graph  : Y axis  MCP23017 0 à 255  (lecture port B)
//#define VERSION "2022-0623"   // 17H50
// suite rajout image animé de durée reduite de 3sec à 2sec   Data I2C OK
// sans Graph MCP23017
// modif pause Loop de 2500  à 3000mS
//#define VERSION "2022-0622"    //last :14h50
//  Problemo : plus de data I2C
// Rajout d'une table contenant  gauge DS18B20 + gauge pression + image + gif animé 
//#define VERSION "2022-0618"    //last :19h18
// new script.js  see RNTLAB forum
//#define VERSION "14-06-2022"
// add recherche adresse OWS
//#define VERSION "10-06-2022"
// 1 seule sonde OWS


#include 
#include 
#include 
#include 
#include 
#include 
#ifdef With_MCP
#include 
#endif
#include 
#include 
#include 
#include 
#include 
#include 
#include 
//#include 
//  192.168.0.110

// Replace with your network credentials
//const char* ssid ="ON_AIR2024";
//const char* password ="pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxco>1xxx"; // sur config freebox :  adsl.Free
//const char* password ="pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxco>1xxx";  // sur  TV SONY parametre Wifi freebox

// avec WIFI Manager
//const char* ssid = "ESP32_BlueAP";
//const char* password = "paulfjujo";

// OK avec reseau PHONE Redminote11
const char* ssid = "Redmi Note 11";
const char* password = "k9m5jfurubn";

#define OLED_ADDR 0x3C
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///60sec

char BMPOK=0;
char Presschar [10];

byte mcp_PA=0;
byte mcp_PB=0;
unsigned int mcp_PAB=0;
char MCP_Readchar[10];

#ifdef With_MCP
#define MCP23017_ADDR 0x20
MCP23017 mcp = MCP23017(MCP23017_ADDR);
#endif

char  Oled_Msg[64];  // up to 18 char en taille 1

int i,j,k;
byte addr[8];
byte type_s;


float temperatureC;
unsigned int Cpt=0;  // 22-06
float   p = 0.0;  // BMP085 Pression
float   t = 0.0 ;  // AM2302 temper
float   h = 0.0 ;  // AM2302 Humid

#define DHTTYPE DHT22 ;  // DHT type (DHT11, DHT22)
int DHTPIN = 5 ;        // GPIO D5  SCL BMP085
#define SDA  21           //ESP32 SDA I2C  fil vert --> SDA BMP085 

const int LedRouge = 19; 
const int LedBleue=15; 
const int LedVerte=18; 
const int LedOnBoard = 2; //bleue
String message = "";
String sliderValue1 = "0";
int dutyCycle1;
char Duty_Slider[10];


#ifdef WithNTP
// NTP server to request epoch time
//const char* ntpServer = "fr.pool.ntp.org";
//const char* ntpServer = "pool.ntp.org";
const char* ntpServer ="fr.pool.ntp.org";
struct tm timeinfo;  // Variable to save current epoch time
unsigned long epochTime;
const long  gmtOffset_sec = 7200;
const int   daylightOffset_sec = 0;  // 0 heure d'ete  3600 heure d'hiver
#endif

// Création des objets
const int oneWireBus = 4; // GPIO  DS18B20 
OneWire ds(oneWireBus);// Setup a oneWire instance to communicate with OneWire devices (DS18B20)
DallasTemperature sensors(&ds);// Pass our oneWire reference to Dallas Temperature sensor

Adafruit_BMP085 bmp; // connect to ESP32 I2C (GPIO 21 = SDA, GPIO 22 = SCL)
DHTesp dht;          // AM2302 DHT12
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// Address OWS  DS18B20 repérée #3 (CRC= 0x40 )
DeviceAddress sensor1 = { 0x28,0xFF, 0xAA, 0x56, 0xC1, 0x38, 0x14, 0x01};  

/*
IPAddress ip(192, 168,0,110);
IPAddress dns(212,27,40,240);
IPAddress gateway(192, 168,0, 254);
IPAddress subnet(255, 255, 255, 0);
*/

 void check_if_exist_I2C()
{
  nDevices = 0;
  Serial.println(" ");
  for (address = 1; address < 127; address++ ) 
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address < 16)  Serial.print("0");
      Serial.print(address, HEX);
      switch (address)
            {
                case 0x20: 
                 case 0x21:
                  case 0x22:
                   case 0x23:
                    case 0x24:
                     case 0x25: 
                     case 0x26:
                      case 0x27:
                    Serial.println(" MCP23017 2x8 Bits I/O"); // de base + 7 autres
                     break;
                
                case 0x28:
                case 0x29:
                case 0x2A:
                    // case etc ..
                     Serial.println(" PCF8574 8bits I/O"); // de base + 7 autres
                    break;
                case 0x37:
                      Serial.println(" LCD 2119 2x16cars"); // de base + 7 autres
                    break;
                case 0x38:
                case 0x39:
                case 0x3A:
                case 0x3B:
                    // case etc ..
                      Serial.println(" PCF8574A 8bits I/O"); // de base + 7 autres
                    break;
                case 0x3C:
                      Serial.println( " OLED SSD1306");
                      break;
                case 0x53:
                       Serial.println(" ADXL345 board");
                        break;
                case 0x57:
                        Serial.println(" EEPROM 512bytes");
                        break;
                case 0x68:
                        Serial.println(" RTC DS3231");
                        break;
                case 0x77:
                        Serial.println(" BMP 085 Pression");
                        break;
                default:
                        Serial.println(" non reconnue");
                        break;
           } //switch
      nDevices++;
    }
    delay(20);
  } //for loop
  if (nDevices == 0)
    Serial.println("No I2C devices found");
  else
    Serial.printf("Trouve %3d devices sur le Bus I2C\r\n",nDevices);
  error=0;
  delay(200);       
}


//rev 18-06-2022
//Get Sensor Readings and return JSON object
// 1 temperature  -10 à +40
// 2 Compteur   0 à 999
// 3 Pression  980-1030 mbar
// 4 temperature -10 +40
// 8 humidite  0 100%
// 5 degres OWS  -10 +40
// 6  MCP 0 à 1023

String getSensorReadings(){
  sensors.requestTemperatures();
  temperatureC = sensors.getTempCByIndex(0);
  readings["DS18B20"] = String(temperatureC);
  readings["Cpt"] = String(Cpt);
  p = bmp.readPressure() / 100.0F;  //mBar  ou hPa
  readings["Pression"] = String(p);  //
  t = dht.getTemperature();
  readings["Temperature"] = String(t);
  h=dht.getHumidity();
  readings["Humidity"] =  String(h);
  #ifdef With_MCP
  readings["MCP23017"] = String(mcp_PB);
  #endif
  String jsonString = JSON.stringify(readings);
  Serial.println(jsonString);
  return jsonString;
}

// Initialize SPIFFS
void initSPIFFS() {
  if (!SPIFFS.begin()) {
    Serial.println("An error has occurred while mounting SPIFFS");
  }
  else{
    Serial.println("SPIFFS mounted successfully");
  }
}


void get_network_info(){
    if(WiFi.status() ==3) // WL_CONNECTED)
    {
        Serial.print("[*] Network information for ");
        Serial.println(ssid);

        Serial.println("[+] BSSID : " + WiFi.BSSIDstr());
        Serial.print("[+] Gateway IP : ");
        Serial.println(WiFi.gatewayIP());
        Serial.print("[+] Subnet Mask : ");
        Serial.println(WiFi.subnetMask());
        Serial.println((String)"[+] RSSI : " + WiFi.RSSI() + " dB");
        Serial.print("[+] ESP32 IP : ");
        Serial.println(WiFi.localIP());
    }
}

// Initialize WiFi
void initWiFi() {
  int i=0;
  WiFi.disconnect();  //23-11-2022
  delay(1000);
  WiFi.mode(WIFI_STA);
  Serial.println("\nConnecting");
 
  /*
   set the IP address of the ESP32
   WiFi.config(ip, gateway, subnet, dns);
    delay(1000);
    */
  Serial.print(" SSID: ");
  Serial.println(ssid);
  Serial.print(" PWD: ");
  Serial.println(password);
  WiFi.begin(ssid, password);
  delay(1000);
  Serial.print("Connecting to WiFi ..");
  while (WiFi.status() !=3)  // WL_CONNECTED)
  {
   Serial.print('.');
   i++;
    if (i%32==0) Serial.println(".");
     delay(1000);
  }
   Serial.println(".");
   Serial.println(WiFi.localIP());
   get_network_info();
}


void OneWireScanner(){
  if ( !ds.search(addr))
  {
    Serial.println(" No more addresses.");
    Serial.println();
    ds.reset_search();
    return;
  }
  Serial.print(" ROM = ");
  for( i = 0; i < 8; i++)
  {
    Serial.write(' ');
    Serial.print("0x");
    if (addr[i] 3) return;
       }
       else 
       {break;
       }
      } while(t<4);
  if(tfinal && info->index == 0 && info->len == len && info->opcode == WS_TEXT)
  {
    data[len] = 0;
    message = (char*)data;
     Serial.print("Message :"); Serial.println(message);
    if (message.indexOf("1s") >= 0) 
    {
      sliderValue1 = message.substring(2);
      dutyCycle1 = map(sliderValue1.toInt(), 0, 100, 0, 1023);
      Serial.println(dutyCycle1);
    }
  }
}


void onEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) {
  switch (type) {
    case WS_EVT_CONNECT:
      Serial.printf("WebSocket client #%u connected from %s\n", client->id(), client->remoteIP().toString().c_str());
       break;
    case WS_EVT_DISCONNECT:
      Serial.printf("WebSocket client #%u disconnected\n", client->id());
      break;
    case WS_EVT_DATA:
       Serial.printf("WebSocket client #%u EVT Data\n", client->id());
      handleWebSocketMessage(arg, data, len);
      break;
    case WS_EVT_PONG:
    case WS_EVT_ERROR:
      break;
  }
}

void initWebSocket() {
  ws.onEvent(onEvent);
  server.addHandler(&ws);
}


void setup() {
  // Serial port for debugging purposes
  delay(500);
  Serial.begin(115200);
  delay(2000);    // some time to connect the Teraterm terminal ON

  pinMode(LedBleue, OUTPUT);
  pinMode(LedRouge, OUTPUT);
  pinMode(LedVerte, OUTPUT);
  digitalWrite(LedRouge, 0);
  pinMode(LedOnBoard, OUTPUT);
  Serial.println(" PWM test sur led 15");
  for (dutyCycle1=0;dutyCycle1<255;dutyCycle1=dutyCycle1+50)
  {
  analogWrite(LedBleue, dutyCycle1);
  delay(1000);
  
  }
  dutyCycle1=0;
  analogWrite(LedBleue, dutyCycle1);
  digitalWrite(LedOnBoard, 0);
 
  Serial.print(" _ESP32_Bleu_4_Charts_2024-02.ino");
  Serial.print(" with DS18B20,BMP085,Cpt,AM2302 Temp,Humidity,OLED,PWM");
  Serial.println(VERSION);
  Serial.println(" ESP32 Vroom 32 DevkitV1  (Bleu sur COM 11)) ");
  Serial.println(" Led Rouge sur D19  Led verte sur D18 Led Bleue sur D15");
  Serial.println(" DHT11-AM2302 sur D5 ");
  Serial.println(" Sonde temper.OWS  DS18B20 AA56C13 81401  sur D4 ");
  Serial.println(" I2C Bus sur   D21 (SDA)  et D22 (SCL) "); 

  #ifdef With_MCP
   Serial.println(" BMP085 +  OLED SSD1306 + MCP23017 sur le bus I2C");
  #else
  Serial.println(" BMP085 +  OLED SSD1306  sur le bus I2C");
  #endif
  Serial.println(" Recherche devices presents sur le bus I2C SCL=22 SDA=21");

  delay(1000);
  Wire.begin(SDA,SCL); // pin on ESP32
  check_if_exist_I2C();
  Serial.println("\r\n .. Fin de test I2C bus \r\n");
    
  sensors.begin();
  Serial.println(" Sensors begin\r\n");
  Serial.printf(" Compteur=%5d\r\n",Cpt); 

   //---- Pressure sensor BMP085 ---------------- 
  // Initialisation 
  if ( !bmp.begin() )
   {
    Serial.println(" BMP085 BAD!");
    delay(1000);
    BMPOK=0;
     p=999.99; 
   }
   else 
   {
    Serial.print(" BMP085 OK  ");
    BMPOK=1;
    p = bmp.readPressure() / 100.0F; 
    Serial.printf(" Press.% 5.0f mBar \r\n",p); 
  } 

  Serial.println(" Scan devices on OWS BUS ");
  for (i=0;i<3;i++)
  {
  Serial.printf(" i= %5d \r\n",i);
  OneWireScanner();
  Serial.println();
   delay(1000);
  }
  
   sensors.requestTemperatures();
   delay(100);
   temperatureC = sensors.getTempCByIndex(0);
   if (temperatureC send(SPIFFS, "/index.html", "text/html");
  });
  
   delay(1000);

  // Request for the latest sensor readings
  server.on("/readings", HTTP_GET, [](AsyncWebServerRequest *request){
    String json = getSensorReadings();
    request->send(200, "application/json", json);
    json = String();
  });
   
   server.on("/currentValue1", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(200, "/text/plain", String(sliderValue1).c_str());
    // 09-02-2024
    //k=sliderValue1.length()+1;
    //sliderValue1.toCharArray(Duty_Slider, k);
    // dutyCycle1=atoi(Duty_Slider);
    dutyCycle1= atoi(String(sliderValue1).c_str());
  });

  events.onConnect([](AsyncEventSourceClient *client){
    if(client->lastId()){
      Serial.printf("Client reconnected! Last message ID that it got is: %u\n", client->lastId());
    }
    client->send("hello!", NULL, millis(), 10000);
  });

   server.addHandler(&events);
   display.clearDisplay();

#ifdef WithNTP
   // Init and get the time
  Serial.println(" Get and print time from ntpServer");
  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
  printLocalTime();
#endif

  // Start server
  server.begin();
   Serial.println("init Websocket");
   initWebSocket();
}



void loop()
{
  if ((millis() - lastTime) > timerDelay)
  {
    // Send Events to the client with the Sensor Readings Every 10 seconds
    events.send("ping",NULL,millis());
    events.send(getSensorReadings().c_str(),"new_readings" ,millis());
    lastTime = millis();
   }
  else  //1
  {
   #ifdef WithNTP
    getLocalTime(&timeinfo);
    Serial.print("Heure: ");
    Serial.print(&timeinfo, "%H");
    Serial.print(":");
    Serial.print(&timeinfo, "%M");
    Serial.printf(", Cpt= %5d ",Cpt);
    #else
     Serial.printf(" Cpt= %5d ",Cpt);
    #endif
    display.clearDisplay();
    display.setCursor(0,0); 
    display.print(F("Compteur          ")); 
    display.setCursor(70,0); 
    snprintf(Oled_Msg,6,"% 5d",Cpt);
    display.print(Oled_Msg);
    //   display.display();
    
    if (BMPOK==1) 
    {
      p = bmp.readPressure() / 100.0F;  
    }
    else  //2
    { 
      p=999.99; 
    }
    Serial.printf(", BMP085 P.% 5.0f mBar  ",p); 

    display.setCursor(0,8); 
    delay(50);
    display.print(F("BMP085 P.    ")); 
    display.setCursor(70,8); 
    display.print(p);
    //  display.display();

    h=dht.getHumidity();
    if (isnan(h)) snprintf(Humidchar,6,"%s\t"," ???"); else  snprintf(Humidchar,6,"%2.2f\t",h);
    Serial.print(F(", Humid: ")); 
    Serial.print(Humidchar);

    display.setCursor(0,16);
    delay(50);
    display.print(F("AM2302 Humi  ")); 
    display.setCursor(76,16); 
    display.print(Humidchar);
    display.display();
    
    t = dht.getTemperature();
    if (isnan(t)) snprintf(Tempchar,6,"%s\t"," ???"); else snprintf(Tempchar,6,"%3.2f\t",t);
    Serial.print(F(",Temp: ")); 
    Serial.print(Tempchar);

   sensors.requestTemperatures();
    temperatureC = sensors.getTempCByIndex(0);
    if (temperatureC < -10.0) temperatureC= -10.0; 
    Serial.printf(",DS18B20.0 =% 3.2f C ",temperatureC);

    Serial.printf(", Slider =%5d ", dutyCycle1); 


    // affiche en alternance soit Temperature AM2302 , soit OWS DS18B20 sur la 4em ligne afficheur OLED
   if ((Cpt & 1)==1)
   { 
    digitalWrite(LedRouge,HIGH);
    display.setCursor(0,24);   delay(50);
    display.print(F("AM2302 Temp      ")); 
    display.setCursor(76,24);   delay(50);
    display.print(Tempchar);
   }
   else //3
   { 
    digitalWrite(LedRouge,LOW);
    display.setCursor(0,24);   delay(50);
    display.print(F("DS18B20          ")); 
    display.setCursor(76,24);  delay(50);
    display.print(temperatureC);
    
   }
   delay(50);
   display.display();

 #ifdef With_MCP

   mcp_PA= mcp.readPort(MCP23017Port::A);
   mcp_PB= mcp.readPort(MCP23017Port::B);
   mcp.writePort(MCP23017Port::A, i & 0x00FF);
   Serial.print(",MCP : 0x");
   if(mcp_PA<16) Serial.print("0");
   Serial.print(mcp_PA, HEX);
   Serial.print(",0x");
   if(mcp_PB999) Cpt=0;
  }  //else 1
    
    ws.cleanupClients(); 
    digitalWrite(LedOnBoard,LOW);
    delay(100);
    digitalWrite(LedOnBoard,HIGH);
    delay(100);
}

/*
 * rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
 PWM test sur led 15
 _ESP32_Bleu_4_Charts_2024-02.ino with DS18B20,BMP085,Cpt,AM2302 Temp,Humidity,OLED,PWM2024-0210
 ESP32 Vroom 32 DevkitV1  (Bleu sur COM 11)) 
 Led Rouge sur D19  Led verte sur D18 Led Bleue sur D15
 DHT11-AM2302 sur D5 
 Sonde temper.OWS  DS18B20 AA56C13 81401  sur D4 
 I2C Bus sur   D21 (SDA)  et D22 (SCL) 
 BMP085 +  OLED SSD1306  sur le bus I2C
 Recherche devices presents sur le bus I2C SCL=22 SDA=21
[  9559][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
 
I2C device found at address 0x3C OLED SSD1306
I2C device found at address 0x77 BMP 085 Pression
Trouve   2 devices sur le Bus I2C

 .. Fin de test I2C bus 

 Sensors begin

 Compteur=    0
[ 12311][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
 BMP085 OK   Press.  958 mBar 
 Scan devices on OWS BUS 
 i=     0 
 ROM =  0x28,  0xAA,  0x0D,  0x82,  0x38,  0x14,  0x01,  0xCD
  Chip = DS18B20


 DS18B20 = 18.94
 DHT11 Temp.: 19.10
 Humid : 57.10
[ 15213][W][Wire.cpp:301] begin(): Bus already started in Master Mode.
 SSD1306 allocation OK
init Wifi

Connecting
 SSID: Redmi Note 11
 PWD: k9m5jfurubn
[ 18345][W][WiFiGeneric.cpp:955] _eventCallback(): Reason: 202 - AUTH_FAIL
Connecting to WiFi ...
192.168.86.30
[*] Network information for Redmi Note 11
[+] BSSID : 4E:99:E7:D1:A9:11
[+] Gateway IP : 192.168.86.9
[+] Subnet Mask : 255.255.255.0
[+] RSSI : -27 dB
[+] ESP32 IP : 192.168.86.30
 WiFi mac@ : 08:3A:F2:8D:C9:94

SPIFFS mounted successfully
 Get and print time from ntpServer

Saturday, February 10 2024 12:51:47
Day of week: Saturday
Month: February
Day of Month: 10
Year: 2024
Hour: 12
Minute: 51
Second: 47

init Websocket
{"DS18B20":"19.00","Cpt":"0","Pression":"957.93","Temperature":"19.10","Humidity":"57.40"}
Heure: 12:51, Cpt=     0 , BMP085 P.  958 mBar  , Humid: 57.40,Temp: 19.10,DS18B20.0 = 18.81 C , Slider =    0 .
Heure: 12:51, Cpt=     1 , BMP085 P.  958 mBar  , Humid: 57.40,Temp: 19.10,DS18B20.0 = 18.81 C , Slider =    0 .
Heure: 12:51, Cpt=     2 , BMP085 P.  958 mBar  , Humid: 57.00,Temp: 19.10,DS18B20.0 = 18.81 C , Slider =    0 .


 
 -------------------------------------------------------------
 _ESP32_Charts_DS18B20_BMP085_Cpt_AM2302_BMP085_MSP2307_2022-0626
 ESP32 Vroom 32 DevkitV1  (Rouge sur COM 56) ou (Bleu sur COM 57)
 Led Rouge sur D5
 DHT11-AM2302 sur D2
 Sonde temper.OWS  DS18B20 sur D4
 I2C Bus sur   D21 (SDA)  et D22 (SCL)
 BMP085 +  OLED SSD1306 + MCP23017 sur le bus I2C
 Recherche devices presents sur le bus I2C SCL=22 SDA=21

I2C device found at address 0x20 MCP23017 2x8 Bits I/O
I2C device found at address 0x3C OLED SSD1306
I2C device found at address 0x77 BMP 085 Pression
Trouve   3 devices sur le Bus I2C

 .. Fin de test I2C bus

 Compteur=    0
 BMP085 OK   Press.  986 mBar
 Scan devices on OWS BUS
 i=     0
 No more addresses.


 i=     1
 ROM =  0x28,  0xAA,  0x56,  0xC1,  0x38,  0x14,  0x01,  0x40
  Chip = DS18B20


 DS18B20 = 25.50
  MCP23017 at  @0x20
 Active le PORT A du MCP , en sorties
 Active le PORT B du MCP , en entrees
 DHT11 Temp.: 26.20
 Humid : 67.70
 SSD1306 allocation OK
Connecting to WiFi .....
192.168.0.104
7C:9E:BD:54:72:F4

SPIFFS mounted successfully
Failed to obtain time

Sunday, June 26 2022 14:20:52
Day of week: Sunday
Month: June
Day of Month: 26
Year: 2022
Hour: 14
Minute: 20
Second: 52

Heure: 14:20, Cpt=     0 , BMP085 P.  986 mBar  , Humid: 73.60,Temp: 26.20,DS18B20 = 25.50 °C   ,MCP : 0x00,0x81
Heure: 14:20, Cpt=     1 , BMP085 P.  986 mBar  , Humid: 69.50,Temp: 25.30,DS18B20 = 25.50 °C   ,MCP : 0x09,0x81
Heure: 14:21, Cpt=     2 , BMP085 P.  986 mBar  , Humid: 69.50,Temp: 25.60,DS18B20 = 25.50 °C   ,MCP : 0x09,0x81
Heure: 14:21, Cpt=     3 , BMP085 P.  986 mBar  , Humid: 69.70,Temp: 26.40,DS18B20 = 25.50 °C   ,MCP : 0x09,0x81


esptool.py v4.2.1
Serial port COM11
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 08:3a:f2:8d:c9:94
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000f6fff...
Compressed 17440 bytes to 12108...
Writing at 0x00001000... (100 %)
Wrote 17440 bytes (12108 compressed) at 0x00001000 in 0.5 seconds (effective 278.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 290.4 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.2 seconds (effective 402.6 kbit/s)...
Hash of data verified.
Compressed 943344 bytes to 598107...
Writing at 0x00010000... (2 %)
Writing at 0x0001b1ed... (5 %)
Writing at 0x00025985... (8 %)
Writing at 0x00034f54... (10 %)
Writing at 0x0003eca5... (13 %)
Writing at 0x00044b93... (16 %)
Writing at 0x0004ae77... (18 %)
Writing at 0x00050c89... (21 %)
Writing at 0x0005631d... (24 %)
Writing at 0x0005bc15... (27 %)
Writing at 0x00061325... (29 %)
Writing at 0x00066c58... (32 %)
Writing at 0x0006c01a... (35 %)
Writing at 0x000712eb... (37 %)
Writing at 0x000764f3... (40 %)
Writing at 0x0007b7cb... (43 %)
Writing at 0x00080c44... (45 %)
Writing at 0x00085ed5... (48 %)
Writing at 0x0008b0f4... (51 %)
Writing at 0x000903cc... (54 %)
Writing at 0x00095891... (56 %)
Writing at 0x0009b4e3... (59 %)
Writing at 0x000a0a28... (62 %)
Writing at 0x000a5c58... (64 %)
Writing at 0x000ab0e7... (67 %)
Writing at 0x000b056f... (70 %)
Writing at 0x000b5c45... (72 %)
Writing at 0x000bb3a4... (75 %)
Writing at 0x000c11c7... (78 %)
Writing at 0x000c6b83... (81 %)
Writing at 0x000ccfd1... (83 %)
Writing at 0x000d559a... (86 %)
Writing at 0x000dde3c... (89 %)
Writing at 0x000e2eb6... (91 %)
Writing at 0x000e89d0... (94 %)
Writing at 0x000edd33... (97 %)
Writing at 0x000f35c6... (100 %)
Wrote 943344 bytes (598107 compressed) at 0x00010000 in 10.1 seconds (effective 749.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
[SPIFFS] data   : D:\_ESP32_2024\_ESP32_Bleu_4_Charts_2024-02\data
[SPIFFS] start  : 2686976
[SPIFFS] size   : 1408
[SPIFFS] page   : 256
[SPIFFS] block  : 4096
/accessibility.js
/favicon.png
/gauge.min.js
/highcharts.js
/index.html
/mylogo_CI_90x68.jpg
/script.js
/style.css
[SPIFFS] upload : C:\Users\Paul\AppData\Local\Temp\arduino_build_324551/_ESP32_Bleu_4_Charts_2024-02.spiffs.bin
[SPIFFS] address: 2686976
[SPIFFS] port   : COM11
[SPIFFS] speed  : 921600
[SPIFFS] mode   : dio
[SPIFFS] freq   : 80m

esptool.py v4.2.1
Serial port COM11
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 08:3a:f2:8d:c9:94
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00290000 to 0x003effff...
Compressed 1441792 bytes to 199321...
Writing at 0x00290000... (7 %)
Writing at 0x002a6dff... (15 %)
Writing at 0x002bd600... (23 %)
Writing at 0x002d626d... (30 %)
Writing at 0x002ecf03... (38 %)
Writing at 0x002fe8ec... (46 %)
Writing at 0x00312903... (53 %)
Writing at 0x0032620c... (61 %)
Writing at 0x00339c0e... (69 %)
Writing at 0x0034e2a8... (76 %)
Writing at 0x00361e3a... (84 %)
Writing at 0x003756fc... (92 %)
Writing at 0x003879f8... (100 %)
Wrote 1441792 bytes (199321 compressed) at 0x00290000 in 10.9 seconds (effective 1061.1 kbit/s)...
Hash of data verified.

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


 */
  


Ok,except no feeback for the slider

 

with (Redmi Note 11 wifi actived)
Result:

https://imgur.com/CZoArTL

 

Question Tags: WiFi Connection
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
Unfortunately, I don’t know how to solve that issue.
Does that happen with all web server projects or just this one?
 
Are you using a static IP address?
Are you sure the IP you want to set is not being used by other device?
Can you double-check the other settings for the static IP?
For the DNS server use the following IP address instead:

IPAddress dns(8,8,8,8);

Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.