Managing Sketches and Libraries with Multiple Computers

Hi, I'm asking this here because You Da Guys.. who are doing lots of development and answering complex questions.

I use many different Libraries you and others write. I also write a lot of sketches. I have a 'main computer' that I'm typing on and where I do most original sketches with some desktop Arduino stuff. But I am doing Home Automation stuff and have a machine in the living room near an Arduino setup that's supposed to be up 24/7 . Then I have a machine on the electronics bench where sometimes I'm testing stuff, using the scope etc. Two WIN7 and one XP.

I got outta control again today, with backlevel libraries etc etc. I just zipped and merged all libraries and most Sketches. I really don't want to do that every day/week.

What do you do to manage this? There must be some elegant and possibly simple way of doing this that I haven't thought of!

I bet some of you got this figgered out :slight_smile:

I bet some of you got this figgered out

Networking and mapped network drives. Are your computers all on the same network?

Hi Paul, Yes same network here... How would you map all the stuff? How would the machines 'know' where stuff is?

use a NAS for your Arduino folder ? // NAS == network attached storage
also useful for your PDF's datasheets etc.

The SYNOLOGY DS-212J is a nice piece of metal :wink: but there are more bigger and smaller,
Make sure to use at least RAID 0 (2 disks)

If you have three computers, MC, HA, and AO, then one of them (say MC) has the Arduino software and libraries on the C drive. On HA and AO, map the C drive on MC as the D drive (or whatever letter you like). On HA and AO, the Arduino software and sketches will be on the (mapped/mounted) D drive, rather than actually being installed/saved on the actual computer.

Thanks, Paul! So the MC (Master) machine is like a server for the others.. right?

How do I get the other IDE's to know where the libraries are??

Rob, I do plan to get a NAS or Server machine Real Soon Now...

I use Subversion for this purpose. Super easy to set up and use on any modern non-windows OS. Also possible on windows but you'll need something like TortoiseSVN.

For example, I have a linux firewall, linux media server, linux on two RasPis, OSX on two MBPs and an imac. One SVN (Subversion) repository on one of the linux servers that holds all my code in a version controlled manner. I can push updates or check out revisions from any of the linux or OSX instances with a quick one-line command.

It might be a foreign concept right now but the learning curve is very small and once you start using it you'll wonder how you ever used multiple machines (and/or developers) to work on one project without it. Other options are CVS and git that basically do the same thing. CVS is antiquated and git is probably overkill, although the architecture of git is pretty cool and if yo uwant to stick your stuff on github, it's free and easy to use. You can also keep it private and local though if you want.

How do I get the other IDE's to know where the libraries are??

you must define the Arduino folder in such a way that they all are the same < ideally>

On the PC with the phyical Arduino on board use

subst x: c:\users\terry\ < should be in autoexec or so>
subst y: c:\programfiles\

On the other PC's mount
c:\users\terry as the x: drive.
c:\program files\ as y: drive.

Then everywhere you can use the x:\ and y:\ in the path of Arduino and/or program files.

How about something like Google Drive? Won't that keep folders in sync via a master copy on the net?

Imagine, you update and save Sketch 1 on PC1. Google Drive re-syncs teh changed file. PC2 sees updated file on Google Drive and re-syncs back down. Result = PC1 and PC2 in sync.

Would this work in that context?

The bonus would be a cloud based back up of all your files.

tack:
How about something like Google Drive? Won't that keep folders in sync via a master copy on the net?

Imagine, you update and save Sketch 1 on PC1. Google Drive re-syncs teh changed file. PC2 sees updated file on Google Drive and re-syncs back down. Result = PC1 and PC2 in sync.

Would this work in that context?

The bonus would be a cloud based back up of all your files.

This is the same as using svn or git, but without all the version control :slight_smile:

Hi and thanks for ideas!

Google Drive or Dropbox are possibilities. Version control probably isn't an issue with one person coding, or my wife coding totally different stuff. Usually.

Dropbox at least keeps a physical copy on all machines, so things work fine if the net is down/slow.

Where/how do I tell the IDE that stuff is not In The Usual Place??

Rob, in my 'standard' installation terry/arduino contains terry/arduino/libraries so I THINK I only have to tell IDE where the /arduino root is??

at the risk of sounding defensive of my suggestion, I will offer one more piece of advice:

version control is more useful than you might think. Being able to go back and easily see what you changed between a version that worked a week ago and one that is broken today but is 5 revisions removed... super useful. Also, the version control mechanisms allow you to maintain versions of other peoples' code. I thought that might be useful to you since you mentioned that you're using "backlevel libraries".

Last but certainly not least, the control mechanisms I mentioned excel at maintaining code in multiple locations, not just in multiple versions. On windows, a simple right click->update on the folder you need to update (like My Documents\Ardiuino) will retrieve the latest revision from the server. Similarly, if you want to use an older revision, the process is maybe one step longer.

Using mapped network drives or google drive or any shared-location-without-version control is not only inelegant but runs the risk of fubar'ing the whole code repository. Using a version control system gets you all the benefits and simplicity of the other systems but with the added protection and organization of version control. I'll stop trying to convince you now... but I hope you give it a try. you will not be disappointed :slight_smile:

terryking228:
Hi and thanks for ideas!

Google Drive or Dropbox are possibilities. Version control probably isn't an issue with one person coding, or my wife coding totally different stuff. Usually.

Dropbox at least keeps a physical copy on all machines, so things work fine if the net is down/slow.

Where/how do I tell the IDE that stuff is not In The Usual Place??

Rob, in my 'standard' installation terry/arduino contains terry/arduino/libraries so I THINK I only have to tell IDE where the /arduino root is??

Google Drive also keeps things physically on your machines, just like DropBox.

To change Sketchbook location, go to File > Preferences from within IDE.

Versioning sounds like a good idea. I may well look into Subversion and SVN to see if it can be run on Windows.

Hi, OK the Google Drive/Dropbox approach seems simplest, and OK unless versioning is needed.

Actually, since I have been known to break code that worked, versioning might actually Be Nice...

To change Sketchbook location, go to File > Preferences from within IDE.

"I Knew That!".. Not. I suppose I should crawl through the menus of all the applications I use and find more good stuff that I didn't know about. Hmmm....

OK, I'll implement one of these.. and Thanks for the help!

If you want to have versioning but don't want to do versioning yourself, then I recommend you take a look at File Hampster. FH is configured with the files/directories to be monitored; each time a monitored file is updated FH will preserve a copy of the previous version. It has configuration options to define how long old versions are kept for, to roll up multiple updates that occurred close together, let you save or discard or preserve individual updates, and so on. It doesn't give you all the capabilities of a fully-fledged change control system, but gets you a good way there at zero effort.

If you're on OSX, there's the built-in Time Machine.

I use git for version control even on small / one guy projects and it has saved my bacon more times than I can count.

Public / open source projects all go up on github for (free) backup and distribution at the same time. It's easy to back up private projects to private web space. Couldn't be simpler.

http://git-scm.com

The Arduino team is using github in a very transparent and open way to develop, track issues, and document the core. So there are other reasons for people who hang out here to be on github as well.

My $.02...

-br

I use dropbox to store all my arduino & Eagle stuff, have it on the 3 machines that I use the most (none on the same local network) and can also access from my mobile phone.

This works perfectly for me and saves me carrying a USB flash drive around :slight_smile:

I second the idea of version control - you might also look into GIT (plus the various free repositories out there, like GIThub).

I also think that using a NAS (particularly one with RAID), as well as Google Drive and/or Dropbox would be beneficial as well; if this code is important to you, you can't have too many backups.

if this code is important to you, you can't have too many backups.

Somehow I doubt that .... I recall searching through a dozen backup floppies to find the latest version :slight_smile:

For the young people, a floppy is an offline storage device, seldom seen since dawn of the internet - see wikipedia