WRTU54G-TM running X-Wrt
tags: cisco linksys linux openwrt router wifi wrtu54g-tm x-wrt
20 Apr 2011 20:59
OK, so some time ago I bought a Linksys WRTU54G-TM. It's powered by Infineon ADM8668 processor (at 200 MHz) and has 64 MB RAM, which makes is pretty powerful router. Also it's really cheap. It looks like this:
The problem with this router is that there was no cool open source software for it. Linksys opened its sources, but I meant something like DD-WRT or OpenWRT. The problem is that the CPU architecture is different from for example the widely known and used WRT54G series.
Nonetheless there was some heavy work done to run a custom Linux firmware on it. After some successes, the author decided to port OpenWRT distribution to this router. And this is how it's done :-).
The OpenWRT is a command-line distribution of Linux for a bunch of routers. There is a web interface called X-Wrt which is installable as a opkg package to the OpenWRT systems, but there is no real information of how to install it on specifically WRTU54G-TM.
The good news is it can be done, the bad news is you have to hack it a little (but only very little). So let's go.
First, you need to "update" the software of the router to the OpenWRT version. The reference here is: http://wiki.scottn.us/wrtu54g-tm. Just log in to the router WWW interface, select Administration » Firmware Upgrade and choose this file wrtu54g-tm-openwrt-devel-b5.bin (download it from http://wrt.scottn.us/wrtu54g-tm-openwrt-devel-b5.bin).
This takes a while. Router then reboots. Give it a few minutes to load and install. After that the power LED keeps blinking which is probably a bug (in the official firmware, the LED blinks while the system is loading, but once it's up it lights still).
Connect to one of 4 Ethernet ports and you should be given an address IP in the 192.168.1.* network. If not, assign yourself one (for example 192.168.1.10). Then you can confirm the router is up, by pinging it:
ping 192.168.1.1
Trying to ssh to it will reveal you can't really do it, since you don't know the root password. This is tricky, but you need telnet to the router:
telnet 192.168.1.1
You'll be given the root shell. Set the password:
passwd
You'll need to enter the password twice for confirmation. Don't forget it :-).
Now you can ssh to the router:
ssh root@192.168.1.1
Deal with the RSA "host not known" warnings etc, and supply the password you just set.
If you connected the router to the network (by Ethernet cable to the "Internet" port) and your ISP has DHCP server, you should already have the Internet connectiong:
ping google.com
If you need to supply the static IP address, edit the following file:
/etc/config/network
You can use vim (busybox version) editor:
vim /etc/config/network
wan network corresponds to the Internet connection, while lan to the 4-port switch.
In this scenario it's possible you also have to supply the DNS servers, so instead of checking the Internet connectivity by pinging google.com, ping some IP address, like:
ping 8.8.8.8
Once you have the Internet connection, you can update the packages repositories, so you can install the X-Wrt interface:
mv /etc/opkg.conf /etc/original.opkg.conf
cat > /etc/opkg.conf
Enter the following:
src/gz adm8668 http://wrt.scottn.us/packages
src/gz snapshots http://downloads.openwrt.org/snapshots/trunk/brcm47xx/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
arch all 5
arch brcm47xx 10
arch adm8668 20
… and press Ctrl-D. Your /etc/opkg.conf file should now contain the lines above. Update the repositories:
opkg update
Install the X-Wrt, which is packed in package named webif:
opkg install webif
Now if you point your web browser to http://192.168.1.1/ you should have a poor 404 page. It seems the permissions of the /www directory are wrong. I just did that to fix the problem:
chmod -R a+rX /www
/etc/init.d/uhttpd restart
Now you can log to the Web interface in with your login (root) and password.
You can now play with the router settings using the browser :-). Much simpler.
References:
http://wiki.scottn.us/wrtu54g-tm
http://wiki.openwrt.org/doc/start
Comments: 3
Ubuntu 11.04 Beta 1
tags: dev fail linux ubuntu
08 Apr 2011 21:05
Let's talk about Ubuntu 11.04 Beta 1. Honestly I don't think it really should be beta already. It just doesn't work for me. I think the only reason the "release" is called beta is that it's April already and the stable version of the system should be delivered to the end of it to justify the 11.04 name/version.
Let's start from the beginning. I'm having a Sony Vaio laptop with dual graphics system. During boot I can switch if nVidia or Intel graphics card is used. While on nVidia card, I didn't encounter any problems but the thing in "Extra Drivers" no nVidia card was detected. I'm not sure, maybe this "automatic" 3rd party driver installation is only activated after a real install.
I really wanted to see the new Ubuntu interface, so I switched to Intel graphics card and rebooted the machine. After a while I was able to "Try Ubuntu", I started the Firefox and then I noticed I don't have a network connection configured, so I clicked the network manager icon, chose my wifi network and tried to enter the password, but this caused compiz to close unexpectedly. Multiple times. After I managed to click "cancel" button the window decorations were gone and keyboard focus was not passed to clicked field, which made my system unusable. The standard shortcut to run command in Ubuntu: Alt-F2 didn't work either.
This was a pretty short test, but not passed at all. Ubuntu 11.04 doesn't deserve beta status, there are stability issues. For example trying to suspend the laptop in nVidia mode (without any commercial drivers) froze it instead so i had to reboot :-(.
Comments: 0
Sony Vaio VGN-SZ640 Ubuntu Maverick
tags: linux maverick sony ubuntu vaio
04 Nov 2010 20:21
Recently I updated the Ubuntu I'm using on my laptop to version 10.10 (codename Maverick).
Although things work pretty good, I had to do some tricks to make it work in specific areas.
Broken suspend
It seems tpm* modules (who knows what they are for?) break this. Putting file like this:
# With these modules loaded suspend doesn't work
blacklist tpm
blacklist tpm_bios
blacklist tpm_tis
blacklist tpm_infineon
to /etc/modprobe.d/blacklist-tpm.conf (and rebooting) solves the problem for me.
Brightness buttons not working
Run this code in terminal:
while true; do
line=`acpi_listen | head -n 1`;
if echo "$line" | grep 'sony/hotkey SPIC 00000001 00000010'; then
xbacklight -dec 25 -time 0 -steps 1
smartdimmer -d
fi
if echo "$line" | grep 'sony/hotkey SPIC 00000001 00000011'; then
xbacklight -inc 25 -time 0 -steps 1
smartdimmer -i
fi
done
You need to have smartdimmer and xbacklight package. The keys kind of work now (but quite lamely).
Other stuff
The Ubuntu font is great. I love it. It seems nouveaux driver (for nVidia card) is really good. It supports multi-monitor configuration via xrandr and other standard stuff. Unfortunately you won't get 3D effects (Compiz) with it and you'll need to install nVidia commercial drivers for it.
Consult Sony Vaio SZ Series And Linux for more (mostly old) information.
Comments: 1
Playing Unreal Tournament On Ubuntu Lucid
tags: linux tournament unreal
17 May 2010 07:16
I wanted to play Unreal Tournament on Ubuntu 10.04 (Lucid Lynx) 64-bit. Linux is theoretically supported by Unreal Tournament, by using custom installer. So this is how to do it:
Get Unreal Tournament
The most likely version to obtain is UT GOTY (Game Of The Year edition).
Get Installer
Go here:
http://www.liflg.org/?catid=6&gameid=51
There are two installers. Download both using BitTorrent client. For me the one witout "goty" worked.
Run installer like this:
sudo bash /path/to/unreal.tournament_436-multilanguage.run
Probably it won't run, because you don't have GTK 1.2. Bad news, GTK 1.2 isn't even available in system repository. The last Ubuntu version that shipped GTK 1.2 was Ubuntu Jaunty. My favorite trick to get packages from older distros is as follows:
sudo sed s/lucid/jaunty/g /etc/apt/sources.list -i
sudo aptitude update
sudo aptitude install -y libgtk1.2
sudo sed s/jaunty/lucid/g /etc/apt/sources.list -i
sudo aptitude update
Try to run the installer, it should work now.
Default options are generally OK, so you can keep them. Once "enter CD" dialog appears, you need to either enter the CD or mount the ISO image using the following command:
sudo mount /path/to/the/iso-file.iso /media/cdrom
Click OK, and the installer continues to run. If you're asked to enter CD2 and you don't have one, try the second installer (the one without "goty") from loki site.
Running UT
I had no luck in running UT:
quake@vaio ~ $ ut
Signal: SIGIOT [iot trap]
Aborting.
From this thread I've learned it could be solved by doing this:
cd /usr/local/games/ut/System
for i in ../Maps/*.uz ; do sudo ./ucc-bin decompress $i ; done
mv *.unr ../Maps
After doing this, you should be able, to run ut successfully.
Changing resolution
I was not able to change resolution (once I changed it, it was going back to 640x480 after a few seconds). Open file ~/.loki/ut/System/UnrealTournament.ini, locate "640" and "480" in it and change to desired resolution.
High speed
When I run UT it seemed going about 5 times faster than it should. After reading much about -cpuspeed option and playing with CPU downclocking I figured out that without sound it runs OK. After some experimenting it seems, that it's pulseaudio is causing it, once I killed it and prevented to run (it auto-respawns for some reason) UT finally worked at good speed.
sudo chmod -x /usr/bin/pulseaudio
killall pulseaudio
ut
The problem with this is that some process continuously tries to run pulseaudio, which causes CPU to be loaded and ut to run not smoothly.
So this should work:
sudo mv /usr/bin/pulseaudio /usr/bin/pulseaudio.original
echo -e '#!/bin/bash\nsleep 10000' | sudo tee /usr/bin/pulseaudio
sudo chmod +x /usr/bin/pulseaudio
killall pulseaudio
ut
Remember to do this after playing ut:
sudo mv /usr/bin/pulseaudio.original /usr/bin/pulseaudio
If you have some problems with sound after playing UT, log out and in again, and it should be OK.
NOTE: this trick should be equivalent to running pasuspender ut, but for some reason it does not work.
More tricks
When playing on LAN party we discovered more tricks:
To let UT correctly determine CPU speed, you need to set CPU frequency (using some applet or cpufrequtils) and disable additional cores (leaving one):
echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu2/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu3/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu4/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu5/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu6/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu7/online
(if you have 8 cores, cpu0 will be online, the rest offline).
Next trick is disabling desktop effects or window composing. For one person this meant much smoother graphics, for other it meant working sound (which is very weird, but yes, that's true).
UPDATE: Maverick Audio
It seems that on maverick the pulseaudio hack is not working, but here's what you can do instead:
- edit /usr/local/bin/ut (may be located somewhere else, find when you installed the game)
- find this line: ./$GAME_BINARY "$CMD_ARGS" "$@"
- replace with: padsp ./$GAME_BINARY "$CMD_ARGS" "$@"
- (make sure you have the padsp binary, just run try to run it)
- then just run ut and sound works :-)
UPDATE: this works, but gives significant audio lags (200-300 ms!). This basically sucks. So the other workaround is:
- having alsa-oss installed (program aoss)
- having a proper .asoundrc in home directory:
ctl.!default {
type hw
card 0
}
pcm.dmixer { #this virtual device does the mixing of
type dmix #the various signals
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}
pcm.!default { #this means that applications use the mixer
type plug #by default, so you can hear everything
slave.pcm "dmixer"
}
- having 32 bit alsa-oss libs installed (getlibs -p alsa-oss)
You need /usr/lib32/libaoss.so. Once you have it backup /usr/lib/libaoss.so and link it to the 32 bit version: /usr/lib32/libaoss.so. Then edit the ut script like before but instead of padsp use aoss. This works for me. WARNING: this overrides all ALSA applications. If you want the default configuration (that routes the audio to pulseaudio), you'll need to change .asoundrc file name after playing UT.