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.
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
(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
[SeatDefaults] #autologin-user= #autologin-user-timeout=0
and uncomment them, then change to
[SeatDefaults] autologin-user=user1 autologin-user-timeout=0
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”)
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. 192.168.1.5: you will need to now to access Cubieboard.
Then open your VNC client on your PC, type Cubieboard address (i.e.: 192.168.1.5:5900) and enjoy your single-board computer.
Next ride: we will install a web server and a database to store data.
(to be continued…)