-
Notifications
You must be signed in to change notification settings - Fork 36
Installation
After installing ubuntu 12.04, first of all you should update your package definitions and upgrade your software.
sudo apt-get update
sudo apt-get upgrade
Download the debian package we have prepared https://www.dropbox.com/s/iozqyk6w3net0ao/codebender-arduino-compiler_1.0_all.deb
, ie:
wget https://www.dropbox.com/s/iozqyk6w3net0ao/codebender-arduino-compiler_1.0_all.deb
Install the package:
sudo dpkg -i codebender-arduino-compiler_1.0_all.deb
The system will complain about missing dependencies. That is completely normal. To take care of dependencies, and start the installation procedure, execute:
sudo apt-get install -f
During the installation, you will be asked to edit some configs. The only ones that you should need to change are the arduino_core_files_dir and auth_key. In the first one, enter the folder where you will save your Arduino core files (see Downloading Arduino Cores). In the second one, write a unique string that you will use for authorization.
That's it! Try out the compiler. Go to
http://your_servers_ip_address/compiler/status
You should get the following:
{""success":true,status":"OK"}
If you want to use PHPUnit to run unit tests on the command line, or using the compiler's testing API (more info on that in the Compiler API page), you'll need to install PHPUnit. In ubuntu 12.04, you'll need to run the following commands.
sudo apt-get install phpunit
sudo pear upgrade pear
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover pear.symfony.com
sudo pear install --alldeps phpunit/PHPunit
Try it out:
phpunit --version
Now you should also be able to run:
http://your_servers_ip_address/compiler/youMustChangeThis/test/
If you want to be able to use the development mode and access debug info from Symfony, then open
/opt/codebender/codebender-arduino-compiler/Symfony/web/app_dev.php
and comment out these two lines at the beginning of the file
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(FILE).' for more information.');
There are 2 parameters for the auto-completion project inside Symfony (Symfony/app/config/parameters.yml.dist).
autocompleter: "The name of the folder which holds the python script"
autocompleter_dir: "The path to the aforementioned folder"
Apart from that, we need to update the PYTHONPATH environment variable for the Apache process in order to be able to find the clang bindings and the ldconfig search paths in order to be able to load the clang libraries.
For the PYTHONPATH we need the following line in /etc/apache2/envvars:
export PYTHONPATH="/path/to/arduino-core-files/clang/v3_5/bindings/python:$PYTHONPATH"
Reload the apache2 server just to be sure that the environment gets updated:
sudo service apache2 reload
For the clang libraries we have to create a new configuration file at /etc/ld.so.conf.d/ and point to the clang libraries directory:
# run as sudo
echo '/path/to/arduino/core-files/clang/v3_5/lib' > /etc/ld.so.conf.d/clang.conf
/sbin/ldconfig
That's it! We should be all set to start using the autocompletion!
Coming when it's ready.
The debian package will run symfony's composer configuration script, which will configure Symfony's directory, and will ask you for the necessary configuration parameters for your installation. If you want to completely automate your installation process (i.e. to deploy compilation servers automatically), you'll need to create the necessary parameters.yml file in the Symfony app/config directory (/opt/codebender/codebender-arduino-compiler/Symfony/app/config/parameters.yml) before installing the package.
You'll need to download the arduino-core-files project from GitHub and put them on the paths you provided above (default is /opt/codebender/codebender-arduino-core-files).
To download the files, you can either use git to get the repo, or wget to copy a .zip file containing the files. To do that:
(if you don't have zip/unzip installed)
sudo apt-get install unzip
and then
wget https://github.com/codebendercc/arduino-core-files/archive/master.zip
unzip master.zip
sudo cp -r arduino-core-files-master /opt/codebender/codebender-arduino-core-files
rm master.zip
rm -r arduino-core-files-master
You will also need the external_cores project from GitHub and put them on the paths you provided above (default is /opt/codebender/external-core-files).
wget https://github.com/codebendercc/external_cores/archive/master.zip
unzip master.zip
sudo cp -r external_cores-master /opt/codebender/external-core-files
rm master.zip
rm -r external_cores-master