Many thanks for yur reply.
You will find the minimum script to do the troble.
If you run the script, the buzzer make a lot of noise.
#include "esp_wifi.h"
#include <WiFi.h>
#define BEEP 2
void WiFiStationConnected(WiFiEvent_t event, WiFiEventInfo_t info){
Serial.printf("%lu:: Connected to AP successfully, SSID: %s, level: %d [dB]\r\n", millis(), WiFi.SSID().c_str(), WiFi.RSSI());
}
void WiFiStationDisconnected(WiFiEvent_t event, WiFiEventInfo_t info){
Serial.println(F("Disconnected from WiFi"));
connectToNextNetwork();
}
void WiFiGotIP(WiFiEvent_t event, WiFiEventInfo_t info){
IPAddress ip = WiFi.localIP();
Serial.printf("WiFi connected, IP address: %d.%d.%d.%d, level: %d [dB]\r\n", ip[0], ip[1], ip[2], ip[3], WiFi.RSSI());
} // WiFiGotIP
void setup(){
pinMode(BEEP, OUTPUT); // TEST THIERRY
digitalWrite(BEEP, false);
Serial.begin(115200);
while(!Serial){
;
}
delay(1000);
Serial.println("Starting..");
WiFi.onEvent(WiFiStationConnected, ARDUINO_EVENT_WIFI_STA_CONNECTED); // version 2.0x
WiFi.onEvent(WiFiGotIP, ARDUINO_EVENT_WIFI_STA_GOT_IP); // version 2.0x
WiFi.onEvent(WiFiStationDisconnected, ARDUINO_EVENT_WIFI_STA_DISCONNECTED); //version 2.0x
connectToNextNetwork();
} // setup
void connectToNextNetwork(){
WiFi.disconnect(true, true);
WiFi.begin("truc", "machin");
}
void loop() {
;
}
Hello again,
I reduce the code to produce the beep noise:
#include "esp_wifi.h"
#include <WiFi.h>
#define BEEP 2
void setup(){
pinMode(BEEP, OUTPUT); // TEST THIERRY
digitalWrite(BEEP, false);
Serial.begin(115200);
while(!Serial){
;
}
delay(1000);
Serial.println("Starting..");
}
void loop() {
WiFi.begin("truc", "machin");
delay(1000);
}
You will find the minimum script to do the troble.
If you run the script, the buzzer make a lot of noise.
#include "esp_wifi.h"
#include <WiFi.h>
#define BEEP 2
void WiFiStationConnected(WiFiEvent_t event, WiFiEventInfo_t info){
Serial.printf("%lu:: Connected to AP successfully, SSID: %s, level: %d [dB]\r\n", millis(), WiFi.SSID().c_str(), WiFi.RSSI());
}
void WiFiStationDisconnected(WiFiEvent_t event, WiFiEventInfo_t info){
Serial.println(F("Disconnected from WiFi"));
connectToNextNetwork();
}
void WiFiGotIP(WiFiEvent_t event, WiFiEventInfo_t info){
IPAddress ip = WiFi.localIP();
Serial.printf("WiFi connected, IP address: %d.%d.%d.%d, level: %d [dB]\r\n", ip[0], ip[1], ip[2], ip[3], WiFi.RSSI());
} // WiFiGotIP
void setup(){
pinMode(BEEP, OUTPUT); // TEST THIERRY
digitalWrite(BEEP, false);
Serial.begin(115200);
while(!Serial){
;
}
delay(1000);
Serial.println("Starting..");
WiFi.onEvent(WiFiStationConnected, ARDUINO_EVENT_WIFI_STA_CONNECTED); // version 2.0x
WiFi.onEvent(WiFiGotIP, ARDUINO_EVENT_WIFI_STA_GOT_IP); // version 2.0x
WiFi.onEvent(WiFiStationDisconnected, ARDUINO_EVENT_WIFI_STA_DISCONNECTED); //version 2.0x
connectToNextNetwork();
} // setup
void connectToNextNetwork(){
WiFi.disconnect(true, true);
WiFi.begin("truc", "machin");
}
void loop() {
;
}
Hello again,
I reduce the code to produce the beep noise:
#include "esp_wifi.h"
#include <WiFi.h>
#define BEEP 2
void setup(){
pinMode(BEEP, OUTPUT); // TEST THIERRY
digitalWrite(BEEP, false);
Serial.begin(115200);
while(!Serial){
;
}
delay(1000);
Serial.println("Starting..");
}
void loop() {
WiFi.begin("truc", "machin");
delay(1000);
}