Best practice using github
-
I bought a Lego Mindstorms set to my kids (and to myself) this christmas. And i have been playing around with ev3dev environment for i while and I have managed (with the help of you guys) to create some small programs on my ipad, send them to the Lego brick using Stash and scp, execute the program using Stash and ssh. And it works which is cool. The problem i have now is that my file handling is becoming a mess so i decided to try github so now its even worse :) I have some files on the brick, some on my ipad, some on my pc and then of course in the github cloud.
Could some of you share you share your github/file handling best practice? It would be nice to keep my files in a little bit better sync.
-
Wow, that's awesome to hear! I have a Mindstorms NXT 2.0 brick, which iOS devices cannot communicate with directly (because it supports neither Bluetooth LE nor wi-fi). Nice to see that things like these are now possible with the new EV3 brick.
Stash has the
git
command built-in, so you should be able to work with your Git repo directly from there. If you haven't already, you should make a folder for your repo,cd
there and then rungit clone https://github.com/yourusername/yourreponame.git
. Now you can make modifications to the files locally. To push the changes back to GitHub, first rungit add
on any changed files, thengit commit
, thengit push
. (The first time you commit and push, you'll be asked to enter your GitHub e-mail address and password.) If you push any changes to the repo from your PC, you should rungit pull
in Pythonista to get the changes there too. On your PC you should hopefully have the GitHub Desktop application installed, which makes the whole process much easier for Git noobs like myself.;)
As for the brick, IMO you shouldn't use it as permanent storage for anything. The NXT 2.0 had very limited storage and you couldn't do any serious programming on the brick alone, so keeping any files on there permanently wasn't really an option. The way I worked with it was basically "write it on the PC, compile, upload to NXT and overwrite anything else that was there". Not sure if this has changed in any way with the EV3, or if your workflow is different, but that's how I do it.
-
@KIMa I have an EV3, I'd love to see your code.
@dgelessus The EV3 can hold things on a MicroSD. The way that EV3Dev works is that you load the alternate firmware onto a MicroSD, which the EV3 then boots from. All the files created with EV3dev live on this MicroSD.
-
Heh, the best I can do with my NXT is install leJOS and write programs in Java instead of bastardized LabView - sorry, I mean "NXT-G". The EV3 definitely seems much more capable.
-
@dgelessus yeah, NXT-G sucks, and EV3-G isn't much better. EV3 Dev has bindings for lots of stuff though. I never used it extensively, but I'm pretty sure there's some kind of remote control protocol with a wifi dongle. It's still a way better use of money to get a raspberry pi. It's like 5X as powerful, and 1/5 the price.
-
Thank you @dgelessus, i will try your pointers and report back.
@Webmaster4o I haven't created anything that fancy. I recently read the “The Art of LEGO MINDSTORMS EV3 Programming (Full Color)” book by Terry Griffin and tried to recreate the PID controlled line follower (chapter 19) in Python instead of in the Mindstorms environment. I have uploaded the programs and a more detailed description in my new github account.