Fix reboot bugs due to TinyConsole

This commit is contained in:
Francois BIOT
2022-12-03 20:34:59 +01:00
parent d8b24adef7
commit 5a3e9bd90e
5 changed files with 21 additions and 18 deletions

View File

@@ -7,7 +7,7 @@ MqttBroker broker(PORT);
*
* +-----------------------------+
* | ESP |
* | +--------+ |
* | +--------+ |
* | | broker | | 1883 <--- External client/s
* | +--------+ |
* | |
@@ -15,30 +15,30 @@ MqttBroker broker(PORT);
*
* Your ESP will become a MqttBroker.
* You can test it with any client such as mqtt-spy for example
*
*
*/
const char* ssid = "";
const char* password = "";
void setup()
void setup()
{
Serial.begin(115200);
if (strlen(ssid)==0)
Serial << "****** PLEASE MODIFY ssid/password *************" << endl;
Console << TinyConsole::red << "****** PLEASE MODIFY ssid/password *************" << endl;
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
while (WiFi.status() != WL_CONNECTED) {
Serial << '.';
delay(500);
}
Serial << "Connected to " << ssid << "IP address: " << WiFi.localIP() << endl;
Connect << TinyConsole::green << "Connected to " << ssid << "IP address: " << WiFi.localIP() << endl;
broker.begin();
Serial << "Broker ready : " << WiFi.localIP() << " on port " << PORT << endl;
Console << "Broker ready : " << WiFi.localIP() << " on port " << PORT << endl;
}
void loop()