Any command fails

I have just started using the VSCode extension, but all commands (compile/verify/flash) fail miserably with a message like

> Executing task: make -f '/Users/luca/.particle/toolchains/buildscripts/1.5.0/Makefile' compile-user -s <

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
/Users/luca/Projects/hytta//src/hytta.cpp:9:25: fatal error: Seeed_DHT11.h: No such file or directory
compilation terminated.
make[3]: *** [../build/target/user/platform-6-m/hytta/src/hytta.o] Error 1
make[2]: *** [user] Error 2
make[1]: *** [modules/photon/user-part] Error 2
make: *** [compile-user] Error 2
The terminal process terminated with exit code: 2

Press any key to close the terminal.

This does not happen when I type particle flash blablabla. Any idea?

Actually I see now that there’s this problem with that library, but it used to fail even before that.
Anyways, I’ve added the library with particle library add blablabla and it is on my computer, but it still fails.

Libraries are installed in /Users/luca/Particle/… , shouldn’t they be in my project’s directory?

The not a git repositry message should not bother you

see this official statement

Can you repost the new error output after you corrected the library issue?

Hey, thanks!
I can’t seem to correct that library issue, libs are automatically installed in /Users/luca/Particle…
I would expect them to be in my project’s directory, any idea?

Problem solved, that was fast.
So here is what happened:

  • Yesterday I couldn’t get workbench to work so I started using the CLI tool instead.
  • It would compile and stuff and I thought it was working
  • I installed a number of libraries in some default directory, I started using one from Adafruit and it was not throwing errors so I believed it was working.
  • I try again today and I can’t use other libraries, thought that it was weird they were not being installed in my project, but idk.

Now I get workbench to work again after reinstalling the toolchain, and my libs are installed where I expected them to be.

Apparently the CLI doesn’t care about the working directory and installs stuff in some default ~/Particle place. I have no idea what I was flashing to the device then, but good that it’s running fine now.

Thanks again.

Libraries want to go into the lib folder.
If you are using from the library repostory you should use Particel: Install Library to get them setup correctly.

CLI installs libraries in the directory it is run from. If you use Particle: Launch CLI in Particle Workbench the path should get set correctly. Running it from a “normal” terminal window you’d have to take care of pointing CLI to the correct folder


Btw, do I have to always put the photon in dfu mode manually before flashing?

Particle is working on getting that step automatised, but for now you need to put the device into DFU or Listening Mode for wired updates, but you can do that by setting your host computers USB serial port the device is connected to to a “magic” baudrate 14400 to engage DFU Mode or 28800 for Listening Mode.
In Windows you’d do that via mode COMx 14400.

However, you can also OTA flash locally built firmware.

Awesome, many thanks.
Have a good weekend @ScruffR

1 Like

thanks for using Workbench :pray::+1:

Now I get workbench to work again after reinstalling the toolchain

in the future, be aware that currently you’ll often need to run a clean step (Terminal > Run Task… then type “Particle” to see the full list) when switching platforms or device os versions. we warn about this “dirty” state when you first open your project and are working to make the process smoother overall but for now, when in doubt, clean :slight_smile:

also, you can get a quick sense of whether or not Workbench is installed properly by running the Particle: Audit Environment command and reviewing the report it generates. if you do see issues, running Particle: Reset Environment is a good option to try as well.

reinstalling either the Workbench extension(s) or a specific toolchain should really be the last resort - it’s almost always either a configuration issue or the need to clean a previous build or a more fiddly environment issue that won’t be rectified (directly) with a reinstall.

lastly, if you haven’t seen them already we have docs over here:

and within Workbench via the Particle: Get Help command. if there are things missing, please let us know as we’re continually making improvements here :pray:

1 Like