On Hackaday Prize

Finally I decided: it is time for a new starting, for a new story. Leaving aside grudges and sadness.
Because Aloise is still waiting for the turbine, and so Juma in Jambiani, and wind is still blowing hard, over there, without anyone harnessing it!

So let’s go with this new adventure, from what I learned about wind, fluid dynamics, mechanics and so on, with Mirko, and let’s have a look into the future. I want this wind turbine to be built, to be completed! It is time!

Follow the project on Hackaday, too!


Anemometer and sensors logging, 3: build up the server

Now that your system is on, able to be controlled via VNC, it is time to install apache2 and MySQL, the webserver and the database.

This is really not difficult, the packages are so well known you can find a lot of guide on the web.
Largest part of this tutorial is taken quite as-is from here, leading to EmonCMS installation (which will be the next step, be quite!)

Let’s start!
Open a terminal and type

sudo apt-get install apache2 libapache2-mod-php5 php5-gd php5-json php5-mysql php5-curl php5-intl php5-mcrypt php5-imagick


sudo apt-get install mysql-server mysql-client php5 libapache2-mod-php5 php5-mysql php5-curl php-pear php5-dev php5-mcrypt php5-json git-core redis-server build-essential ufw ntp
sudo apt-get install mysql-server
sudo pear channel-discover pear.swiftmailer.org
sudo pecl install channel://pecl.php.net/dio-0.0.6 redis swift/swift

You have got to wait some minutes, Cubieboard is not so speedy! After that:

sudo sh -c 'echo "extension=dio.so" > /etc/php5/apache2/conf.d/20-dio.ini'
sudo sh -c 'echo "extension=dio.so" > /etc/php5/cli/conf.d/20-dio.ini'
sudo sh -c 'echo "extension=redis.so" > /etc/php5/apache2/conf.d/20-redis.ini'
sudo sh -c 'echo "extension=redis.so" > /etc/php5/cli/conf.d/20-redis.ini'
sudo a2enmod rewrite

Now you need to change some permissions. Depending on which distro you are using it changes a bit, as follow.
If you are using Debian Wheezy in a terminal type

sudo pluma /etc/apache2/sites-available/default

else, if you use Debian Jessie or Ubuntu

sudo pluma /etc/apache2/apache2.conf

A text file will be shown, somewhere you can find

AllowOverride None

under <Directory /> and under <Directory /var/www/> .

Change it to

AllowOverride All
apache changes

Save and exit, then restart the web server:

sudo service apache2 restart

If everything is right, opening your preferred web browser on your PC and typing


should show you Apache2 greetings!


You can also activate some kind of dynamic DNS, just like noip.com (free) or dyndns (not free), in order to have a domain associated to your router. Then setting up port forwarding on your router and specific IP address inside your home network will do the job, you will be able to access your webserver on Cubieboard simply typing your domain name in a browser, wherever you are.
But this is more than what this tutorial aims to, if you wanna now more…Google is your friend! or contact me!

Anemometer and sensors logging, 2: build a single-board computer

Following lines are for those who doesn’t now so much about linux distros, single-board computer, terminal, shell, installations. For sure an IT guy will find them a bit simplistic, but the target is our African friends and whoever just want to start. So please, be patient with my IT mistakes!

Ok, it’s time to start to build a place where I can put my data.

Allright, the cloud is a great thing, encryption is a great resource but…I prefer to have my data. At least, every time I want / I need my data to be only mine.

I know and I’ve been using some nice IoT platforms able to store data: Xively, Thingspeak, Carriots, just to say about. They are good, works well the way I will try to explain I did, but sometimes you need to pay, sometimes you have limited data plans, sometimes you may think “where the hell are my data?”

So I decided to have a personal server. I’m a mechanical engineer, I started few years ago to study about these themes, it requires time and a bit of skills.

What I was looking for was a cheap computer able to collect data and serve them whenever I needed. And, for sure, I wanted a low power computer. 10 years ago this was difficult to find for a non-IT worker.

Things changed with Raspberry Pi. I never bought one, but I feel grateful to Raspberry foundation because of their effort. In a few years a lot of single-board computers grew up, and now you can choose between UDOO, Raspberry, Banana Pi, Orange Pi, etc.

SoC computers

I bought (ok, I funded…) a Cubieboard three years ago. A great piece of hardware, with a growing communities (here the most interesting) which aided me a lot to understand how to move around with installations.

After many installations, re-installations, usually concerning Debian or Ubuntu, I finally landed on Armbian.


Igor Pečovnik , the owner of the website, is a great guy from Slovenia who is building distros for many different single-board computer platforms, have a look here. I don’t know why he is doing this, if there’s a business model or is just for fun, but his work is really great.

So now I’m using Armbian on my Cubieboard A10, a Debian Wheezy version you can download here. There are two versions, “legacy” and “vanilla”, the key difference is which kernel is used: legacy uses an older and stable one, vanilla lies on a newer one, even up to the newest one.

I tried both ones: vanilla doesn’t seem to work well with my webcams (yes, I will show you how to use webcams too), so I decided for legacy.

Installation is not difficult. After downloading the preferred distro, extract the image file: in the archive you will find some files, and a .raw file such as Armbian_5.00_Cubieboard_Debian_jessie_3.4.110.raw

This file has to be flashed on an microSD card.

If you use Windows, ok, shame on you: I can’t help you nothing more then telling you to use the imagewriter.exe file inside the archive, hoping you will decide to cure your Windows-mania…

If you use a Linux distro, well, it is simple: open a terminal, move to the folder containing the .raw file, then just write

dd bs=1M if=filename.raw of=/dev/sdx

as root user, where /dev/sdx is SD card device. Or, which is the same:

sudo dd bs=1M if=Armbian_5.00_Cubieboard_Debian_jessie_3.4.110.raw of=/dev/mmcblk0

Be careful: usually /dev/sda is your system folder, /dev/sdb your home directory, using these you will destroy your system!
Usually SD card are identified by /dev/mmcblk0, depending on the system you are using.

It will take some minutes to complete flash process. Then unmount if mounted, extract, insert in microSD card slot on Cubieboard, connect a monitor and turn on. Better if Ethernet is connected and Internet available for immediate updates.

After a few minutes login prompt will appear: on first boot only root user is present, and password is 1234, you are requested to change it.

Then you can create your personal user, with

adduser user1

(user1 is an example username).
Then you need to insert your user in the sudo group, to have access to some SuperUser functionality:

usermod -aG sudo user1

The system is ready, now!
Ok, there’s no desktop environment neither desktop manager, by now; it is better/simpler to install one.
To install XFCE and LightDM type:

apt-get -y install xorg lightdm xfce4 tango-icon-theme gnome-icon-theme

To install MATE and LightDM:

apt-get -y install xorg lightdm mate-desktop-environment mate-desktop-environment-extras tango-icon-theme gnome-icon-theme pluma

Whatever was your choice, at the end of the installation it is time to reboot PC, so:


After reboot you will have a login screen: get in with your username and password, the system is on!

Maybe now you would like to disconnect the monitor, in order to leave it alone, just as low power companion on your desk. Ok, you can access and control it without any monitor, simply you need to install a VNC client on your computer (I use Vinagre on Ubuntu, many others are available) and a VNC server on the Cubieboard.

So open a terminal on Cubieboard (nice: for some minutes you need to connect your monitor again!) and write

sudo apt-get install x11vnc

Now, since x11vnc server will start only after login, you need to activate autologin. After a look here (or here, italian version) it is clear you have to modify lightdm.conf.

In a terminal:

sudo pluma /etc/lightdm/lightdm.conf

find the following lines inside it


and uncomment them, then change to


Save and exit terminal, then reboot. You should get in automatically.

Now open menu, system, preferences, startup applications (on MATE; on XFCE maybe it is a little different)



and add (inside “command”)

x11vnc -forever

Save and exit.

Now open your browser, access to your router and change settings in order to permit communication between your Cubieboard and your PC: this means you have to open port 5900, the one used by VNC communications.

While dealing with router, have a look to IP address assigned to your Cubieboard, i.e. you will need to now to access Cubieboard.


Then open your VNC client on your PC, type Cubieboard address (i.e.: and enjoy your single-board computer.

Next ride: we will install a web server and a database to store data.

(to be continued…)

Anemometer and sensors logging, 1

I’m starting here a few articles about our experiences in datalogging wind data and generic sensor data.
Since the VentolONE team origins, before everythings started, I knew the first thing you need to know concerning wind turbines is how much wind is available, and which kind: constant, gusts, etc.

In early days in 2006 I didn’t know so much about microcontrollers: I had just a few knowledge in electronics coming from my master degree in mechanical engineering. Not so much, really.

After some tries with some friends of mine I understood I had to build by myself a datalogging system, the way I wanted it to be:

  • open-source (code)
  • open-hardware (where possible)
  • simple, everyone could build it
  • reliable, not a funny joke
  • able to send data from wherever to wherever
  • customizable

Now I can say: here we are!

As far as you know, VentolONE team had some trouble with its start-up, founded and closed in one year, without producing nothing more than disappointment and quarrels.
Well, during that period I did something, keeping on my interest in datalogging data from Africa.
Following the attemps with Arduino Yun (may 2014) I tried new ways, cheaper and promising.

Now it is time to write it down where I finally came!

EmonCMS and datalogging

(to be continued…)

Convalescenza e primavera

Il VentolONE è in convalescenza, i lettori l’avran capito ormai. Chi scrive aveva e ha bisogno di rasserenarsi e lasciarsi alle spalle le delusioni, umane prima di tutto.

Poi viene la primavera, però.
E con essa, un “pochino” in ritardo, una agognata scheda a microcontrollore, che mi permetterà di concretizzare definitivamente l’anemometro autonomo e indipendente dalla rete di telecomunicazioni.
Insomma: ben arrivato mr. Konekt Dash Pro!


No Maker Faire, no party!

Quest’anno, contrariamente a quanto baldanzosamente dichiarato qualche tempo fa, il VentolONE non sarà alla Maker Faire di Roma che inizia domani.
Ci siamo resi conto, ai primi di settembre, che il carico derivante dalla gestione della stessa con forze ridotte, le “ossa rotte” dal fiasco di openGalileo, gli impegni nuovi in arrivo per alcuni di noi (la cicogna piuttosto che l’immissione in ruolo a scuola) rendeva insostenibile la cosa.
La sorpresa di leggere la mail di risposta degli organizzatori nella persona di Alessandro Ranellucci, l’affetto tributatoci e il loro dispiacere sincero spingono a perseverare…ma in fondo mica ce n’era bisogno, la tenacia piemontese ci appartiene fino nel midollo.
Così stiamo proseguendo, con occhi nuovi e nuovi approcci, più lenti, africani, ordinati.
E tuttavia mi trovo, ancora una volta, in viaggio verso la Maker Faire di Roma, con la scuola dove insegno, con i colleghi e con i miei studenti (per chi vuole, stand C4 e C5), intanto che la convalescenza del VentolONE va avanti…