Skip to content

Getting Started

Daniel Petti edited this page Nov 11, 2017 · 9 revisions

Software Setup

Download the Code

~$ git clone https://github.com/djpetti/grobot

A Note on Branches

Currently, since we have not made a major release, there is very little code in the master branch. If you intend to do any development, or even just test, you probably want to switch to another branch:

~$ git checkout <branch_name>

The current (semi) permanent branches are:

  • hardware: Contains the current work on the GroBot hardware.
  • devel: The main development branch. Contains all the latest code for everything.

All other branches are probably transient feature branches.

Developing the Web Code

Unfortunately, the MCU code can not be easily tested on your machine at this time. However, the web code can be. This guide will explain how to run the code on Linux. (Specifically Ubuntu/Debian.) Other operating systems are not officially supported, but you are welcome to try.

Installing Dependencies

Make sure you are in the top level of the GroBot repository when running these commands.

~$ curl -sL https://deb.nodesource.com/setup_7.x | sudo bash -
~$ sudo apt-get install python3 python3-pip nodejs
~$ sudo npm install -g bower polymer-cli redux web-component-tester
~$ bower install
~$ sudo pip3 install pyserial tornado motor

NOTE: The web backend currently requires at least Python 3.5. If you are running Ubuntu 16.04, or another distribution of similar newness, this should be installed by default. If you are not, however, you may have to manually install it.

Running a Test Instance

A test instance of the web interface can be run on your local machine using the deploy.py script. This script has many options and can do various things, (deploy.py -h) but for now we will invoke it without arguments:

~$ ./deploy.py

This script will first run all the unit tests, which will involve briefly opening various browsers in order to test the JS code. Once it has determined that all the tests pass, it will continue to actually starting the instance. If it all worked, you should see a log message that looks like this:

backend.server@2017-09-07 01:27:11,179: [INFO] Listening on port 8080.
backend.server@2017-09-07 01:27:11,179: [INFO] Starting server...

NOTE: Don't worry if you also see a [CRITICAL] message about not being able to initialize the serial. Since this is not an actual GroBot, there is nothing connected via serial.

Now navigate to http://127.0.0.1:8080/. Initially, it will probably yell at you because it can't find any modules on the serial bus, but this is expected behavior.

Congratulations! You can now develop the GroBot web interface!

NOTE: If you want to get rid of the serial errors, you can pass the -m option to deploy.py. This enables a simulated module stack, and is very useful for testing.

Developing the MCU Code

Since we currently use a PSoC 4 MCU to control the GroBot modules, in order to edit the code for it, you will have to have PSoC Creator installed. Unfortunately, this only works on Windows. (One of the various reasons we are moving away from the PSoC is so you don't have to change OSes to develop for a different subsystem.)

Within the IDE, you should be able to open the "grobot_workspace" workspace. This allows you to open the "grobot_module_controller" project. All PSoC code is included in this project.

Testing the Code

Unfortunately, there is not much that you can do currently without a functioning module prototype. If, however, you want to try something, you can purchase a really cheap PSoC 4 dev board here, which features the same MCU that is used in the actual prototype.

Clone this wiki locally