Juggling different MySensor versions?


  • Mod

    How do people handle different MySensor versions? For some projects, the development branch is the way to go. Other times, 1.5. And I still have some 1.4 projects that I haven't converted yet.

    How do you handle the different versions? My ideas so far:

    1. Install the Arduino IDE multiple times and add each version to different installations.
    2. Use one installation of Arduino IDE and use git to switch between the different branches.

  • Admin

    Git is awesome and fast for switching branches.
    Having Eclipse/Arduino IDE pointing to the source-tree makes it really easy.



  • @hek
    Can you give some more info


  • Admin

    Crash course:

    1. Install git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
    2. Clone the repository:
      > git clone https://github.com/mysensors/Arduino.git
    3. Open Arduino IDE/Preferences. Point the sketchbook location to the libraries folder of the cloned repository.

    To switch between master/development just go to the cloned repository and do

    > git checkout development
    or
    > git checkout master

    Guess there are GUI-Git tools that do this without typing in a shell as well.


  • Hardware Contributor

    I think what @hek is suggesting is something like this: clone the repository and branches (dev, main, etc) to your local machine. Point the IDE at that location. Then when you want to do a build with a different version, use git to switch the repository to the other branch. And better yet, tag the software you use for a specific sensor deployment when you build it, then when you need to go back to it, checkout the tag.

    If that doesn't sound good, you may want to look at other IDE/build choices. Any of the Arduino make/cmake systems will let you explicitly point a compile step at different directories to pick up specific versions of the software. So you can have all the branches checked out and sitting there on a disk and just point at different ones as part of the build process. You should still use tags to track exactly what you deployed, but it lets you keep all the versions of the library you're using visible and it may be less confusing than trying to remember to switch the code using git. It's just more expensive (in time) to set up the initial build system to use this vs the Arduino IDE.



  • @TD22057
    I understand that,what was confusing me was the Eclipse/Arduino IDE thing


  • Mod

    Thanks for the feedback. I'll go for the git solution.



  • Can somebody gives a way to make a diff between my local version and the online repository.

    When I use git diff (or git status), it only gives differences between local files and local repository (stuck at the version/date when I cloned it).
    My purpose is to compare my version vs online development branch.


  • Mod

    @fets git fetch --all will update your local repository with the changes on github.
    You can then use

    git diff origin/master localbranch
    

    or similar to compare.



  • @mfalkvidd thanks. But is fetch only update local repository and not local files ? I wasn't sure


  • Mod

    @fets not sure what you mean. The files are stored in the reprository (unless you have local changes that have not been committed).



  • @mfalkvidd I use development version which is still evolving on github. BEFORE upgrading my local files, I would like to know the differences between my local version and the remote repo.


  • Mod

    @fets this should be sufficient:

    git fetch --all # downloads all updates from github to the local git repository but does not update the current branch
    git diff origin/development # shows difference between current branch/ref and development on github
    


  • @mfalkvidd thanks.
    I'll try next time i'll get repo files


  • Contest Winner

    @mfalkvidd I'm really spoiled by my employee. I use different images for different versions. 1.5 though is the one I currently use on OsX - thus no virtual image.



  • I'm using Windows
    I have two Arduino installations.
    One folder called 'Arduino-old' - with MySensors 1.5.4
    Another folder called Arduino - with MySensors 2.0

    If I need to work on an older version, I rename 'Arduino' to 'Arduino-new' and 'Arduino-old' to 'Arduino'

    I have the same version of Arduino installed in both folders 1.6.9

    Works fine for me



  • Hi all,

    I'm struggling somewhat with the different MySensor versions as well on Windows machines (windows XP, windows 7 and windows 10).
    I'm using sync (sync.com) to keep all versions of sketches (and libraries) on 3 computers in synchronised. Works perfect for me.

    I write my sketches using the notebook -while sitting in the livingroom with my family- and do the real debugging and testing and deploying at 2 different locations (in the attick and in my shed). In the preferences.txt (Arduino IDE... C:\Users\xxxxxx\AppData\Local\Arduino15\preferences.txt) I've declared the sketschbook location as being the 'sync' location. This is on all 3 computers the same.

    Here the trouble begins for 2 different MySensor versions: the libraries are in this 'sync' location as well. Even if multiple Arduino IDE's are installed, the preferences.txt remains the same one, always pointing at the same sync location....and thus the same libraries....

    My goal is to have 2 different configurations to switch between MySensors 1.5 and 2.0 while keeping the 'sync' option I created before. Has anyone an idea how to accomplish that? Would git be and option (I have zero experience with this) and how should this be implemented in Windows? Or would the method described by @alexsh1 a simple but robust solution. Any help appreciated!

    Thanks!

    Boozz


  • Mod

    I haven't tried yet, but I've been thinking about having two installations of the Arduino IDE. One for each MySensors version.


Log in to reply
 

Suggested Topics

  • 1
  • 198
  • 2
  • 5
  • 1
  • 2

28
Online

11.2k
Users

11.1k
Topics

112.5k
Posts