Apache+PHP on Cubieboard with Lubuntu

I executed the following steps to install apache with PHP on my cubieboard2 with lubuntu.

Lets start with installation that will take about 25MB:

sudo apt-get install apache2
sudo apt-get install php5
sudo /etc/init.d/apache2 restart

Put your IP address to the browser (or localhost) and you see that Apache was installed correctly.

Your www content is stored in /var/www.

The whole www folder is owned by root. So for easier access I changed owner to my user named linaro

Cubieboard2 – Lubuntu – Enabling Print Screen

When I installed Lubuntu on my new Cubieboard2, the print screen was not working.
When I hit the “Print Screen” button I got this message:

I’ve fixed it by installing the scrot application:

sudo apt-get install scrot

If you hit “Print Screen” or “Alt+Print Screen” you will see a new file *_scrot.png in you home directory.

 

Cubieboard2 – Lubundu – Extending NAND from 2GB to 4GB

When I install new Lubuntu NAND image to my new Cubieboard2 I had only 2GB of space out of 4GB available.

I followed this forum to expand the filesystem to 4GB.

sudo nand-part

In my case I used this nand-part command:

sudo nand-part -f a20 /dev/nand 32768 'bootloader 131072' 'rootfs 7569408'

the number in bootloader is the same as previous partition size.
The number in rootfs is the sum of previous partition size of partition 2 and partition 3 that we wanted to merge.

Lubuntu – installing VNC server

I use vnc to access graphic interface from my PC to cubieboard that runs on lubuntu. I have chosen tightvncserver and spent some time to configure and run it. Also to my surprise it took me a while to set it up correctly. This guide was the most helpful how-to but I needed to make some changes so I’ve written this post.

Cubieboard – setting time zone and NTP on ubuntu

I have just bought cubieboard and installed lubuntu and I want to have synchronized time with NTP server. NTP is a TCP/IP protocol for synchronising time over a network – Network Time Protocol.

This post describes:

  • Setting the timezone
  • Configuring NTP for clock synchronization

Setting the timezone

To check the time and timezone:

date
more /etc/timezone

To configure timezone execute: 

sudo dpkg-reconfigure tzdata

 

 

Enable UART on Cubieboard with Lubuntu

I wanted to connect my cubieboard with lubuntu to my arduino via serial communication. For that I had to enable a UART and connect pins to my arduino (only RX/TX is needed). I have arduino mini 3.3V on which I have attached some sensors (outside temperature).
By this command you can check if the port is enabled:

stty -F /dev/ttyS0 -a

In fresh installation of lubuntu the ttyS0 is configured and used by kernel and ttyS1 is not enabled. You will get this message for ttyS1:

Lubuntu ssh: Read from socket failed – solved

SSH to my fresh lubuntu on cubieboard2 was not working. I tried it also from the lubuntu itself with the error:

$ ssh localhost
Read from socket failed: Connection reset by peer

I went through many google search results. But I could not find any appropriate solution. Finally did what I should as the first step. Uninstall and install the ssh.

This page helped me to try uninstall with complete removal (also the configuration files). It should work with the command

Cubieboard and 2.00mm vs 2.54mm pins

Cubieboard has thickness 2.00mm 2×20-pin-header that is not so suitable for home hobbiest.
Arduino and other small boards uses 2.54mm pin (0.100inch)

To connect it I have bought 2.00mm to 2.54mm 40pcs Wire Cable 2P to 1P.

 2.00mm to 2.54mm (2P to 2x1P) wires
Till it comes I will use my 2,54mm cables, you can connect 2 of them (not more) side by side:

Cubieboard2 – Lubuntu installation

I wanted to install Lubuntu on my new Cubieboard2 so I decided to go for this v1.06 Lubuntu 12.10 image. You have option to have NAND or SD card and I’ve decided to go for NAND because the system performance should be faster than SD.
UPDATE: Download the Lubuntu 14.04 image for Cubieboard2. I found this image on Marcos Costales blog

I followed this video www.youtube.com/watch?v=TeULfhdX1CY and installed PhonexSuite, downloaded image and upgraded cubieboard2. Thanks for it, it saved a lot of time..