We’re pleased to announce the availability of erlang-mini, a minimal version of the Erlang packages that we distribute on our downloads page, designed specifically with embedded devices in mind (no GUI related dependencies etc, weighing in under 20 megabytes).
Installing erlang-mini on a freshly imaged Raspberry Pi or a Parallella board is a very simple processes. Using your favourite text editor, add the following line to your /etc/apt/sources.list
For Raspberry Pi:
deb http://packages.erlang-solutions.com/debian wheezy contrib
deb http://packages.erlang-solutions.com/debian oneiric contrib
Import the Erlang Solutions public key:
sudo apt-key add erlang_solutions.asc && rm erlang_solutions.asc
Update the package database:
sudo apt-get update
sudo apt-get install erlang-mini
Finally, test your installation by running the Erlang shell using erl.
Happy hacking and do get in touch if you run into any problems!
We have spent the past couple of weeks adding more peripherals to Erlang/ALE, our library for embedded systems. The first version of ALE only had support for General Purpose I/O (GPIO) but with the recent commits we have added I2C, SPI and PWM. You can fetch the latest version at our Github repository.
Raspberry Pi is still our reference platform but in order to make ALE more universal we have started working on defining a platform abstraction mechanism that will enable supporting other boards and architectures easily. The way this works is simple: ALE consists of platform independent layers that interface with a collection of platform specific, low level drivers that provide access to hardware. This is demonstrated by the diagram below.
The highest level provides the peripheral APIs, such as GPIO, I2C, SPI and PWM, allowing Erlang applications access these hardware units. These are implemented following the OTP standards, using gen_server and supervision hierarchies.
The Middle layer is the interface mechanism, a glue layer between Erlang and the low level C drivers. It deals with the translation of Erlang terms to and from C types, using the interfacing mechanisms provided by Erlang: Ports and NIFs.
In the lowest layer we find the peripheral implementations that contain the specific instructions to access the hardware peripheral on the silicon device. As mentioned before, ALE on its own does not include drivers for any specific architecture. On our reference platform, the Raspberry Pi, we achieve this by using pihwm as our peripheral implementation layer.
While the platform architecture is still under development, you can find the documentation for the peripheral APIs and the interface mechanism here.
As always, comments and suggestions are welcome. Drop us an email or post a comment here.
Until next time, cheers!