wcomp-raspberry

This is an old revision of the document!


WComp on Raspberry Pi

As on Linux platform, WComp needs Mono to execute C# code. Current Raspberry Pi distribustion (Raspbian) are compiled for ARM with support for “hard float” which means that float computation are done directly by the processor and not by a soft evaluation.

Mono supports hard float since release 3.2.7. If with your distribution you can't get a release than is equal or newer than this release, you will have to do some jobs manually.

Current repositories have been updated and you can find a mono release with a correct version. So you only have to achieve the following classical installation process:

  • Upgrade your system:
sudo apt-get update
sudo apt-get upgrade
  • When logged in, install mono environment:
sudo apt-get install mono-complete
  • Unzip SharpWCompContainer where you want, to be able to us it.

Mono has a known bug on "hard float" version. So we need to use a “soft float” distribution which is not available anymore on Raspberry Pi web site.

In order to use WComp on Raspberry Pi, you will have to do the following:

  • Download the Debian "soft float" distribution
  • If you are using a Raspberry Pi Rev B with 512MB, you should replace the files bootcode.bin and start.elf after writing the system on SD card in order to be able to boot you system.
  • Then follow the installation process described at top of this page.

As the last step of the overall process, to install WComp, you juste have to unzip SharpWCompContainerMonoLinux.zip where you want, to be able to us it. To get WComp for Linux, you can contact us. We do not deliver Linux over the Web.

On Raspberry Pi, you can use different king of sensor libraries with WComp. You can use Goove, Phidgets, Electronic Brick. Moreover, we are currently working one a unified way to access to all these set of sensors and actuators for you to be able to create propotypes with differents sets.

First of all, you have to download and compile the C phidget library to be able to use it on Raspberry.

sudo apt-get install libusb-1.0.0-dev
wget http://www.phidgets.com/downloads/libraries/libphidget.tar.gz
cd libphidget-* ; # * could be 2.1.8.20150207
./configure
make
sudo make install

Then you have to add Phidget available for Mono.

sudo gacutil -i phidget21-windevel/Phidget21.NET.dll
sudo ln -s /usr/lib/mono/gac/Phidget21.NET/*/* /usr/lib/mono/2.0/Phidget21.NET.dll

Last step to be able to use the Phidget InterfaceKit on Raspberry Pi is a problem of permissions on files; only root can access to data of usb pluged devices. So for any program working with Phidget InterfaceKit, you would need to run it as root user (with a sudo). Of course, this is not the right solution.

You have to have the right file permissions on /dev/ to be able to access data of the Phidget InterfaceKit 8/8/8. /dev files are created using udev on Raspberry. So all files are dynamically created when the platform detect an hardware component (when you plug a USB device for example). So you have to create an udev file to specify what king of device you connect and what type of permissions you give to this device.

Create a file in /etc/udev/rules.d with the suffix .rules, e.g. local.rules, and add a line like this to it:

ATTRS{idVendor}=="06c2", ATTRS{idProduct}=="0045", SUBSYSTEMS=="usb", ACTION=="add", MODE="0660", GROUP="usb"

With this line in file, you will detect any InterfaceKit (vendor tag is 06c2 and product id is 0045). You can verify with lsusb than you have these numbers with your InterfaceKit (you will have a result like the following one).

Bus 001 Device 004: ID 06c2:0045 Phidgets Inc. (formerly GLAB) PhidgetInterface Kit 8-8-8

As you added a new rule, you have to restart the udev service.

sudo service udev restart

This will now create the right file in /dev with permission of rw for owner (root) and for group usb. The last step is to add your user to the usb group.

sudo addgroup usb
sudo adduser pi usb
  • wcomp-raspberry.1427303262.txt.gz
  • Last modified: 2015/03/25 18:07
  • (external edit)