Need help with file structure for particle (Visual Studio)

Hi,
I have Visual studio set up as IDE for particle development.
There is no problem with simple 1-file projects to write the app, compile on cloud and upload to the device, this is all working fine.

The issue I have is when I try to use external libraries (the sdfat lib in my current project), visual studio cannot find the library files. I have tried placing a “lib” folder in my VS project directory and tried to set environment path but cannot understand where they need to go for VS to find them.

Thanks

Hello,

Let me ping someone that might be able to help, @tylercpeacock are you able to assist?

Kyle

The easiest way to do this is to follow these rules for creating your project structure.

A typical layout is:

project.properties
src
   myapp.ino

You’d specify the libraries you want to use in the project.properties file.

Also, make sure you compile using the CLI by positioning yourself in the top level of your app project (where project.properties is) and doing something like:

particle compile photon . --saveTo firmware.bin

The important part is to use . (dot) and not my myapp.ino. If you specify only a single file, only that file will be built, not the whole project.

2 Likes

Thanks,
I copied all the library files into the main visual studio source file and created the projects.properties file with dependencies and it now compiles and uploads to my photon ok.

Which is more than I can say for Particles DEV. When I run the same project in dev I get useless info that there was a timeout or error.

I had hoped to settle on Particle Photon and Electron for several new product lines but the development cycle is frustrating and slow, the compiler does not provide proper compile error messages and having to connect to the cloud for everything is annoying. I think I’ll stick with the ESP8266 for wifi IOT device and see if I can find an alternative to Electron that has better local (desktop) development tools with debugger.

It’s a little bit of a pain to setup initially, but the local build chain works great after initial setup:

https://docs.particle.io/faq/particle-tools/local-build/

i do most of my building that way; works entirely offline with no cloud requirements.

2 Likes

I see the setup and DOS commands but cannot see the IDE for development?
I work in Windows and like an integrated debugger environment where I can set breakpoints, single step and set up watches on variables during development.Can this be done with the local build chain.

I located a device almost identical to Electron that has an acceptable IDE. They provide an Arduino library so Code can be developed locally using Arduino IDE (which I also have plugin for VS). I have ordered several of these to try out.
https://hologram.io/docs/guide/dash/programming-and-firmware/