SD15 Antenna at Home

Yes, I added a new SD15 at home

http://www.brest-wireless.net/albums/Node_Jkx/dsc01170_003.sized.jpg

Check out this if you want some photos

Homemade Wifi Antenna ?

I never do that before, but some guys give me this really fancy antenna.

http://www.brest-wireless.net/albums/AntenneCornet/cornet_usam_1.sized.jpg
http://www.brest-wireless.net/albums/AntenneCornet/cornet_usam_2.sized.jpg

Check out Brest Wireless photo album for more infos

Update: I tested this last night. In fact the gain of this beautifull antenna
is around 17dB. Yes ! 17dB for a homemade antenna is pretty high, no ? I really like this stuff

Update 2: Please check other post for additionnal infos about homemade antennas

– Enjoy wireless at home ;)

Glade-2 to .py

In a past life, I spent a lot of time with gtk-1 and glade (for a commercial app). After this experience, I tested several approach:

  • PyQT (using QTDesigner)
  • wxPython (w/ wxGlade)
  • Glade 2 + libglade

Here is my personnal feeling:

  • PyQT, is really great. But I really don’t like the licence. And since I work in a school, using this kind of licence with students is bad idea
  • wxPython + wxGlade is a great tool too. But but as usuall w/ wxPython the generated code isn’t cross-platform friendly. (And on Linux, the look is really bad ..)
  • Glade is a simple, and effective, but using libglade (loading the .glade at startup) isn’t really my favorite approach.

In my past life, we used to build IHM w/ glade-1 and produce the python code from a little script. This is easy and efficient. (and a newbie can learn python-gtk easily). I have been looking for the same stuff in gtk2 for a while. And last day, I found the article Writing PyGTK applications in a visual way . This is exactly what I’m looking for! So big thanks Tigrux !

Ntp on a WRT54

Ok, everybody know ntp. But how can i use it on a linksys WRT54 to set up clock once.. without a decent man page ?

ntpclient -s -c 1 -h local-ntp-server.domain

Tsunami and Cisco

I have been a long time what a "tsunami" is. After recent news, I guess everybody know what this evil is about.

Do you think Cisco will still use "tsunami" as default for ESSID for their wireless products ? I haven’t a aironet card on my desk right now, but believe me, the default ESSID for access point, and wireless card made by Cisco is: tsunami.

Beside, this sound a pretty good name for a wireless product, I really believe it’s the worst to choose now.

If someone as a aironet card, perhaps he can post the default iwconfig result here.

Extract soundtrack (MP3) from DVD with mplayer

I ‘m wondering if i gonna add a mplayer tips here ? :)

To extract a mp3 from a DVD, the easy way is to use transcode

transcode -i /dev/dvd -x dvd -T 1,2,1 -a 0 -y raw -m track22.mp3

But sometimes, this doesn’t works.. in fact I get a random transcode segfault. As mplayer is the perfect video kniffe. I decided to test this w/ mplayer

mplayer -ao pcm dvd://1 -chapter 22

This won’t build a .mp3 but a big wave file, not matter lame is my friend anyways.

PS: The latest transcode should fix the issue, but I’m unable to build it on my debian. libavcodec2-dev is broken. (Wondering why i’m still using this distro … :(

– thanks #mplayer for the help (as usual)

OpenWRT Admin Tool in PHP

In a recent post, i described the build of Python for a WRT. I didn’t manage to finish this hack. So I decided to use a PHP interface. Here the first screenshot

http://jkx.larsen-b.com/photos/blog/open_wrt_admin.sized.jpg

Keyboard shortcut with Python-Xlib

I use this little script on another computer for a while. Meanly to remote drive my xmms throught the xmms python module. Anyway I just write this little intro here, perhaps other people may be interested..

This litte script use Xlib python module to grab keys. If the key is special key on my laptop, i use it to change the sound level. This is a short example, not a definitive app.

from Xlib.display import Display
from Xlib import X
import oss

# custom keys from my dell D400 Laptop
vol_plus  = 176
vol_moins = 174

keys = [vol_plus,vol_moins]

def changeVolume(aValue):
	mixer = oss.open_mixer()
	symbol = oss.SOUND_DEVICE_LABELS.index('Vol  ')
	left,right  = mixer.read_channel(symbol)

	avg = (left + right) / 2
	if (avg + aValue) >= 0:
		mixer.write_channel(symbol,(left + aValue,right + aValue))
	mixer.close()

def handle_event(aEvent):
	keycode = aEvent.detail
	if aEvent.type == X.KeyPress:
		if keycode == vol_moins:
			changeVolume(-2)
		elif keycode == vol_plus:
			changeVolume(+2)

def main():
	# current display
	disp = Display()
	root = disp.screen().root

	# we tell the X server we want to catch keyPress event
	root.change_attributes(event_mask = X.KeyPressMask)

	for keycode in keys:
		root.grab_key(keycode, X.AnyModifier, 1,X.GrabModeAsync, X.GrabModeAsync)

	while 1:
		event = root.display.next_event()
		handle_event(event)

if __name__ == '__main__':
	main()

As you can see, this is really trivial, and simple to hack XFree w/ python :)
I need to send special thanks to the python-Xlib author, because he does a great job, and he help me a lot the first time I hacked this.

Python on a WRT54GS ?

Ok, I ‘ve been off for a little time right now. The main reason, is that I spend some time hacking my new Wireless access point: WRT54GS.

I spend a lot of time tweaking the config to use this in client mode with dhcp thought the WAN port and other nuts. I spend some time on http://www.brest-wireless.org too. But this is the mean reason of this post :)

Some people would think I’m a crazy boy but this is perhaps true. I managed to cross-compile python for the WRT. If you ask me why, I would simply answer that there is a lot of network stuff on a WRT that can be writen in a couple of python lines: dhcpd, dns cache, http server, dynamic pages rendering, dynamic firewall rules (check out last posts ..), diagnostics tools .. That’s it, now we need to figure out if this is do-able :)

WRT use a broadcom misp processor, so we need:

  • to install a cross-compile environnement: Not to hard.
  • tweak the python Makefile to use this, a little more funny but it works.
  • first tests..

As you can imagine, this doesn’t work at all :) The main issue is that current python use g++ (2.3), and the WRT only came with uClib, not the uClib++. After this wrong experience, I decided to take a old python: 1.5.2 . This one only needs gcc fine ! Ok, let’s see the result:

telnet host50
Trying 192.168.1.50...
Connected to host50.soif.fr.
Escape character is '^]'.

BusyBox v1.00 (2004.11.20-09:17+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

@OpenWrt:/# /tmp/python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import exceptions' failed; use -v for traceback
Warning!  Falling back to string-based exceptions
'import site' failed; use -v for traceback
Python 1.5.2 (#2, Nov 21 2004, 05:52:09)  [GCC 3.2.3 with Broadcom modifications] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import sys
>>> import os
Traceback (innermost last):
File "<stdin>", line 1, in ?
ImportError: No module named os
>>>

As you can see on this little capture, some parts of the interpreter works, but other don’t. The main issue is the build of modules. Something goes wrong at the link (ld), and I was unable to fully compile this.

Anyway this is not a big issue, because right now, I don’t think python 1.5.2 is a great challenger anyways. For people interested the python exec does 1.6Mo but a WRT54GS has 6Mo of free ROM.

I would really enjoy to hear your comments about your experience w/ ‘embeded python’. I guess that java has this kind of cross-compile issue too, but java is ready for cellphones, or other stuffs. Why not python ?

Alternative Firmware for the WRT54GS

Ok, yes, I bought a new WRT54GS, this works quite fine. I ‘m able to do what i want with that stuff. I will explain in a future post how to use this stuff in a secure way without using WEP.

Here is the list of firmware to use on this little box:

  • The Official one (pretty nice, but doesn’t allow telnet over device )
  • Sveasoft (the infamous weaked GPL one)
  • EWRT (sveasoft + nocat -> hotspot)
  • Wifi-box (hum not tested yet)
  • openWRT (minimal setup without http)
  • MeshBoxKit (openWRT + OLSR, special for Meshing)

Look at Seattle wiki on WRT for more infos. Do you use another one ?