Category Archives: CubieTruck

Using Chrony on CubieTruck

Don’t.

Unless you really know what are you doing.

To synchronize the clock and fix a minimal time shift I was detecting, I followed the idea of the TurtleBot2 to use chrony to fix that Chrony is a little daemon that connects to your linux clock or hwclock and detect shifts. For some reason this lead to total chaos on the amosero.
I suppose chrony hasn’t been build for multicore dynamically speeded processors like the A20, which is why the shifting has been erratic and up to 2 seconds per minute.

sudo apt-get remove chrony

Fixed all timing errors on the [amazon &title=CubieTruck&text=CubieTruck]. Also it’s a bit disturbing how little changes can inflict complex setups.

 

 

Howto use CubieTruck and NetworkManager to do WPA2 Enterprise TLS

Last days the [amazon &title=CubieTruck&text=CubieTruck] made me struggle with its Network behavior. It continuously refused to connect to any WLAN, didn’t allow the Usage of the NetworkManager GUI, and confused me a lot.

Some things that might help you:

Wlan isn’t enabled by default – or at least it wasn’t for me.

Load the driver

modprobe bcmdhd

In case you don’t want to do that everytime the [amazon &title=CubieTruck&text=CubieTruck] needs wifi consider adding a new line with ‘bcmdhd’ (no quotes) to /etc/modules

I needed to install the linux firmware:

sudo apt-get install linux-firmware -y

and reboot

sudo reboot

3. bring the wlan0 device up and scan if your wlan is available

sudo -i #get root 
ifconfig wlan0 up
iwlist wlan0 scan

Check if the /etc/network/interfaces file looks something like that:

auto lo eth0
iface lo inet loopback

No additional lines, or the NetworkManager will struggle with your devices, showing them as “not managed” or “disconnected”.

So by default lubuntu 13.04 image, no Network manager has been running by boot, so I’ve fixed that by adding following line to my /etc/crontab:

@reboot /usr/sbin/NetworkManager

(sure there are other ways – especially because it’s a system service)

So after reboot – using the [amazon &title=CubieTruck&text=CubieTruck]-GUI its faces you with a “Network Manager not running”.

Screenshot[amazon &title=CubieTruck&text=CubieTruck]

So the small Icon on the taskbar isn’t able to find the network manager.
I could not fix that other than by opening an LXTerminal and:

sudo killall nm-applet && sudo nm-applet

which leads me to a nice WLAN GUI and made it possible to use WPA2 Enterprise with TLS 🙂

Howto control CubieTruck onboard LEDs

Today I wanted to know, what this little blinking lights on my [amazon &title=CubieTruck&text=CubieTruck] mean.

There are four, which you find out if you use:

root@cubietruck:/# ls /sys/class/leds/

blue:ph21:led1 green:ph07:led4 orange:ph20:led2 white:ph11:led3

(or just look at it while it is running, usually it blinks a lot)

IMG_20140520_123004

So if you want to know what each blink means you can ask the [amazon &title=CubieTruck&text=CubieTruck] like that:

root@cubietruck:cd /sys/class/leds/
root@cubietruck:/sys/class/leds# ls
blue:ph21:led1  green:ph07:led4  orange:ph20:led2  white:ph11:led3
root@cubietruck:/sys/class/leds# cat green:ph07:led4/trigger
none rfkill0 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid ac-online usb-online [mmc0] mmc1 timer heartbeat cpu0 cpu1 default-on rfkill1 rfkill2 
root@cubietruck:/sys/class/leds# cat blue:ph21:led1/trigger
none rfkill0 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid ac-online usb-online mmc0 mmc1 timer [heartbeat] cpu0 cpu1 default-on rfkill1 rfkill2 
root@cubietruck:/sys/class/leds# cat orange:ph20:led2/trigger
none rfkill0 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid ac-online usb-online mmc0 mmc1 timer heartbeat [cpu0] cpu1 default-on rfkill1 rfkill2 
root@cubietruck:/sys/class/leds# cat white:ph11:led3/trigger
none rfkill0 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid ac-online usb-online mmc0 mmc1 timer heartbeat cpu0 [cpu1] default-on rfkill1 rfkill2 

So by default the

  • green LED is indicating if there is any read write with the SD Card
  • blue LED is heartbeating
  • orange LED is CPU0 load
  • white LED is CPU1 load

In case you want to turn off the LEDS, use this code:

# turn off LEDs
echo 0 > /sys/class/leds/blue:ph21:led1/brightness
echo 0 > /sys/class/leds/green:ph07:led4/brightness
echo 0 > /sys/class/leds/white:ph11:led3/brightness
echo 0 > /sys/class/leds/orange:ph20:led2/brightness

See here for more information.

Howto use CubieTruck and tightVNCserver

VNC is a nice tool for remote desktop administration. But like a lot of things, it doesn’t work out of the box on the [amazon &title=CubieTruck&text=CubieTruck].

After installing the tightvncserver with

sudo apt-get install tightvncserver

I started and configured the server with

tightvncserver

and tried to login to [amazon &title=CubieTruck&text=CubieTruck]IP:5091 I got a grey screen and nothing more happend. So I suppose thats a blank X instead the Lxde I expected.

So tighvnc server has a small script thats executed after you login with vnc to a server, it is located at ~/.vnc/xstartup and contains by default something like that:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

So the VNC really starts a Xsession.. simply comment the last line out (use a #) and add this:

/usr/bin/lxsession -s Lubuntu -e LXDE

Now it should be possible to use a vnc viewer of your joice – like remmina and connect to your [amazon &title=CubieTruck&text=CubieTruck] using the 5901 port:

Screenshot - 13.05.2014 - 20:09:21

 

 

Howto get a CubieTruck WLAN working

Note: Please see the new version of this post

For some reason the WLAN of the [amazon &title=CubieTruck&text=CubieTruck] didn’t work out of the box. So to save you the day I spent to get it working I wrote this little step by step tutorial:

1. load the wlan driver by typing

modprobe bcmdhd

in case you don’t want to do that everytime the [amazon &title=CubieTruck&text=CubieTruck] needs wifi consider adding a new line with ‘bcmdhd’ (no quotes) to /etc/modules

2. install linux-firmware

sudo apt-get install linux-firmware -y

and reboot

sudo reboot

3. bring the wlan0 device up and scan if your wlan is available

sudo -i #get root 
ifconfig wlan0 up
iwlist wlan0 scan

4. add this wlan to your connection configuration file (replace yourSSID and yourPasswd accordingly)

sudo -i #get or stay root
wpa_passphrase yourSSID yourPasswd >> /etc/wpa_supplicant.conf

5. add following lines to /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

6. add DNS Information to /etc/resolv.conf (attention, we’ll use google in that example)

nameserver 8.8.8.8

7. restart networking to get changes to action

sudo service networking restart

If everything went well, your wlan0 device should have an IP when checking it with

ifconfig wlan0 

CubieTruck (CubieBoard 3) unboxing

The CubieTruck (or so called Cubieboard 3) is the third board of CubieTeam. It is a new PCB-Version with a Allwinner A20 Chip, which has also been used in the CubieBoard 2. But now there is more RAM (2GB) and onBoard VGA-graphics Controller, onBoard Wifi (!) and BLuetooth. There are some more features mentioned below, but for my project the main advantages are: more processing power (2 stronger cores), lower power consumption (500mAh at 5V), lots of GPIOs (2mm!) and flash memory.

So I unboxed one today:

It came with an android os flashed. So after some reading and kinda confusing tutorials I managed to get the correct version 13.04 of lubuntu server running on a sd card, installed ROS on it and was faced with some kind of paradies of ros hydro armhf packages!
Something I was really missing at the [amazon &title=Raspberry Pi&text=Raspberry Pi].

So after the first day of CubieBoard I am really looking forward to get this little fellow beeing the heart of my ROS Robot.

Features:

  • Allwinner Tech A20 SOC
  • SATA supported
  • 54 extended pins
  • Built-in HDMI/ VGA display interface
  • Built-in WIFI+BT module
  • 2GB DDR3 RAM
  • Built-in IR receiver
  • SPDIF audio interface

Specifications:

  • Allwinner Tech SOC A20 ARM® Cortex™-A7 Dual-Core ARM® Mali400 MP2 Complies with OpenGL ES 2.0/1.1
  • 2GB DDR3@480MHz
  • HDMI&VGA 1080P display output on-board
  • 10M/100M/1G Ethernet
  • WIFI + BT wireless connection with antenna on-board
  • SATA 2.0 interface support 2.5’ HDD (for 3.5’ HDD, only need another 12V power input)
  • Storage solution NAND + MicroSD
  • 2 x USB HOST, 1 x OTG, 1 x SPDIF, 1 x IR, 4 x LEDs, 1 x Headphone, 3 x Keys
  • Power DC5V@2.5A with HDD support Li-battery & RTC
  • 54 extended pins including I2S, I2C, SPI, CVBS, LRADC x2,UART, PS2, PWM x2, TS/CSI, IRDA, LINEIN&FMIN&MICIN, TVIN x4 with 2.0 pitch connectors
  • PCB size 11cm *8cm*1.4mm