Saturday, December 7, 2013

Cubietruck a complete noobie guide

Introduction


I own a raspberry pi and loved it, but it just wasn't powerful enough. So I googled around and found Cubie, figured it should be more than powerful enough for what I wanted to do. I found out the hard way that the cubie is not as user friendly as the raspberry pi was. My biggest gripe was that there was tons of support however it was not as good as the raspberry pi community is. For instance I was under the impression I could boot from an SD card just like the pi, and while I can what I didn't know is that it has to be a microsd card. Luckily I had an old cell phone that had an 8gig card in it that I could use. The next issue I faced was installing the image onto the sd card and how exactly to do it. In this post I will go over some of the things that I faced with the cubie and how I was able to over come them in hopes that someone else will have good documentation to go off of. I am using the cubietruck and installing lubuntu on an older scandisk 8gig microsd card.

Check List:


Hardware
  • microsd card reader
  • microsd card (at least 2gig)
  • computer running linux
  • cubietruck
  • a way to supply the cubie with power: For this I'm using a 5v/1amp cell phone dc charger with the supplied usb power cord that came with the cubie
  • hdmi cord
  • tv/monitor with hdmi
  • usb wired or wireless keyboard

  • Software
  • u-boot
  • bootfs
  • rootfs

  • You will also need dd for linux (usually pre-installed)to transfer files.

    Installing the software to boot from microsd


    First thing we'll need to do is find the card then zero it.
    sudo ls /dev/ 
    
    Your card should show up as sdd or sde (mine happened to be sde) depending on the card and linux distro you're running. You can run ls on /dev/ get the output then plug the microsd card in and run it again to compare. Next we need to zero the card out.
    sudo dd if=/dev/zero of=/dev/sde bs=1024 seek=544 count=128
    
    Next we're going to make the card bootable with dd.
    dd if=/home/user/downloads/u-boot-sunxi-with-spl-ct-20131102.bin of=/dev/sde bs=1024 seek=8
    
    Now that the card is bootable we need to create partitions to install the operating system to. To accomplish this we'll be using fdisk on the microsd card.
    sudo fdisk /dev/sde
    
    We need to create two primary partitions:
  • First partition needs to be 64mb in size
  • Second partition needs to be fill up the rest of the card

    Basic Configuration on first boot

    Username/Password: linaro/linaro Once booted there are a few things you'll want to do. First you'll need to log in, the default user for the OS is linaro the password as you might guess is also linaro. Next thing you'll notice is that there is no wlan0 but only eht0. This is because the modules are not installed. Lets install the modules for Bluetooth and wifi.
    $sudo modprobe bcmdhd
    Now you can configure wpa supplicant to set up wifi. You might run into some issues with wpa_supplicant. You can find help with wpa_supplicant here. Lets reboot now to make sure the configuration stuck. What you'll notice is that once again wlan0 is not there anymore. This is due to the Bluetooth and wifi module not loading on boot, so lets fix this.
    $sudo modprobe bcmdhd
    $sudo nano /etc/modules
    
    At the end of the /etc/modules you'll need to add bcmdhd so that it will load on boot. Now all you need is to save the file with Ctrl^x and reboot. Now your wireless configuration and module should both load at boot. Now you should have wireless network. At this point you should update and upgrade install packages
     
    $sudo apt-get update
    $sudo apt-get upgrade
    

    Conclusion

    I've had the cubietruck a short time now, and can say that I do enjoy it and it's power over the pi; however the community could be better as far as development is concerned. I got the cubietruck to make xbmc 720p and 1080p playback smoother, without having to overclock. I haven't quite configured everything I want at the moment so I can't speak on whether the purchase I made for what I wanted the cubietruck to do was worth it. So far it's been a learning curve and I look forward to finding out more I can do with it. For now I have a starting point.

    Links

    Forums
    Main Cubieboard Site
    Tools and OS's
  • 11 comments:

    1. Great post thanks. I'm waiting to have mine at home. Can you share your experience with XBMC on lubuntu cubie? You wrote you were able to play both 720p and 1080 smoothly. How did you install XBMC on it? Custom build? Compile?
      Thanks
      A.

      ReplyDelete
      Replies
      1. My end goal is to play both 720p and 1080 over xbmc on the cubie. At this time I need to switch a few things around as xbmc is almost none responsive when is use. I believe this is due to my microsd card coming from an old cell phone. Once I switch to a class 10 microsd card I'll be able to fully examine how well xbmc will work. From what I understand is that the cubie doesn't have built in capabilities of higher video compression and decompression. I'll have a follow up post sometime after the holidays with more detail as to what works and what doesn't to compare to the pi.

        Delete
      2. any luck getting better performance out of xbmc? mine is pretty much un-usable too

        Delete
      3. Got my QBtruck but xbmc is almost unresponsive, the thing is that im using a nand lubuntu version, if i use a sd 10 would be any better??.

        Delete
    2. Hi there! I have also recently purchased a Cubitruck, only to discover that the XBMC community doesn't appear to recommend using any of the AllWinner SoC setups... =/ Awesome! Not...

      I have now tried various images, including the new PCTV image, which crashes very quickly, Lubuntu, Wheezy and Android 4.2.

      Out of all of those Android 4.2 is the most stable and most functional. And XBMC actually works. Except for displaying movies. It only renders at around 10-20fps at 720p. Which is awful.

      How far did you get with your own project?

      Cheers, Michel

      ReplyDelete
      Replies
      1. You've gotten a bit further than I have with my quest to replace my raspberry pi with the more 'powerful' cubietruck. I've been waiting until after the holidays to get things rolling again, as I now have a class 10 microsd card to play with. I started to wonder though, if there is a GPIO that supports the encoding that the cubietruck chip doesn't. It would be nice to be able to add on that hardware acceleration to accomplish what we'er trying to do. If you get to it before me let me know! Also were you using a class 10 sd card?

        Delete
    3. Hello, I purchased a cubietruck recently, and want to install xbmc on Lubuntu.
      Could you tell me how you succeeded to install xbmc?

      Thanks..

      ReplyDelete
      Replies
      1. This comment has been removed by the author.

        Delete
      2. Should be as easy as `sudo apt-get install xbmc`

        Delete
      3. I've got a follow up post soon to come with another distro and it's successes and fails with xbmc. Seems promising so far, just need more testing done before I'm convinced it will work good.

        Delete
      4. Hey, I have my cubietruck turning up this week. I bought it for watching movies and surfing the web in the lounge (replacing wdtv live set up). How are you getting on with 720 or 1080?

        Delete