Using Github with BrickPi

This is a quick tutorial on how to use github to “clone” our github repositories.

The easiest way to get our set of drivers and examples for the BrickPi is to use github. With a few quick commands, github will automatically place our code on your Raspberry Pi.

First, check that Github is up to date on your Raspberry Pi.

sudo apt-get install git-core

This command will check for the latest version, and if you don’t have git on your RPi, it will install it.

Next, we’ll create a clone of one of the Dexter Industries repositories. You can see the full list of the repositories on our Github site here:

  • Dexter Industries · GitHub
  • We’ll assume you want to work in python, and want to clone the python examples. If you click on the repository “BrickPi_Python” you will see, on the right hand side “HTTPS clone URL”. This is the link to our Python repository. Copy it (you can do this by just clicking on the little clipboard to the right of the link text).

    Next, we will take that link to the repository and “clone” it on our local Raspberry Pi.

    We will type “git clone https://github.com/DexterInd/BrickPi_Python.git

    And things will happen. The repository will be cloned on the Raspberry Pi at the directory “/BrickPi_Python”

    Now, check that it’s installed by typing “ls -l” and you should see the BrickPi_Python directory, in all of its glory.

    Updating the Repository
    From time to time, we will update our repositories. People will make suggestions (you can too!) and we’ll try to improve the code. To check for the latest update, simply change directory into “BrickPi_Python” by typing “cd BrickPi_Python”. Then type “git pull” and git will check that your directory is up to date.

    hmm. I haven’t managed to get onto the internet yet with my Dexter Industries raspbian image yet (I followed the getting started video tutorial) but when I try to clone the BrickPi_Python repo I get the following error from git: https://gist.github.com/ivar/7014863

    I imagine this might have something to do with the limits of the FAT32 filesystem being used in the disk image ?

    so, the issue I described in my previous comment happened when I was using my host machine that had mounted the SDcard as a USB disk. I’ve sinced tried again, but cloning the git repo from Raspbian and everything worked successfully.

    Update your Github Repos: The command for this is
    `sudo git remote update’

    Run this command from the directory you want to update.