I am a SW newbie. I’ve recently made the jump from Arduinio IDE to Vs and PlatformIO. I can’t seem to get the serial monitor to work. In the .ini, “monitor=115200”. I also have in setup "serial.begin(115200). The compile and upload execute and display correctly, and for some reason upload switches to a baud rate over 400K. After, the serial monitor prints out a few things, and then garbage that looks like the wrong baud rate. The serial monitor works fine in Arduino. Any hints?
— Terminal on COM5 | 115200 8-N-1
— Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
e�v�%�␘���D(��Q���Qj␕Qr�,␕���␃��y�␝B����C�)S�D�bTf�4�,Q�PiPNӠ�␌/h�␘␗␓�U{5�C␔��G�P�ʢ␋�PT���ֱ�pEӨ␎��k��␄�␘�O6E(j����
x�!����␘���
Yes, Absolutely. I had it running at 500kbaud on the Arduino IDE. This was all working fine on Arduino, so I am moving a working project to PlatformIO. It compiles, it uploads, and shows everything on the serial monitor, except for the serial output. It did work once, but not for long. It has me stumped.
Sorry for the reply delay. I see your point on the libraries. A blanket Arduino/Libraries also seems to really, really, slow down compilation. I did another open sourced project (Onstep) which required specific library versions. The concept is now gelled in my head!
As for serial, the monitor seems to still have problems, now it just doesn’t show up at all. I think there is some sort of conflict. When I shut down PlatformIO, and bring up Arduino, the serial monitor works fine. I need to do more work in that area.
Thanks for the library tip!
Bob
I want to update my reply:
I just added a few libraries via the “lib dependency” route. The program compiles, and those dependencies are in the .pio\libdeps folder, but they are not in the platformio.ini file. In the picture below, I added the dependencies in the .ini file, and no change, it still compiles fine. I also tried to add a lib_extra_dirs to point to a “modified” NTPClient.h (contains a “date” function), but I just can’t that to work. It can’t find the file. Any pointers?
If you have a modified version of the NTPClient in library, don’t include it in the lib_deps expression in the platformio.ini. Remove it from there. When building, PlatformIO will look into the lib/ folder and find your modified library.
(Also delete the .pio folder of the project after removing it from lib_deps so that the old library is definitely gone).
That was part of the problem. You can see my modified NTPClient in my library, but when compiling, it could not find the file. I made sure the “extra” function was not called, and just installed the regular NTPClient.