Category Archives: linux

Building MRAA from source on a Raspberry Pi A+

I am using Raspbian (Kernel 4.1) http://downloads.raspberrypi.org/raspbian_latest

You will also need “python” and “git” however these are pre-installed on the device.

Update apt-get

sudo apt-get update
sudo apt-get upgrade

Install NodeJS on a Raspberry Pi A+

latest version of Node for RPI is not supported, gra barchived:
   wget http://node-arm.herokuapp.com/node_archive_armhf.deb
Install it using dpkg
   sudo dpkg -i node_archive_armhf.deb
Test Node and NPM
   node -v
   npm -v
Update npm
   npm update npm
Change npms registry path from https to http
   npm config set registry http://registry.npmjs.org/

Install PCRE

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.bz2
tar jxf pcre-8.37.tar.bz2
chmod 777 configure
./configure
make
sudo make install
sudo ln -sfv ../../lib/$(readlink /usr/lib/libpcre.so) /usr/lib/libpcre.so
sudo ldconfig

Install SWIG 3.07 or higher

http://downloads.sourceforge.net/swig/swig-3.0.7.tar.gz
tar -xzf swig-3.0.7.tar.gz
./configure
make
sudo make install

Install python-dev

sudo apt-get install python-dev

Install cmake

sudo apt-get install cmake

install mraa

git clone https://github.com/intel-iot-devkit/mraa.git
cd mraa

Comment out the following from /src/spi/spi.c
(line 144)
// if (ioctl(dev->devfd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) != -1) {
// if (speed < hz) {
// dev->clock = speed;
// syslog(LOG_WARNING, "spi: Selected speed reduced to max allowed speed");
// }

mkdir build
cd build
cmake .. -DBUILDSWIGNODE=ON -DBUILDSWIGPYTHON=OFF
make

This is where it got weird and i tried something random and it worked

Go into your project directory and install mraa via npm

cd ~projectdirectory
npm install mraa

You then need to copy mraa.node from

~/mraa/build/src/javascript

To

~/projectdirectory/node_modules/mraa/build/Release

Intel Galileo – WiFi working!

wlango

What you see above is a screen shot of how simple and easy this dev board is!

Currently I have an Intel Centrino N6200 series Mini PCIe card attached. Its configured to connect automatically to my development router.

I then modified the example Arduino Ethernet code for “web server” and added the wifi interface MAC and IP address…and BAM! Mother efin bam! Why does this excite me? This means that i can get rid of the NodeJS element of the Vibraglove. I no longer need to send communicate with the arduino that controls the hand via a serial port. I can now do it via WIFI! That means an almost tether less device!

Galileo – Linux build update

wpid-dsc_0275.jpg

Im currently running 2 builds on 2 separate machines. The one above is a clean standard build..its been compiling for 24 hours now. The second is a custom build with nano,nodejs and a few other dev tools. Im not sure if its done yet as its at my office.

Intel Galileo – Compiling a Custom Linux Build

I’m referencing this blog post, most of the instructions are pretty much to the word, but with some additions:

What you need:

1st I built a VM for Linux, with 256gb VHDD, 4gb RAM and 4xCPUs, I used Virtual Box. Install the VB Guest Editions and reboot the vm. Login and do an apt update:

sudo apt-get update

Now install the Dev tools, According to the blog you need 7zip, not sure why but lets just do what the guy says:

sudo apt-get install build-essential p7zip-full

You will then need to install some other things…

sudo apt-get install git
sudo apt-get install texinfo
sudo apt-get install diffstat
sudo apt-get install gawk
sudo apt-get install chrpath

Now we can start the build processes…

Extract the contents of the “Board Support Package Sources for Intel Quark”. Find the file “meta-clanton_v0.7.5.tar.gz” and extract its contents to a directory on your VHDD.  In terminal browse to the directory and run these commands:

/meta-clanton_v0.7.5> ./setup.sh
/meta-clanton_v0.7.5> source poky/oe-init-build-env yocto_build
/meta-clanton_v0.7.5> bitbake image-full

This procedure took 20 hours to compile on a 4xXeon,4gb ram VM….