Archive for the ‘GNU/Linux’ Category

Fit-PC 2 as HTPC using (L) Ubuntu 11.04 Natty Narwhal

Monday, May 23rd, 2011

This post explains how you can setup our own media centre using Lubuntu. Using my Fit-PC 2 as example.

Fit-PC is a small, light, fan-less nettop computer manufactured by the Israeli company CompuLab. I use it in my living room and it’s nearly invisible. When I install an SSD in it, I will stick it back on my TV.

After the installing Lubuntu from USB stick I had to manually shut the computer down. Apparently there are some ACPI bugs in Natty, but it’s not important. It will be on most of it’s life. I made sure the computer was up to date before installing display driver.
sudo apt-get update
sudo apt-get upgrade

The fit-pc 2 ships with GMA500 Intel graphics. It kinda sucks since Intel is unable to give us proper drivers for it! This is why I will think twice or even three times before buying anything from Intel again.

To use GMA500 I deceided to use EMGD (source):
sudo add-apt-repository ppa:gma500/emgd
sudo apt-get update
sudo apt-get install xorg-emgd emgd-dkms
sudo emgd-xorg-conf

emgd-xorg-conf creates a config in /usr/share/X11/xorg.conf.d/10-emgd.conf. This is when the problems occour. emgd-xorg-conf discovers wrong port which I had to manually edit. My modified 10-emgd.conf:
Section “ServerLayout”
Identifier “Default Layout”
Screen 0 “Screen0″ 0 0
EndSection

Section “Device”
Identifier “Intel_IEGD-0″
Driver “emgd”
VendorName “Intel(R) DEG”
BoardName “Embedded Graphics”
BusID “0:2:0″
Screen 0
Option “PcfVersion” “1792″
Option “ConfigId” “1″
Option “ALL/1/name” “svdo-display”
Option “ALL/1/General/PortOrder” “24000″
Option “ALL/1/General/DisplayConfig” “1″
Option “ALL/1/General/DisplayDetect” “1″
Option “ALL/1/General/Accel” “1″
Option “PortDrivers” “svdo”
Option “ALL/1/General/VideoRam” “131072″
Option “ALL/1/Port/2/General/name” “sdvo”
Option “ALL/1/Port/2/General/Edid” “1″
Option “ALL/1/Port/2/Attr/70″ “0″
EndSection

Section “Screen”
Identifier “Screen0″
Device “Intel_IEGD-0″
Monitor “sdvo”
SubSection “Display”
Depth 24
Modes “1024×768″
EndSubSection
EndSection

Section “Monitor”
Identifier “sdvo”
ModelName “sdvo panel 1024×768″
EndSection

Section “DRI”
Mode 0666
EndSection

Section “Extensions”
Option “composite” “enable”
EndSection

Keyword here is ALL/1/Port/2 were port 2 was 4 in the orginal configuration and sdvo was lvds.

I then installed lirc to be able to use my transcend remote for my picture frame, you can use anything. I followed some tutorial for making it work. Basically run irrecord to trian lirc to understand my remote.

sudo irrecord -d /dev/lirc0 /etc/lirc/transcend.conf

 

I tried Boxee first, but it’s bloated. Ended up using XBMC:

sudo add-apt-repository ppa:team-xbmc
sudo apt-get update
sudo apt-get install xbmc
sudo apt-get update
sudo apt-get upgrade

Edit #1
If you want XBMC to automatically detect new movies just open crontab

crontab -e

and add the line

* 10 * * * wget -T 60 -q -O /dev/null "http://user:passwd@localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(updatelibrary(video))" # run once a day

You will of course have to enable HTTP controlling in XBMC for this to work. Also make sure your user, password and port is correct from the line above.

End of edit

To make lirc work with XBMC we will have to setup a config in XBMC. It should be located in /home/user/.xbmc/userdata/Lircmap.xml. Here is mine:

<lircmap>
 <remote device="/etc/lirc/transcend.conf">
 <play>KEY_PLAYPAUSE</play>
 <pause>KEY_PLAYPAUSE</pause>
 <stop>KEY_STOP</stop>
 <forward>KEY_NEXT</forward>
 <reverse>KEY_PREV</reverse>
 <left>KEY_LEFT</left>
 <right>KEY_RIGHT</right>
 <up>KEY_UP</up>
 <down>KEY_DOWN</down>
 <select>KEY_OK</select>
 <pageplus>KEY_PAGEUP</pageplus>
 <pageminus>KEY_PAGEDOWN</pageminus>
 <back>KEY_EXIT</back>
 <menu>KEY_MODE</menu>
 <title>Guide</title>
 <info>KEY_CYCLEWINDOWS</info>
 <skipplus>Skip</skipplus>
 <skipminus>Replay</skipminus>
 <display>Aspect</display>
 <start>KEY_HOME</start>
 <record>Record</record>
 <volumeplus>KEY_VOLUMEUP</volumeplus>
 <volumeminus>KEY_VOLUMEDOWN</volumeminus>
 <mute>KEY_MUTE</mute>
 <power>KEY_POWER</power>
 <myvideo>KEY_VIDEO</myvideo>
 <mymusic>KEY_MUSIC</mymusic>
 <mypictures>KEY_PROG1</mypictures>
 <mytv>KEY_CALENDAR</mytv>
 <one>One</one>
 <two>Two</two>
 <three>Three</three>
 <four>Four</four>
 <five>Five</five>
 <six>Six</six>
 <seven>Seven</seven>
 <eight>Eight</eight>
 <nine>Nine</nine>
 <zero>Zero</zero>
 <star>Star</star>
 <hash>Hash</hash>
 <clear>Clear</clear>
 <enter>Enter</enter>
 <red>Red</red>
 <green>Green</green>
 <yellow>Yellow</yellow>
 <blue>Blue</blue>
 <teletext>Teletext</teletext>
 </remote>
</lircmap>

Give me a comment if anything is unclear.

Bachelor project

Tuesday, April 5th, 2011

I’m currently finishing my Automation bachelor degree collecting the last 30 points. 20 of these points are achieved by one last project, main project.

Me and three other students are doing a project for Repant ASA, by making a vending machine.

You can get details and information on our website, setup and maintained by myself; http://www.hovedprosjekt.com/

ALL IN 1 HDD Docking (Unitek) in Linux

Thursday, May 27th, 2010

Since my external HDD`s adapter died and I found out that these Western Digital`s adapters are bad all over through Google. I threw the contoller away and bought a new instead of another faulty adapter. There were little information about this controller, but it has tons of features at a low cost. My main concern was support in Ubuntu, but I found some defuse info about Linux support after some heavy Googling. I gave it a shoot and this post is my blessing for it`s plug`n`play comparability with Linux. I can now use the WD SATA disk and an old IDE disk laying around!

Tech and photographing

Sunday, March 7th, 2010

Rube Goldberg Machine version

Unbelievable plane build and it`s movie

Sound technology, listen to nearby planes pretty cool idea

Snowplow

youtube speed

Photographing cotton

Miniature New York

Food landscape

Make it smaller and become bigger

Marion on Arduino

Laser scissors

Analog and Digital TV Signal Generation

Installing Frets On Fire on Ubuntu by making .deb package

Sunday, November 8th, 2009

sudo apt-get install dh-make
mkdir fretsonfire-1.3.110
cd fretsonfire-1.3.110
dh_make -s -n
cd debian
rm *.ex *.EX
mkdir fretsonfire
mkdir fretsonfire/usr
mkdir fretsonfire/usr/share

Now download the game
wget http://downloads.sourceforge.net/fretsonfire/FretsOnFire-1.3.110.tar.gz?use_mirror=osdn
tar zxf FretsOnFire-1.3.110.tar.gz
mv Frets\ on\ Fire-1.3.110/ fretsonfire/usr/share/fretsonfire
rm -rf Frets\ on\ Fire-1.3.110/ FretsOnFire-1.3.110.tar.gz

mkdir fretsonfire/DEBIAN
pico control

Make sure it look something like this
Source: fretsonfire
Priority: optional
Section: universe/games
Maintainer: yourname
Homepage: http://fretsonfire.sourceforge.net/
Package: fretsonfire
Architecture: all
Version: 1.3.110
Depends: python-pygame, python-opengl, python-numpy
Description: Open source guitar game

cp control fretsonfire/DEBIAN/
mkdir fretsonfire/usr/bin
echo -e "#\!/bin/dash\ncd /usr/share/fretsonfire/src/\npython FretsOnFire.py" > fretsonfire/usr/bin/fretsonfire
chmod +x fretsonfire/usr/bin/fretsonfire
mkdir fretsonfire/usr/share/pixmaps

# if the following image does not exist, find another one through google
wget http://www.freedownloadsplace.com/photo/Frets-on-Fire-1.png -O fretsonfire/usr/share/pixmaps/fretsonfire.png
mkdir fretsonfire/usr/share/applications
pico fretsonfire/usr/share/applications/fretsonfire.desktop

Overwrite with this text
[Desktop Entry]
Version=1.3.110
Type=Application
Name=Frets On Fire
Comment=A opensourced guitar game
Icon=fretsonfire
Exec=fretsonfire
Terminal=false
Categories=Game;ArcadeGame;

cd ..
dh_builddeb
cd ..
dpkg -i fretsonfire_1.3.110_all.deb

Ubuntu network install (PXE)

Sunday, October 25th, 2009

sudo apt-get install tftpd-hpa tftp-hpa xinetd dhcp3-server
sudo pico /etc/xinetd.d/tftp

Then write following

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = /var/lib/tftpboot
disable = no
}

Edit TFTP config
sudo pico /etc/default/tftpd-hpa

Make it look something like

#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"

Create TFTP directory and get latest netboot image

sudo mkdir /var/lib/tftpboot
cd /var/lib/tftpboot
sudo wget -np -r http://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/
sudo mv archive.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/* .
sudo rm -rf archive.ubuntu.com

Now restart TFTPD
sudo /etc/init.d/tftpd-hpa restart

To check if running@
netstat -uap

For DHCP, make sure you have a fixed ip for your device
pico /etc/dhcp3/dhcpd.conf

I did use firestarter as a DHCP generator since I used my desktop as PXE-server.


# DHCP configuration generated by Firestarter
ddns-update-style interim;
ignore client-updates;
authoritative;

subnet 192.168.66.0 netmask 255.255.255.0 {
option routers 192.168.66.9;
option subnet-mask 255.255.255.0;
option domain-name-servers 130.67.60.68, 193.213.112.4;
option ip-forwarding off;
range dynamic-bootp 192.168.66.10 192.168.66.20;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.66.9; # important for PXE
filename "pxelinux.0"; # important for PXE
}

After the DHCP change we must restart DHCP
sudo /etc/init.d/dhcp3 restart

You should now be able to boot PXE of this machine.