hello,
After getting some problem with Plateform IO
and automatic software update .. to ESP32 2.6 !
i get Many problems with OneWire !!
so i go bak to ESP32 2.3
Now OneWire isagain OK
but i can’t anymore get WWifi connection , with all my previous applications
…there all were OK before .
i recompile this , using classic Arduino IDE 1.8.16
and esptool.py v3.3
no external data , Html is included in the code.
Compile is OK
Terminal display values are OK
….. until programm try to connect to my wifi lan.
(SSID and PWD are OK)
i don’t see other Wifi client on my WIFI Lan (ON_Air2022)
when using the tool Languard Network scanner…
it is like NO WIFI firmware exist on my ESP32 !
(tested also without Norton firewall -> no succes)
some idea ?
27/01/2023
recompil
ESP32_Bleu_I2C_DHT11_MCP23017_DS18B20_Led_Cpt_2022-07
ESP32 Wrover module DIO
modif:
// your network credentials
//const char* ssid =”ON_AIR2022″;
//const char* password = “cG…………………………………………………..v4”;
remplacé par
#include “D:\_ESP32_2023_2022\ESP32_Secret_datas.h”
Results on Esplorer terminal :
Got answer! Communication with MCU established.
AutoDetect firmware…
Can’t autodetect firmware, because proper answer not received (may be unknown firmware).
Please, reset module or continue.
_r
ESP32_Bleu_I2C_DHT11_MCP23017_DS18B20_Led_Cpt_2022-07.ino version : 27/01/2023
ESP32 Vroom 32 DevkitV1 (Bleu) sur COM 57
Led Rouge sur D19 , Led Verte sur D18 ,Led bleue sur D15
DHT11-AM2302 sur D5
Sonde temper.OWS DS18B20 sur D4
I2C Bus sur D21 (SDA) et D22 (SCL)
I2C adresses 7 bits devicesI2C device found at address 0x20 MCP23017 2×8 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
BMP085 OK
Scan devices on OWS BUS
i= 0
ROM = 0x28, 0xAA, 0x56, 0xC1, 0x38, 0x14, 0x01, 0x40
Chip = DS18B20
DS18B20 = 14.50
MCP23017 at @0x20 Active le PORT A du MCP , en sorties
Active le PORT B du MCP , en entrees
Connecting to ON_AIR2022
no more dialogue with Esplorer terminal !
no wifi connection …
but programme restart ! Why?
..because i can see again, 3 leds blinkings
…in setup:
for (i=0;i<4;i++)
{
digitalWrite(LED_I, HIGH);
digitalWrite(LedVerte, HIGH);
digitalWrite(LedRouge, HIGH);
digitalWrite(LedBleue, LOW);
delay(500);
digitalWrite(LED_I, LOW);
digitalWrite(LedVerte, LOW);
digitalWrite(LedRouge, LOW);
digitalWrite(LedBleue, HIGH);
delay(500);
}Start your code here/*********
Rui Santos
Complete project details at https://randomnerdtutorials.com
*********/
// deconnecter D2 ) pour charger le programme !
#define VERSION “27/01/2023”
// modif affectation des pins pour eviter l’usage de D2
//#define VERSION “04/07/2022”
// ESP32 Bleu Serial port COM57
//#define VERSION “27-05-2022”
// add MCP2307
// add DS18B20
// add DHT11 AM2302
//#define VERSION “15-05-2022”
// Load Wi-Fi library
#include <WiFi.h>
#include <WiFiClientSecure.h>
#include <WebServer.h>
#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <Adafruit_Sensor.h>
#include <MCP23017.h>
#include <DHTesp.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// your network credentials
//const char* ssid =”ON_AIR2021″;
//const char* password = “cGT>1_@?LOdBqD6kd%s@v|.b5x^4PD|?s}uu*j4o)Uqpa|r1jftH+H>8_oG6}v4”;
#include “D:\_ESP32_2023_2022\ESP32_Secret_datas.h”
// Address OWS sensor #3
DeviceAddress sensor1 = { 0x28,0xFF, 0xAA, 0x56, 0xC1, 0x38, 0x14, 0x01}; // ma sonde DS18B20 repérée #3 (CRC= 0x40 )
//TX2 17
//RX2 16
#define SCL 22 //ESP32 jaune –> SCL BMP085
#define SDA 21 //ESP32 fil vert –> SDA BMP085
// set pin numbers
const int LedRouge = 19; // number of the LED Rouge pin
const int LedBleue = 15;
const int LedVerte = 18;
const int LED_I = 2; // inbuilt Led
#define DS3231_ADDR 0x68 // 7 bits adresse , sinon 0xD0 sur 8 bits
#define OLED_ADDR 0x3C
#define MCP23017_ADDR 0x20
MCP23017 mcp = MCP23017(MCP23017_ADDR);
char MCP_Readchar[10];
byte mcp_PA=0;
byte mcp_PB=0;
unsigned int mcp_PAB=0;
// Création Object AM2302-DHT22
DHTesp dht;
#define DHTTYPE DHT22 ; // DHT type (DHT11, DHT22)
int DHTPIN = 5 ; // GPIO D4 <– Broche du capteur AM2302
// GPIO where the DS18B20 is connected to
const int oneWireBus = 4;
OneWire ds(oneWireBus);// Setup a oneWire instance to communicate with OneWire devices (DS18B20)
DallasTemperature sensors(&ds);// Pass our oneWire reference to Dallas Temperature sensor
#define SEALEVELPRESSURE_HPA (1013.25)
byte nDevices = 0;
byte error=0;
byte address=0;
int i,j,k;
byte addr[8];
byte type_s;
char Tempchar [10];
char Humidchar[10];
char Presschar [10];
char Ana0char[10];
char temp[64];
char BMPOK=0;
unsigned int Compteur;
float temperatureC;
float p = 0.0;
float t = 0.0 ;
float h = 0.0 ;
// Variable to store the HTTP request
String header;
unsigned long currentTime = millis();
unsigned long previousTime = 0;
const long timeoutTime = 2000; // time in milliseconds (example: 2000ms = 2s)
bool status;
IPAddress local_IP(192, 168, 0, 108);
// Set your Gateway IP address
IPAddress gateway(192, 168, 0, 254);
IPAddress subnet(255, 255, 255, 0);
IPAddress primaryDNS(212,27,40,241); //optional
IPAddress secondaryDNS(212,27,40,240); //optional
Adafruit_BMP085 bmp;
String getMyLogo()
{
String MyLogo= “<br> rajout (mylogo_32x32.ico) image en format base64 <br><br>”;
MyLogo +=”<img alt=\”no image\” src=\”data:image/x-icon;base64,AAABAAEAICAAAAEACACoCAAAFgAAACgAAAAgAAAAQAAAAAEACAAAAAAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAAQEBAAGBgYACAgIAAoKCgAMDAwADg4OABAQEAASEhIAFBQUABYWFgAYGBgAGhoaABwcHAAeHh4AICAgACIiIgAkJCQAJiYmACgoKAAqKioALCwsAC4uLgAwMDAAMjIyADQ0NAA2NjYAODg4ADo6OgA8PDwAPj4+AEBAQABCQkIAREREAEZGRgBISEgASkpKAExMTABOTk4AUFBQ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3lXMmdHOB4HBwdjLR4eLi0mHR4eHicnLi4uHldnZl9meVcubz8HBwcHB148Hh4hPkMPDx4eMTE3NzceUF5fZ2dxTCVnQwcHBwcHXk0eHh4nP00eHh4mOD4vMSdXX1A/MR4VHWY/Bx4yR1NYQx4rRyEnMyceHiE3Li4rKy4fHhYeHh4hb15QU009Li0hDx9nTCEnHh4WHj88PT4/Hh4eHh4eDx5GPTMuLR0PIQ8VDx5XVx4WDxYPMTEuIB4eFQ8PDw8PDw8PHi0uJzItDw8PDxU/Dw8PDw8PBw8eHg8PDw8PDwcPBw0HHjIuJx4NDw8VDw8PDw8PDw8PDw8PDw8PDw8NBwcNDQ0NDw0HBw0sLCwsLCEsLCwsDw8PDw8PDw0NDQ0NDQ0NDQ0NDQ0NDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\” />”;
MyLogo +=”<br><br>”;
return MyLogo;
}
// Set web server port number to 80
WiFiServer server(80);
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:
Serial.println(” MCP23017 2×8 Bits I/O”); // de base + 7 autres
break;
case 0x27:
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(10);
} //for loop
if (nDevices == 0)
Serial.println(“No I2C devices found”);
else
Serial.printf(“Trouve %3d devices sur le Bus I2C\r\n”,nDevices);
delay(200);
}
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] < 0x10) Serial.write(‘0’);
Serial.print(addr[i], HEX);
if ( i != 7 ) {
Serial.print(“, “);
}
}if (OneWire::crc8(addr, 7) != addr[7]) {
Serial.println(“CRC is not valid!”);
return;
}
Serial.println();// the first ROM byte indicates which chip
switch (addr[0]) {
case 0x10:
Serial.println(” Chip = DS18S20″); // or old DS1820
type_s = 1;
break;
case 0x28:
Serial.println(” Chip = DS18B20″);
type_s = 0;
break;
case 0x22:
Serial.println(” Chip = DS1822″);
type_s = 0;
break;
default:
Serial.println(” Device is not a DS18x20 family device.”);
return;
}
Serial.println();
}
void setup() {
delay(1000);
Serial.begin(115200);
delay(200);
// pinMode(buttonPin, INPUT);
pinMode(LedVerte, OUTPUT); // initialize the LED pin as an output
pinMode(LedRouge, OUTPUT); // initialize the LED pin as an output
pinMode(LedBleue, OUTPUT); // initialize the LED pin as an output
pinMode(LED_I, OUTPUT);
for (i=0;i<4;i++)
{
digitalWrite(LED_I, HIGH);
digitalWrite(LedVerte, HIGH);
digitalWrite(LedRouge, HIGH);
digitalWrite(LedBleue, LOW);
delay(500);
digitalWrite(LED_I, LOW);
digitalWrite(LedVerte, LOW);
digitalWrite(LedRouge, LOW);
digitalWrite(LedBleue, HIGH);
delay(500);
}Serial.println(“\r\n_r\n”);
Serial.print(” ESP32_Bleu_I2C_DHT11_MCP23017_DS18B20_Led_Cpt_2022-07.ino”);
Serial.print(” version : “); Serial.println(VERSION);
Serial.println(” ESP32 Vroom 32 DevkitV1 (Bleu) sur COM 57 “);
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 sur D4 “);
Serial.println(” I2C Bus sur D21 (SDA) et D22 (SCL) “);
delay (500);
Serial.println(” I2C adresses 7 bits devices “);
delay(2000);
Wire.begin(SDA,SCL); // pin on ESP32
check_if_exist_I2C();
Serial.println(“\r\n .. Fin de test I2C bus \r\n”);
sensors.begin();
//—- Pressure sensor BMP085 —————-
// Initialisation
if ( !bmp.begin() )
{
Serial.println(” BMP085 BAD!”);
delay(2000);
BMPOK=0;
} else
{
Serial.println(” BMP085 OK”);
BMPOK=1;
}
Serial.println(” Scan devices on OWS BUS “);
for (i=0;i<4;i++)
{
Serial.printf(” i= %5d \r\n”,i);
OneWireScanner();
Serial.println();
delay(1000);
}
sensors.requestTemperatures();
delay(100);
temperatureC = sensors.getTempCByIndex(0);
if (temperatureC < -10.0) temperatureC= -10.0;
Serial.printf(” DS18B20 =% 3.2f\r\n”,temperatureC);
// — MCP23017 ———————-
// https://github.com/blemasle/arduino-mcp23017
Serial.print(” MCP23017 at @0x20 “);
mcp.init();
Serial.println(” Active le PORT A du MCP , en sorties”);
// setGPIOAMode(0);
mcp.portMode(MCP23017Port::A, 0);
Serial.println(” Active le PORT B du MCP , en entrees”);
mcp.portMode(MCP23017Port::B, 0b11111111); //Port B as input
mcp.writeRegister(MCP23017Register::GPIO_A, 0x00); //Reset port A
mcp.writeRegister(MCP23017Register::GPIO_B, 0x00); //Reset port B
// GPIO_B reflects the reverse logic as the input pins state
// (press a button to lit a led)
mcp.writeRegister(MCP23017Register::IPOL_B, 0xFF);
//—– DHT11 AM2302 Sensor —————-
dht.setup(DHTPIN,DHTesp::DHT22);// Connect to Wi-Fi network with SSID and password
Serial.print(“Connecting to “);
Serial.println(ssid);
Serial.println(password);
WiFi.begin(ssid, password);
status=WL_IDLE_STATUS;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}// Print local IP address and start web server
Serial.println(“”);
Serial.println(“WiFi connected.”);
Serial.println(“IP address: “);
Serial.println(WiFi.localIP());
server.begin();
// Print ESP MAC Address
Serial.println(“MAC address: “);
Serial.println(WiFi.macAddress());
i=1;
}
void loop()
{WiFiClient client = server.available(); // Listen for incoming clients
if (client)
{ // If a new client connects,
currentTime = millis();
previousTime = currentTime;
Serial.println(“New Client.”); // print a message out in the serial port
String currentLine = “”; // make a String to hold incoming data from the clientwhile (client.connected() && currentTime – previousTime <= timeoutTime) // loop while the client’s connected
{
currentTime = millis();
if (client.available())
{ // if there’s bytes to read from the client,
char c = client.read(); // read a byte, then
Serial.write(c); // print it out the serial monitor
header += c;
if (c == ‘\n’)
{ // if the byte is a newline character
// if the current line is blank, you got two newline characters in a row.
// that’s the end of the client HTTP request, so send a response:
if (currentLine.length() == 0)
{
// HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
// and a content-type so the client knows what’s coming, then a blank line:
client.println(“HTTP/1.1 200 OK”);
client.println(“Content-type:text/html”);
client.println(“Connection: close”);
client.println();// Display the HTML web page
client.println(“<!DOCTYPE html><html>”);
client.println(“<head><meta name=\”viewport\” content=\”width=device-width, initial-scale=1\”>”);
client.println(“<meta http-equiv=\”Refresh\” content=\”10\”>”);
client.println(“<link rel=\”icon\” href=\”data:,\”>”);
// CSS to style the table
client.println(“<style>body { text-align: center; font-family: \”Trebuchet MS\”, Arial;}”);
client.println(“table { border-collapse: collapse; width:40%; margin-left:auto; margin-right:auto; }”);
client.println(“th { padding: 12px; background-color: #0043af; color: white; }”);
client.println(“tr { border: 1px solid #ddd; padding: 12px; }”);
client.println(“tr:hover { background-color: #bcbcbc; }”);
client.println(“td { border: none; padding: 12px; }”);
// client.println(“.sensor { color:white; font-weight: bold; background-color: #bcbcbc; padding: 1px; }”);
client.println(“.sensor { color:black; font-weight: bold; background-color: #ffffff; padding: 1px; }”);
client.println(“</style>”);
client.println ( “<script type=\”text/javascript\”>”);
client.println (” var target = new XMLHttpRequest();”);
client.println (” let Consigne=0;”);
client.println (” function MoinsVite(){“);
client.println (” if (Consigne > 0) Consigne = Consigne – 1;”);
client.println (” document.getElementById(‘ConsigneID’).innerHTML = Consigne;”);
client.println (” target.open(‘POST’, ‘/MoinsVite’, true); };”);
client.println (” function PlusVite() {“);
client.println (” Consigne = Consigne + 1;”);
client.println (” document.getElementById(‘ConsigneID’).innerHTML = Consigne;”);
client.println (” target.open(‘POST’, ‘/PlusVite’, true); };”);
client.println (” document.getElementById(‘EtatLV’).innerHTML = digitalRead(LedVerte)”);
client.println (” </script>”);// client.println(getJavas());
client.println(“</head><body><h1>ESP32 VROOM DevkitV1 Bleu</h1>”);
client.println(“<h4> ESP32_Bleu_I2C_DHT11_MCP23017_DS18B20_Led_Cpt_2022-07</h4>”);
client.println(“<h4> Mac@ = “);
client.println(WiFi.macAddress()); client.println(“</h4><br>”);
client.println(“<table><tr><th>MEASUREMENT</th><th>VALUE</th></tr>”);
client.println(“<tr><td><h3>Capteur AM2302</h3></td></tr><span class=\”sensor\”>”);
client.println(“<tr><td><b>Temperature : </b></td><td>”);
client.println(t);
client.println(“*C</td></tr>”);
client.println(“<tr><td><b>Humidite : </b></td><td>”);
client.println(h);
client.println(“<td> %</td></tr>”);client.println(“<tr><td><h3>Capteur BMP085</h3></td>”);
client.println(“<tr><td><b>Pression </b></td><td>”);
client.println(bmp.readPressure() / 100.0F);
client.println(” mBar</td></tr>”);
client.println(“<tr><td><h4></h4></td></tr>”);client.println(“<tr><td><b>MSP23017<b></td><td>”);
client.printf(” MCP_Out= %02X MCP_Inp=%02X </td></tr>”,mcp_PA,mcp_PB);
client.println(” </td></tr>”);
client.println(“<tr><td><b>DS18B20<b></td><td>”);
client.printf(” OWS#1= %3.2f”,temperatureC) ;
client.println(“</td></tr>”);
client.println(“<tr><td><b> Index </b></td><td><span class=\”sensor\”>”);
client.println(i);
client.println(“</td></tr>”);
client.println(“</tr></table><br>”);client.println(“<form action=’/’ method=’POST’>”);
client.println(“<ul>Etat Led Verte : <a id=\”EtatLV\”>0</a></ul>”);
client.println(“<br><INPUT type=’radio’ name=’LedVerte’ Value=’1′><b>ON</b> ”);
client.println(“<INPUT type=’radio’ name=’LedVerte’ Value=’0′><b>OFF</b></li></ul>”);client.println(“<br><h3>Consigne Vitesse</h3>”);
client.println(“<p>Consigne= <a id=\”ConsigneID\”>0</a> <br> </p>”);
client.println(“<br><p>”);
client.println(“<button class=\”buttonGreen\” type=\”button\” onclick=\”PlusVite()\”> +Vite</button> ”);
client.println(“<button class=\”buttonYellow\” type=\”button\” onclick=\”MoinsVite()\”> -Vite</button>”);
client.println(“</p>”);
client.println(“</body></html>”);
// The HTTP response ends with another blank line
client.println();
// Break out of the while loop
break;
}
else
{ // if you got a newline, then clear currentLine
currentLine = “”;
}
}
else
{
if (c != ‘\r’) { // if you got anything else but a carriage return character,
currentLine += c; // add it to the end of the currentLine
}
}
}
}
// Clear the header variable
header = “”;
// Close the connection
client.stop();
Serial.println(“Client disconnected.”);
Serial.println(“”);}
else
{
delay(1000);
i++;
Serial.printf(“i=%5d ,”,i);
if (BMPOK==1) p = bmp.readPressure() / 100.0F; else p=999.99;
Serial.printf(” Press.% 5.0f mBar ,”,p);
// model=dht.getModel();
t = dht.getTemperature();
if (isnan(t))
{
//Serial.println(” PB T.DHT11 “);
snprintf(Tempchar,6,”%s\t”,” ???”);
}
else
{
snprintf(Tempchar,6,”%3.2f\t”,t);
Serial.print(F(” DHT11 Temp.: “));
Serial.print(Tempchar);
}
h=dht.getHumidity();
if (isnan(h))
{
snprintf(Humidchar,6,”%s\t”,” ???”);
}
else
{
snprintf(Humidchar,6,”%2.2f\t”,h);
}
Serial.print(F(” Humid : “));
Serial.println(Humidchar);mcp_PA= mcp.readPort(MCP23017Port::A);
mcp_PB= mcp.readPort(MCP23017Port::B);
mcp.writePort(MCP23017Port::A, i & 0x00FF);
Serial.printf(” MCP_Out= %02X MCP_Inp=%02X , OWS: “,mcp_PA,mcp_PB);
sensors.requestTemperatures();
temperatureC = sensors.getTempCByIndex(0);
Serial.print(temperatureC);
Serial.println(“*C”);
if ((i & 1)==1) digitalWrite(LedRouge,HIGH); else digitalWrite(LedRouge,LOW);
}
}
Hello,
All my previous ESP32 application can’t get a Wifi link anymore !
since a plateformIo automatic update … i don’t know what change has been made ?
If i load Wifiscan application in my ESP32.. it’s works fine
i can discover the Wifi Lan around me ;
scan start
scan done
3 networks found
1: DIRECT-SP-BRAVIA (-66)*
2: ON_AIR2022 (-67)*
3: Chambre Milhan.b (-93)
so it seems RF ESP32 Hardware is OK .. What could be the problem ?
Is there a wifi Firmware installed in the ESP32 , or Wifi is installed by the application upload ?
I have also an ESP8266 wich can connect to my WIFI Lan .. so i think probleme is on ESP32 side ..
Do i have to remove all ARDUINO + VSC + PlateformIo and re install all …to sove this problem ?
Working with ESP32 is now very complicated .. to much softwares and versions problems ..
Programmed Obsolescence for old ESP32 ?
Hi.
I’m sorry for taking so long to get back to you.
For some reason, I wasn’t notified of your question.
I don’t think it is a problem with VS Code.
I recommend erasing the ESP32 flash. Then, try to upload a code using ARduino IDE. See if it can connect to your network. Then, try again with VS Code. Tell me if you get any errors.
To erase the flash, you can take a look at this discussion:
Let me know your results.
Regards,
Sara
hello Sara,
after added path for eptool.exe …..
C:\Users\Paul\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.2.1\esptool.exe
i was able to launch the command
my ESP32 is connected trough USB connection to virtual COM57
C:\>esptool –chip esp32 com57 erase_flash
esptools error invalide chois com57
C:\>esptool –chip auto –port com57 erase_flash
gives:
espotoll.py V4.21
Serial port com57
connecting
detecting chip type ..unsuported detection protocol, switching and trying again
connecting….
detecting chip type ..EP32
chip is ESP32-S0WQD6 (revision 1)
Features Wifi,BT,Dual Core,240Mhz,Vref Calibration in efuse,Coding Schem nono
Crystal is 40MHz
uploading stub….
Running stub ….
…….. and STAY alwways in this situation ???
i can’t stop the program .. by CTRL C , or CTRL Z or ESC
so i closed Invite_Msdos windows
restart 2em essai
Microsoft Windows [version 10.0.18362.1256]
(c) 2019 Microsoft Corporation. Tous droits réservés.
C:\>esptool --chip esp32 -port COM57 erase_flash --trace
'esptool' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Modification du PATH pour rajout Esptool
C:\>PATH C:\Users\Paul\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.2.1;%PATH%
C:\>esptool --chip esp32 --port COM57 erase_flash
esptool.py v4.2.1
Serial port COM57
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...
Erasing flash (this may take a while)...
Chip erase completed successfully in 14.9s
Hard resetting via RTS pin...
C:\>
2nd test :
so Erasing seems OK,
and i will test again if my application can connect to wifi
… to follow
hello, unfortuntly, Bad results, impossible to get a Wifi link … with Esplorer V0.2.0 Rc5 terminal i get this
sur Esplorer terminal
PORT OPEN 115200
Communication with MCU..
Got answer!
Communication with MCU established.
AutoDetect firmware... Can't autodetect firmware, because proper answer not received (may be unknown firmware).
Please, reset module or continue. ts Jun 8 2016 00:22:57 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:2 load:0x3fff0030,len:1184 load:0x40078000,len:12784 load:0x40080400,len:3032 entry 0x400805e4 _r ESP32_Rouge_AsynWebServer_AM2302_Gauges_2023-012023_0105 ESP32 Vroom 32 DevkitV1 (bleu) sur COM 57 Led Rouge sur D19 DHT11-AM2302 sur D5 Sonde temper.OWS DS18B20 sur D4 I2C Bus sur D21 (SDA) et D22 (SCL) I2C adresses 7 bits devices 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 BMP085 OK Compteur= 0 Press. 1006 mBar MCP23017 at @0x20 Active le PORT A du MCP , en sorties Active le PORT B du MCP , en entrees DHT11 Temp.: 17.30 Humid : 48.60 SSD1306 allocation OK Init SPIFFS SPIFFS mounted successfully Init Wifi Connecting to WiFi ..
this message “Can’t autodetect firmware” is suspicious !
Could be possible that resident ESP32 vrom 32 devkitV1 firmware disapered ?
when erasing ESP32… even i get the correct MAC adress of this ESP32
Try to upload a blank sketch only with setup() and loop() with arduino IDE and then try again.
hello Sara,
i did this test .. compile and uplad
and then reload my application …
with differents versions: ESP 2.0.1 ESP 2.02 ESP2.03 …
No way to get a wifi connection …
Nota : Wifiscan application can see the my Wifi Land and other Wifi Lan aroud me..
Seems RF hardware is OK ..
but somewhat block my wifi connection …
i ordered new ESP 32 , to check if i get or not same problems…
i have no probleme with my other modules ESP8266 Lolin … so SSID and PWD are OK …
..to follow ..after some weeks …
hello Sara,
i just receceived New ESP32 Vroom-32 ESP32 DEVKITV1 and i get samme problem..
Using Arduino IDE 1.8.9
No way to get a wifi connection ..so Hardware is not the problem
i tested with Board version ESP 2.0.5 => bad, can’t compile without errors !
and board version ESP 2.0.2
=> compile is OK, \data transfer is OK
…runing application with I2C OLED , OWS DS18B20, AM2302 sensors …all are OK
i get info on Serial link (trough USB connection)
.. but NO wifi !
I don’t know wich way to follow to get a solution
… Window problem , java problem, version ESP, version ARDUINO, ESPTOOLS …
it seems problem occured after update of Chrome or PlatformeIO ( and maybe other windows software ..)
Hadcopy Esplorer connected to my ESP32 board via USB ( virtual com57)
With RNTLAB WIFISCAN application
this ESP32 can detect WIFI LAN around me !
so ????
https://1drv.ms/u/s!AgSdoVts608TiThHzU5qRZktuL3P?e=qYWLFa
Hi.
If the hardware is fine, that’s probably an issue with your code.
Have you tried other web server projects?
Are you using analog pins in your code? Please note that ADC2 pins cannot be used when Wi-Fi is used. So, check which GPIOs you are using. You may consider using an ADC1 GPIO instead if you’re using analog functions.
Regards,
Sara
This question continues here: https://rntlab.com/question/how-to-know-and-or-set-the-wifi-channel-on-an-esp32/