By Iris Roelens and Karsten Daemen.
This project contains a python application that is meant to be deployed on a Raspberry Pi and will allow users to program it using Blockly. We provide custom blocks for controlling components on the GPIO pins like motors and light sensors.
BlocklyPi only depends on the python RPi.GPIO library (0.5.11). You therefore need to install this on your raspberry Pi. You can either do this through the repository (debian):
sudo apt-get update
sudo apt-get install rpi.gpio
Or manually from the package:
wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz
tar -xvf RPi.GPIO-0.5.11.tar.gz
cd RPi.GPIO-0.5.11
sudo python setup.py install
cd ..
sudo rm -rf RPi.GPIO-0.*
On your Raspberry Pi, navigate to the desired directory where you want to install BlocklyPi (we use \home\pi\bin
).
mkdir \home\pi\bin
cd \home\pi\bin
Download the BlocklyPi project from GitHub.
git clone https://github.com/karstenda/BlocklyPi.git
cd BlocklyPi
To start the server, execute the server.py
python script. Super user privileges are required in order to acces the GPIO pins ...
sudo python server.py
On your raspberry, navigate to http://localhost:8080
in order to verify that the installation was succesfull.
You may want to start BlocklyPi on startup of your RaspberryPi. To do this you need to edit /etc/rc.local
file. A At the bottom of this file, you'll find the line exit 0
, write before this:
# Starting the BlocklyPi server from it's installation directory.
cd /home/pi/bin/BlocklyPi
python ./server.py