Has anyone played around with these micontrollers with the Arduino IDE?
I was just playing around with the SimpeBLE sample and noticed a couple of things that are different to programming Arduino microcontrollers.
One observation is that, when you close the Serial Monitor and open it again it does not reset the ESP32 as it does with Arduino.
This had me stumped for a bit because it looked as though Serial output in setup() only worked if you uploaded the sketch and opened Serial Monitor the first time but after that Serial seemed to get hung up. Eventually it dawned on me what was going on when I put a Serial.println("XXXXX") in loop().
I also noticed this in setup()
Serial.setDebugOutput(true);
Does anyone have any idea what this function does?
That function turn on debug output from the WiFi library so you can see what is happening to your WiFi connection.
"By default the diagnostic output from WiFi libraries is disabled when you call Serial.begin(). To enable debug output again, call Serial.setDebugOutput(true). To redirect debug output to Serial1 instead, call Serial1.setDebugOutput(true).
You also need to use Serial.setDebugOutput(true) to enable output from printf() function."
That function turn on debug output from the WiFi library so you can see what is happening to your WiFi connection.
"By default the diagnostic output from WiFi libraries is disabled when you call Serial.begin(). To enable debug output again, call Serial.setDebugOutput(true). To redirect debug output to Serial1 instead, call Serial1.setDebugOutput(true).
You also need to use Serial.setDebugOutput(true) to enable output from printf() function."
Oh! Had no idea ESP32 core had the printf function available. That's nice.
boylesg:
One observation is that, when you close the Serial Monitor and open it again it does not reset the ESP32 as it does with Arduino.
It is the same like with esp8266. For the reset and reset to flashing mode the board must support it and the IDE must know that the selected board supports it. The setting is in boards.txt.
boylesg:
Oh! Had no idea ESP32 core had the printf function available. That's nice.
esp8266 arduino core has it too. it is implemented in the Print class. Stream class inherits it from Print class, Serial and Client inherit from Stream and classes like HardwareSerial, WiFiClient inherited the printf methods from them.