Skip to content

working with ModularSensors src

neilh edited this page Nov 7, 2018 · 3 revisions

( the way this works I'm still discovering, if I've got it wrong or there is a shorter way please let me know)

For changes to ModularSensors\src, these are not included directly in the build.
The platformio uses "lib_deps =" to gather the src.
For a standard release it looks like this
lib_deps =
EnviroDIY_ModularSensors@=0.16.1

This can be replaced by the source of where you want it to come from
lib_deps =
https://github.com/neilh10/ModularSensors#workXX_nanolevel
or could be a specific commit, obtained from "git log -1"
https://github.com/neilh10/ModularSensors#ceb7d745c6a65d66140b1db3b194fbb4480edea6

Assuming building and working in ModularSensors\examples\logging_to_EnviroDIY,
the src is in ModularSensors\examples\logging_to_EnviroDIY.piolibdeps\EnviroDIY_ModularSensors\src
Copy the files into ModularSensors\examples\logging_to_EnviroDIY\lib\ModularSensors...
Modify, build and test them here. Changes can be seen with
$git status
Then when complete, merge them into the files ModularSensors\src and submit them back to git.

Merge changes

With an active development, changes in github.com:EnviroDIY/ModularSensors need to be updated and merge in to github.com:neilh10/ModularSensors. Git is very good at this, and unless the exact same two lines are changed together it is usually very easy.
Git calls this a 'conflict' and requires manual merging. Normally the process in your own repo $ git pull #see https://www.git-scm.com/docs/git-pull

It can be a complex time to merge conflicts - and beyond this description here - but having the multiple repos, stages the changes and I've found allows me to compare and manage the changes to all merge together.