There are many topics discussing this same problem but I don’t understand any of the solutions. I am using Platformio 6.0.0 on vsCode. Running a simple program yields the expected serial monitor output. But when I run my real project then nothing shows on the serial monitor.
> Executing task in folder Blink-D1 Mini: C:\Users\KarlB\.platformio\penv\Scripts\platformio.exe device monitor <
--- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, nocontrol, printable
--- More details at https://bit.ly/pio-monitor-filters
--- Miniterm on COM3 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
rl␀l�r␂$␒�n␌␌␌�␌l�␌b|��␂␇␒�r␒b�␌b␄�nn␂lnn␒b␌b␜p�$b␎lrlp�n0␂␌␌�␌l␌�␂␌␌␌b␌n�n�␌�␄␌b��nn'l�␄l`␂�␒␒nn␌$`␂␎␂nr���n␌␌rr�`␂p�n␐␂␌␌r�␜␜b␌␄␂␌b␌n�n␌␄␌b��nn'␌␄l`␂�␒␒nn␌$`␂␎␂nr���n␌␌r␒l`␂␎r��n␌␌r␒l`␂�␂␌␌␌$␄␜␂l`␂��n�`␂Test
Test
Test
Test
Test
Test
It compiles in the Arduino IDE and runs. The usual string of nonsense comes out. The very last character is the first character of the first string to be printed. This also happens in platformio.
// // For basic WiFi OTA
// // #include <ESP8266mDNS.h>
// // #include <WiFiUdp.h>
// // #include <ArduinoOTA.h>
// For HTTPS OTA #include <ESP8266HTTPClient.h> // [builtin] http #include <WiFiClientSecureBearSSL.h> // [builtin] https #include <ESP8266httpUpdate.h> // [builtin] OTA #include “ota.h” // web server paths
It may be that one libraries allocates a global object whose constructor is crashing.
If you just #include the headers but not use any objects within them in the sketch, can you one-by-one remove the #include.. lines for each library until it works again to find the culprit?
Let me make certain I understand you. Let’s say I am using the LittleFS library. I comment out every use of it and then comment out the include. Then I go to another library until teh serial print problem is solved. Correct?
Do I need to remove the libraries in any other method?
OK, this was a stupid self inflicted wound. In a fit of misguided “cleverness” I redefined the TX and RX as output pins to supply an I2C device. This interfered with the serial output.
Thank you so much for the help. I really appreciated it. I’ve posted teh offending code below so that no one else tries to do the same thing.
Serial.begin(115200);
Serial.println("Start");
// redefine TX & RX for output of +3.3V & 0V
pinMode(RX_PLUS, FUNCTION_3); // plus
pinMode(RX_PLUS, OUTPUT);
digitalWrite(RX_PLUS, HIGH);
pinMode(TX_MINUS, FUNCTION_3); // minus
pinMode(TX_MINUS, OUTPUT);
digitalWrite(TX_MINUS, LOW);