Bear with me as I info-dump - I haven’t got a clue what might or might not be relevant, as I only use VSCode/PlatformIO intermittently, for the single purpose of fiddling with the Marlin firmware for my 3-D printer.
I’m doing this on a Mac running Catalina (Newest MacOS version that will install on this machine without hacking)
Initially, I followed the combined advice of several YouTube videos - Download and install VSCode, hit the marketplace and get the PlatformIO and Auto Build Marlin packages, download/clone the Marlin repository, use VSCode to do the required edits on the Marlin configuration.h/configuration_adv.h files, bring up the ABM plugin and hit the button for my build, copy the resulting *.bin file to an SD card and flash it to the printer, lather, rinse, repeat as needed. This worked just fine across several upgrades to the printer and/or updates to Marlin itself that needed a new compile to bring online, and eventually, I got things to where I wanted them. Once I got things dialed in, I had no further immediate need for VSCode and associated stuff, including PlatformIO, so it sat idle, untouched, doing nothing but claiming a few megabytes of disk space. Ready - or so I thought - to spring into action the next time I need to change something in the firmware. So far as I’m aware, nothing about the setup changed - or was even looked at - everything just sat there for the few months that passed when I didn’t need to actually use it.
TL/DNR: I HAD a setup of VSCode/PlatformIO/Auto Build Marlin that WAS working perfectly fine, repeatedly doing exactly as expected. Now I don’t, for no reason that can figure out.
Fast forward to last weekend, when I did some hardware tinkering on the printer that required firmware changes - No problem! Just whip out the ready-to-go VSCode installation and setup, hit the “build” button in ABM, and away we go!
Except that instead of hitting the build button on the Auto Build Marlin screen and getting a terminal pane scrolling the various source code filenames as the compile proceeds, and eventually a fresh-built “firmware-.bin” file I can put on the SD card to flash the printer, I keep getting what follows in the terminal pane that opens up after the button is hit:
platformio run -e STM32F103RE_creality ; echo "done" "/var/folders/hp/hp0wkzzx5p52jmdl3mj93kbh0000gn/T/ipc"
MyUserID@MyMachine Marlin-2.1.2 % platformio run -e STM32F103RE_creality ; echo "done" >|"/var/folders/hp/hp0wkzzx5p52jmdl3mj93kbh0000gn/T/ipc"
zsh: command not found: platformio
MyUserID@MyMachine Marlin-2.1.2 %
After driving myself crazy for several days trying to figure out and fix what might be wrong, (Need I mention that I had no success?) I gave up - uninstalled/deleted everything to do with VSCode, PlatformIO, Auto Build Marlin, and everything else that seemed to make even a speck of sense, and started over - intending it to be a right from scratch clean start. (Yes, I got the .vscode, .platformio and .cache directories, along with the preferences and everything else associated - or at least, I THOUGHT I got everything…)
Downloaded a spankin’ fresh copy of VSCode for Mac, un-crated it, and fired it up.
It comes up as though I never quit the program! (Even though I had to quit it before the OS would let me delete the VSCode.app file!) The cursor is sitting there at the end of the last change I made to the configuration.h file! OK, something’s fishy, but let’s keep moving - Go to the marketplace, get/install PlatformIO IDE (and apparently various dependencies), ditto for Auto Build Marlin, then in an abundance of caution, quit VSCode, and restart it. Again, it comes up with my project open. Still smells fishy to me, but let’s see what happens. Bring up ABM’s screen. Hit the “make-it-happen” button of the right build variant, and get:
platformio run -e STM32F103RE_creality ; echo "done" >|"/var/folders/hp/hp0wkzzx5p52jmdl3mj93kbh0000gn/T/ipc"
MyUserID@MyMachine Marlin-2.1.2 % platformio run -e STM32F103RE_creality ; echo "done" >|"/var/folders/hp/hp0wkzzx5p52jmdl3mj93kbh0000gn/T/ipc"
zsh: command not found: platformio
MyUserID@MyMachine Marlin-2.1.2 %
Seems to indicate that there are some “App turds” left after a “get rid of VSCode and friends” operation… Chase several of those down and wipe 'em out, try the reinstall process again. Get the same result. (The text I’ve already pasted twice, and no new firmware-*.bin file like I used to get when I did exactly the same thing.)
OK, since I can’t seem to clean out all traces of VSCode - The new install picked up as though I’d never quit the program, let alone deleted it - I’ll go another route - Create a new user account, log in to it, download fresh copies of everything involved, and try from that account. Presto! Success! Works just as well as it did back when I first started upgrading my printer!
OK, at least I can flash my printer with the new firmware it needs, but what’s going wrong that forces me to jump through these insane hoops to manage to do it? And more important, how do I fix it so I don’t need to jump through the hoops in the first place? This seems to me a lot like spending years to customize your car, getting it to the point of “just the way I like it”, but after the first few drives, the tires fall off, so you have to rent a rusted-out Yugo to get around.
Any help for the kid?