Check out the new projects site for A-i-S www.adventuresinsilicon.com

Thursday, September 22, 2011

Exciting new embedded devices for developers (Raspberry Pi and Arduino Due)

The imminent release of two new hardware products are worth getting excited about.

Raspberry Pi

The first is the Raspberry Pi. It comes in two flavours:

The Model A

 The Model B


The best way to describe it is as a $25 (Model B is $35) equivalent of the first BeagleBoard in a smaller form factor hence fewer ports.  It is slated to be available in November 2011. (Note for the Australian and New Zealand audience: It is very likely I will be selling these locally to help avoid shipping costs from the UK. Stay tuned)

Thursday, July 28, 2011

PandaBoard Webserver

It is quite easy to run an Intranet or Internet webserver on a PandaBoard running Ubuntu. Therefore this tutorial assumes you are running Ubuntu on your Pandaboard. If you are running from an SD card and have space or speed issues you can always run from a USB harddrive (see my set up here:
http://adventuresinsilicon.blogspot.com/2011/04/pandaboardbeagleboard-how-i-make-my.html )


Running a webserver will allow other users on your network or the Internet to access webpages and anything else you wish to serve such as Nagios statistics, OpenKM servers, security camera footage etc.

For this process I will use Apache running on Ubuntu 10.11.

This also applies to a BeagleBoard running Ubuntu.

Sunday, July 3, 2011

HowTo: Run an OpenKM Server on PanadaBoard

This post assumes you are running Ubuntu on your Pandaboard and have access to the Internet Gateway sufficient to allow direct port access between your server and the Internet.

OpenKM is Knowledge Management software which stores files and your chosen metadata around those files.

It acts similar to Sharepoint in the way you can upload, check in, check out, lock documents etc. It has workflow management, search, etc etc


Saturday, June 25, 2011

Apache Tip - Realtime view of user access

In preparation for an upcoming post on running a webserver on your BeagleBoard/PandaBoard I stumbled across a handy tip with Apache.

If you are running a default Apache install under Ubuntu you can monitor the access of that webserver in realtime with the following command:

"tail -f /var/log/apache2/access.log"


This will automatically update the output in realtime (or close enough for a webserver)

There are other ways to do it with watch for example but this is the easiest way I found to show just the relevant information.


Saturday, June 4, 2011

Upcoming benefits in Kernel 2.6.39

If you review the changelog for the 2.6.39 kernel you will see many additions that benefit ARM and omap architecture.

Specifically rc-6's changelog:

http://www.kernel.org/pub/linux/kernel/v2.6/testing/v2.6.39/ChangeLog-2.6.39-rc6


A taste of what is coming for ARM platforms:

commit 625a3b6057e86d5079976db5648bd42289c8b6cc
Merge: c7bcecbe98fe e8bf8df9c296
Author: Linus Torvalds 
Date:   Mon May 2 12:17:05 2011 -0700

    Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm
    
    * 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm: (47 commits)
      CLKDEV: Fix clkdev return value for NULL clk case
      ARM: 6891/1: prevent heap corruption in OABI semtimedop
      ARM: kprobes: Tidy-up kprobes-decode.c
      ARM: kprobes: Add emulation of hint instructions like NOP and WFI
   

Thursday, April 28, 2011

PandaBoard/BeagleBoard: How I make my development life easier (my set up)

I thought it might be useful to describe how I have set up development environment at a high level. This is my take on how to make it as easy as possible to develop code on the BeagleBoard and Pandaboard.

In essence I have a desktop PC next to the PandaBoard which I develop on. At the same time I have the PandaBoard connected to:
  • a 19" monitor via a DVI/HDMI cable;
  • 8GB SD Card;
  • a usb hub;
  • wired ethernet to my home network;
  • 1 TB Hard Drive via USB;
  • keyboard;
  • mouse; and
  • power.

Both the Desktop and PandaBoard are running Ubuntu operating systems.

Monday, April 25, 2011

PowerVR: How to get GLES examples to compile (PandaBoard 3D Graphics)

The goal is to compile the examples from the Imaginations Technologies Graphics SDK to run OpenGL ES software on a BeagleBoard/PandaBoard:


BACKGROUND:

The OMAP4430 contains several things. One area of the silicon is the Imaginations Technologies' licenced intellectual property in the Power SGX540. This section of the die supports hardward processing of the OpenGL ES 1.1 and 2.0 standards.

The exact nature of the hardware which processes the graphics is proprietary and deliberately kept closed. To protect the knowledge of how to implement graphics drivers in silicon it is assumed that it is necessary to restrict access to the low level software which interacts with it.

To this end you are unlikely to ever see the source code for the device drivers which operate the SGX540. What you do get is the binary driver. TI distribute this within the Ubuntu package "ubuntu-omap4-extras-graphics".

Therefore there are several sources of information involved to getting OpenGL ES 2.0 code to compile on the PandaBoard or the BeagleBoard etc.

Friday, April 22, 2011

BeagleBoard & PandaBoard: How to natively compile ioQuake3

This post assumes you are running Ubuntu on your BeagleBoard/PandaBoard. It also assumes you have Quake3 installed somewhere where you can copy files from.

Quake3 is a graphically intensive 3D game released by id software in 1999. The game engine id tech 3 was originally closed source but was opened up in 2005.

The GPL'd source has been improve by many and the best derivative repository is ioQuake3 (http://ioquake3.org/).

It is possible to compile the Quake3 game natively on the BeagleBoard/Pandaboard.

Next Generation of ARM cores are interesting indeed

Sources:
http://www.channelregister.co.uk/2011/04/20/arm_cortex_a15/
http://www.arm.com/products/processors/cortex-a/cortex-a15.php

Pretty exciting news that the next generation of the of ARM cpus (A15) to arrive in early 2013 are being touted as having up to 16 cores, clock speeds of up to 2.5 GHz whilst using a similar amount of power as the current A9s (based in part on new fabrication techniques).



Thursday, April 7, 2011

Ubuntu: Sending and receiving serial under Linux (Ubuntu)

The code below will read serial strings from the UART at 115200 baud.

This is intended to work with a 2.6.* Linux kernel.

Surprisingly I was unable to locate a simple Linux example to read the port at 115200 reliably and without blocking the port or experiencing buffer lag.

I dug through kernel makefiles and pulled out the needed ioctl parameters, you will find the results of my labours below.


 Compiled on gcc 4.4.5.

 I use this to receive high speed data from sensors attached to an Arduino.


Sunday, April 3, 2011

Ubuntu 11.04 to be released in days - positive impact for OMAP platforms

From the Ubuntu 11.04 beta website (my comments are further down below):

( http://www.ubuntu.com/testing/natty/beta )

Ubuntu Netbook on ARM

In Natty the dedicated Ubuntu Netbook is only used on the preinstalled OMAP3 and OMAP4 armel images. On all other architectures the Ubuntu Netbook edition has been merged with the Ubuntu's Desktop.
The ARM version is the first one to ship our new Unity 2D interface by default, as there are no free 3D drivers available initially in a default installation.
The 2.6.38 kernel for OMAP4 got many driver improvements, most notably the display driver was switched to use the HDMI port by default and auto detect the monitor resolution.

Saturday, April 2, 2011

Thank you readers


As you can see from the chart above this humble little blog has seen some increased attention lately.

This will spur me on to bring even more posts about Linux, Pandaboards, Beagleboards and Arduinos that I think you guys and gals will like.

Thanks!

Tuesday, March 22, 2011

Beagleboard: Power usage (current draw) for certain scenarios

Below are some unscientific tests done on my Beagleboard.  I hooked up my multimeter to determine current draw for several states.

Here are the results.

During Xubuntu boot, with 1x webcam and Wifi stick:

.500A to .900A

Boot, no attachments:
.300-.450A

Sunday, March 20, 2011

Pandaboard & Beagleboard: Using rsync and cron to backup a directory

This post is about using rsync to ensure a local directory's contents are backed up to a server.

I currently have a beagleboard running as a security camera (link to tutorial) and have mounted a remote Samba share locally.  I would like the Beagleboard to copy the security footage every 2 minutes to the server and in a separate step I'll then delete files over a certain age.

This way the Beagleboard's SD card will not get full and I'll have a secure, backed up server holding the footage.

PandaBoard: Using a Webcam as a Security Camera

Assumptions:

The following assumes you are running Ubuntu on your PandaBoard or BeagleBoard.  It also assumes the board has a working Internet connection.  If you need to set up Wifi see this post here: http://adventuresinsilicon.blogspot.com/2011/01/pandaboard-setting-up-wifi-on-comand.html


This tutorial is about setting up a headless Pandaboard or BeagleBoard with a webcam attached. This webcam will act as a security camera and will record videos when motion is detected.

Steps:

  1. Install an SSH server so we can login from another computer on the network
  2. Install 'motion' software which controls the camera
  3. Configure motion
  4. Automatically start motion on startup

Friday, March 4, 2011

Coming soon - Using an Arduino to control a 3d game engine

Soon I'll post the rudimentary elements needed to use sensor data captured by an Arduino to control the world inside a 3D game engine (Irrlicht).

This engine can run on a PC or Beagleboard/Pandaboard and this means you can interface with robotics easily.

ETA is a couple of weeks at most.

Tuesday, February 15, 2011

BeagleBoard & PandaBoard: PowerVR open source

If you use the PowerVR graphics processor (found in BeagleBoards, PandaBoards, Samsung Galaxy's, iPhone etc) then the following news is interesting.

The FSF is making reverse-engineering the binary blob drivers a top priority.

They are seeking to have an open source implementation of OpenGL 3 running on SGX540 hardware.

Full details here:
http://libreplanet.org/wiki/Group:PowerVR_drivers

Monday, February 14, 2011

PandaBoard Ubuntu: How To recompile the Ubuntu kernel on the Pandaboard

Why Build a New kernel?


There are many reasons, I find the most likely one is because some functionality exists in the very latest build but not in the version you are currently running. Also there are build options you might want to change on the current version such as enabling highmem on the current kernel to allow use of the full 1Gb of RAM on the PandaBoard (currently disabled because of compiler segfault issues).

The reasons boil down to trying something new, tweaking something to run better or fixing an error. There are others of course.
Assumptions:

The following assumes you are running Ubuntu natively on a PandaBoard, you have several gigabytes of free space available to the Pandaboard, a reasonably fast Internet connection to the PandaBoard and hours of time to let it compile.

Sunday, February 6, 2011

PandaBoard setting a static IP

If you wish to set a static IP address for you Pandaboard you will need to do the following at the command line.

Please note that trying to use the graphical interface network manager will not work as the automatic IP address discovery process will occur at boot each time unless editing the /etc/network/interfaces file.

We will need several pieces of information before we set the IP.

Android: SDK Ubuntu installation fix for Eclipse 3.5

If you installed Eclipse using apt sources (via apt-get, aptitude or Synaptic etc) then you will need to add the following to your "additional" software sources in Eclipse:

http://download.eclipse.org/releases/galileo


This fixes the errors associated with org.eclipse.wst.sse.core 0.0.0 when trying to install the Android Development Tools.

This only applies to Eclipse installed in Ubuntu using apt sources.

Thursday, February 3, 2011

How to set up SSH on the PandaBoard/BeagleBoard for external access

Background

Setting up an SSH server on your PandaBoard allows you to open up a terminal on any Internet connected computer as if it was opened locally on the PandaBoard.  From there you can execute commands as if you were physically connected to the PandaBoard.

This will allow you to open up a terminal on any computer on the Internet and be able to log into your Pandaboard/Beagleboard and copy a file from your network back to your local PC.

In this post we set up the PandaBoard to receive ssh connections from the Internet using the dyndns redirection service.

Assumptions 

It is assumed that you have a static IP for your PandaBoard (see here for more info http://adventuresinsilicon.blogspot.com/2011/02/pandaboard-setting-static-ip.html).

It is assumed you have an Internet connection to the PandaBoard.

Installation

Installing the SSH Server is a matter of installing:

sudo apt-get install ssh


Security

SSH allows remote connections. Installing an Internet connect SSH terminal does increase the chances of a security breach. It is possible for badguys to scan great swathes of the Internet searching for open connections or vulnerable ones.

There are several ways to secure your network whilst running an SSH server. We will do the following steps to secure our PandaBoard server from attack:



1.    Change the port from the default and make sure external root logins are not allowed

Using Ubuntu means we don't know the root login password anyway so we will disable it.

Edit the file /etc/ssh/sshd_config with:

If using a window manager:

sudo gedit /etc/ssh/sshd_config
If using the commandline:
sudo nano /etc/ssh/sshd_config

Then locate the line which says "Port 22" and change 22 to a new random port number. You will need to remember the port number every time you log in to the SSH Server.

Then locate the line which says "PermitRootLogin yes" and change 'yes' to 'no'


2.    Install 'Denyhosts' to monitor and drop repeated failed attempts to log in.
Denyhosts is a program which will monitor attempted connections and after a set number of failed attempts will ban that IP address from any more attempts. Install it with:

sudo apt-get install denyhosts

3.    Ensure strong passwords

If your password for your normal user is not very strong you should modify it to be stronger (longer, using punctuation marks, capitals and lowercase characters and preferably words which do not appear in a dictionary).  To change the password type the following at the prompt:

passwd

Replace with your username.  If you don't know it, type the following to find out:

whoami

4.    Security Updates

You should make a habit of regularly checking and updating the packages in your system (at least download the security updates). To do this from the command line, run:

sudo apt-get update
sudo apt-get upgrade


5.    Restart the SSH server

To apply the changes you have made type:

sudo service ssh restart

Summary so far:
Ok so now you should be able to log in from your local network.  If you have another Ubuntu computer on your local network, try the following command on the remote PC (not the PandaBoard):

ssh -p <--the port number you set> <--username-->@<--PandaBoard's IP Address-->


Replace the sections in brackets with the relevant information.


Logging in from the Internet


If you know the IP address your ISP allocated to you, then you could theoretically login to that IP address right now from anywhere on the Internet with SSH and access your PandaBoard.

There are two main issues with this, firstly your allocated IP address changes and secondly you probably have a firewall stopping direct connections.

It is likely that your Router/ADSL/Switch etc will block direct connections if you are on ADSL.

My preferred method is to sign up for a free account at www.dyndns.org. This will allocate a web address based on the username of your DynDNS account.

for example if you accout is "fred" then you could have the address fred.dyndns.org.  At the time of setting up the account that URL address will map to your ISP allocated IP address.

What I prefer to do is have my router automatically update the details of DynDNS account everytime my allocated IP address changes.  Most modern routers will have an advanced option to allow this.

On my router it was labelled "virtual server" and DynDNS.org accounts were accommodated. You can also run a client on your PC to update if your router can not do it automatically.



Once you have linked an URL to your account you can ssh in from any box on the Internet.  If your DynDNS accoutn was "fred" and you chose port number 3434 above when you changed it from 22, on a remote ubuntu box you would run the following command to login:


ssh -p 3434 fred@fred.dyndns.org


From there you can execute any command as if you were typing on a local keyboard.

If you want to allow X Windows applications to be started on the host and viewed on the client then add the switch "-X" to the command line eg:

ssh -X -p 3434 fred@fred.dyndns.org



If you have an Android SmartPhone try installing the ConnectBot app and logging in from your phone!



There are further steps you can take to secure the connection and there are some purpose built apps designed to run over SSH. If you use Ubuntu for the remote PC review this handy SSH related tip:
http://adventuresinsilicon.blogspot.com/2011/01/linux-tip-accessing-files-over-ssh.html


Tuesday, February 1, 2011

Update: Upcoming posts

In the next couple of weeks I intend to finalise several posts on the PandaBoard, the topics they cover are:

  • Compiling your own kernel 
http://adventuresinsilicon.blogspot.com/2011/02/pandaboard-ubuntu-how-to-recompile.html
http://adventuresinsilicon.blogspot.com/2011/03/pandaboard-using-webcam-as-security.html

These are all partially written. I just need the time to write them up fully.

Stay tuned.

If you have any requests for Ubuntu+PandaBoard please leave a comment below.

Monday, January 31, 2011

PandaBoard: Setting up Wifi on the comand line (Ubuntu)

If you want to set up Wifi from the command line (it might be the only way to install a desktop for example) you will need to edit the following file:

/etc/network/interfaces 

If you don't know how to use vim or other command line text editors and just want to edit the file, try installing nano this needs an Internet connection though),with:

sudo apt-get install nano

Nano is fairly obvious as it follows normal GUI based methodologies.

Now you can use nano (or any other text editor, just substitute it for 'nano' in the below command) to edit the interfaces file:

sudo nano /etc/network/interfaces

To determine what entries should go into this file review the options at this page:

My interfaces file looks like the following (I am using WPA2 security):
 
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid <--NAME OF AP-->
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk <--INSERT KEY XXXXXXXXXXXXXXXXX-->
 
The items in green above are placeholders for your security settings. You need to replace them with


Once you have completed the amendments to the interfaces file and want to test the setup enter the following command to restart the networking services:


sudo service networking restart

If that all goes well, check the interface is working (up) with this command:

ifconfig wlan0

Hopefully some traffic is reported to have taken place and that an IPv4 address has been allocated.

If not, check the dmesg log for error messages:

dmesg

Finally to test everything is working, try pinging a site, for example:

ping www.google.com



Sunday, January 30, 2011

Linux Tip: Reloading bashrc

 
In Ubuntu ~/.bashrc contains the paths for each terminal session create.
Once you've edited the bashrc file, you can reload it with the following command
 
. ~/.bashrc

Wednesday, January 26, 2011

Pandaboard Cooling

It is Summer in Australia and about 31 degrees Celsius where I am.

The above setup is a 80mm PC case fan plugged into 12V.

Surprisingly it cools the OMAP4/RAM package from the point where I cannot touch it to a point where I can place my finger on it.

If choosing direct heatsinking of the CPU/RAM package consider that the WiFi and Bluetooth are in close proximity and their antenna configuration may be affected by metallic (ferrous) objects.

UPDATE - 13 March 2011:

In a room which is ~27 degrees Celsius the PandaBoard CPU is measuring ~54 degrees under Xubuntu idle load (both cores ~5% ultilisation)

Saturday, January 22, 2011

Pandaboard: How to read the temperature sensor

From the IRC chat logs, user mru provided userland code to read the internal bandgap temperature sensor in the OMAP4 used in the Pandaboard. Code can be found at:

Linux Tip: Finding out how big a directory is

At the terminal, if you are wondering how big a directory is you can enter the following command to find out;

du -sh /home/user/interesting_directory/

Obviously replace "/home/user/interesting_directory/" with the location you are interested in.

If you leave off the location it will measure the current directory

du is the "disk usage" tool, option '-s' is for sum, and "-h" is human readable format.

Executing this command in my home directory reports back:
405M

Wednesday, January 19, 2011

Linux Tip: Finding out how to save power in Linux

Whether running on a laptop battery or a home built robot's RC Car battery if you want to know what commands to run to shutdown unnecessary process, shorten timeout periods on errant power hungry daemons or stop uncessary disk writes, you need "powertop"

Under Ubuntu:

sudo apt-get install powertop

Then open a terminal and run 'sudo powertop' and let it run.  Every 15 seconds or so it will update with a tip, usually an example comand to run, to save power.


Cheap source of DC Power Plugs and Jacks

An often overlooked component for project is the humble power plug.  Ignored until you need one, then you end up scrambling around contemplating if you can cut up a power pack here or there.

Well put those scissors down and go to Futurlec and order some for very little money:

Tuesday, January 18, 2011

Xubuntu on 701 eeepc is totally worth it

Ok with a caveat - I've got 2Gb of RAM in my 701 eeepc.

Xubuntu runs great.

Installs in 1.9Gb of NAND, is fast and responsive and so far fits into the 800x480 really well.

Xubuntu on a 701 eeepc

If install Xubuntu-altenate-10.10-i386 on a Eeepc 701 (4G) please be very very patient during installation.

Xubuntu can be downloaded from here:
http://www.xubuntu.org/getubuntu

At one early stage you will be told the installer can't find a proper video mode, choose the option at this stage.


Stages such as "Detecting Hardware" will take ages but then it will be quick.  I'm guessing something in the installation routine fails and has to wait until it times out before it proceeds.

I've install 2Gb of RAM in my 701 eeepc with relatively fast SD cards and USB sticks etc and it still takes ages on these points so I'm thinking it is a timeout period thing.


Speeding up Ubuntu on the Pandaboard with Xubuntu

RAM issue

Ok, so if you are currently using an A1 Pandaboard and the Ubuntu kernel, you will see the kernel has only allocated ~768Mb of the actual 1Gb of ram, this is due to a segfault when trying to compile things using 1Gb of ram.


SD Card speed issue

It seems either Ubuntu or ARM kernels have an issue with the SD card controller on the Pandaboard.

How to speed up Ubuntu on the Pandaboard

Easiest step is install Xubuntu by entering this on the commandline

sudo apt-get install xubuntu-desktop
 
It will take a good long while to complete but then you will have this:
 



As well you can try disabling the swapfile by editing it out of the /etc/fstab file and rebooting.

Saturday, January 15, 2011

Linux Tip: Accessing files over SSH

Nautilus can automatically access remote files over SSH.

In Ubuntu:
If you click on the desktop and hit CTRL+L

then type

ssh://username@ipaddress_or_hostname:port#

Then you will be prompted for a password and options

Now you should be able to browse the remote system like it was local

Linux Tip: How to search a project for a string

If you need to search for a string such as "nasm" in a directory full of files and sub-directories try:

 grep -R -B2 -A2 nasm /home/dingo/program_dir/*

Sunday, January 9, 2011

How to set up Solr in Ubunutu 10.10

NOT COMPLETE YET

Based on http://lucene.apache.org/solr/tutorial.html

I have only just started with Solr so YMMV and feedback welcome.

Step 1:

Use Syanptic to install solr-jetty [and associated dependencies]


Step 2:

Open a terminal and run "sudo java -jar /usr/share/jetty/start.jar"

Step 3

Make sure Apache2 can run by "sudo apache2ctl start" and look for error messages.