Storing Code on MS OneDrive

I am a newbie struggling to transition up to Workbench. I like it, but am still making lots of newbie mistakes, but these will get better with more practice, I am sure. But the latest hurdle has me stumped. With the WebIDE I was always able to store my projects on MS OneDrive, which is useful because I work on different computers at different locations. But now I find that Workbench can’t seem to find projects on One Drive. I went back to basics and wrote a simple blink the internal LED program, which would not compile when stored on One Drive. I then moved it to my desktop and it compiled and flashed and worked as expected.

I am getting a lightbulb that seems to indicate I need to edit the “include Path” setting, but I am not sure what to do about it. Perhaps the file is on One Drive but the libraries I need or on my computer and the compiler can’t find them?

Do I need to keep two copies of the code. One on One Drive and another on my local PC and then copy the code off One Drive onto the local PC at the other location? There must be a better way!

Any suggestions?

Thanks
Chris

Folder sync apps such as OneDrive or Dropbox do not play well with code repositories in my experience. They watch the filesystem for changes in realtime and sync files. When you couple that with the potentially thousands (or hundreds of thousands) of files that can make up a repo, and that change frequently (i.e. a clean and recompile) they tend to choke.

Instead I suggest keeping your repo local and using git or another version control system to store your code.

1 Like

Another issue often seen with Windows and Workbench/CLI is users having blanks in the user/account name as the OneDrive usually lives in the %USERPROFILE% directory a blank in the account/user name will carry forward into the OneDrive structure.

Thanks for the prompt response. Do you see any advantage for a newbie like me to use github to store my code rather than just storing in on One Drive and then making a local copy to use on the PC wherever I am?

Yes. You not only get a repo for your code, but also gain version control. Even if you just work from the master branch it’s still a benefit. VS Code integrates nicely with github, so the learning curve isn’t too steep. You can get into more advanced techniques like branching later.

1 Like

Thank you for the prompt reply also. I looked around for clues regarding the account name and %PROFILE% as part of my education because I have seen the compiler grumble about spaces in the path from time to time. But I can’t see any evidence of that. My UserName is Chris with no spaces and the OneDrive path does not seem to have any spaces in it. There is a funny thing that the Path still uses Skydrive from the days before it was called One Drive.

The errors shown are as follows:
make[3]: *** […/build/module.mk:274: …/build/target/user/platform-6-m/1086WorkbenchPractice2/src/1086WorkbenchPractice2.o] Error 1
make[2]: *** […/…/…/build/recurse.mk:12: user] Error 2
make[1]: *** […/build/recurse.mk:12: modules/photon/user-part] Error 2
make: *** [C:\Users\Chris.particle\toolchains\buildscripts\1.9.2\Makefile:54: compile-user] Error 2

I found the make file and looked at it,but didn’t know enough to recognize any errors.

Do you think that I should just leave it alone for now and resign myself to keeping a local copy and a backup on One Drive when I know I will be heading for my other computer?

Thanks
Chris

Are you sure that path is valid? I don’t run Workbench on Windows, but on Mac/Linux there is a .particle directory in the home directory. Note the preceeding . in the name, which on Mac/Linux means it’s a hidden directory. The path above implies that your username is Chris.particle, and it’s looking for a folder called toolchains inside your home dir. Check to see what the actual path should be.

1 Like

That I am afraid to say is the trade-off with using Workbench (on premise) - much better code editor and compiler feedback/checking but it is local. As @picsil has pointed out storing your code file to github (cloud) is a sensible step - IME getting that working if you haven’t used github before takes a while. I have tried having a Workbench setup on a desktop and another on a laptop. Maybe if you used OneDrive to always store the latest version and download to your local drive before you edit then it might work.

1 Like

Thank you for that excellent summary and confirmation of the issue. Knowing this, I can go ahead and save files to One Drive when they have stabilized enough to make them worth keeping. The advantages of using Workbench make this trade-off worthwhile. I just wanted to make sure I was not missing something.

All part of the learning process. :slight_smile:

I really appreciate the support I get from the community. I like to do everything I can think of myself before bothering you all. I wouldn’t want to wear out the “welcome mat”.

Thanks
Chris

1 Like