Lot of DIY stuffs to do, so litte time, and waiting for holidays

Ok, my english exam is over .. waiting for the final result

I had a lot of stuffs on the way right now, so I hope to have the time to finish them before going on holidays here a little list:

  • A subwoofer (with a big 12″ woofer that goes damn low !
  • A subwoofer amp, this is the most hardest part, cause I need to build a mixer, a bandwith filter, and something like a 100W amp.
  • Finish a little test with my AVR32 (more to come on this way soon)
  • Repair my current HIFI system (restore some HP, even if I bought a low cost one to wait)
  • Start my new tube amp (sitll waiting for some big inductors ..)

So, I think i will be busy on my holidays :)

Perhaps, I will re-do this website design too, cause I want re-order some stuff, change the color scheme (cause borring right now) …

Sodium sucks / I still perfer Neon signs !

I’m currently a bit off of my desk right now, cause I need to study for a english test. But, while wasting some time, I came thought some mailing list posts.. and found a really interesting collections of light bulbs..

http://bulbcollector.com/cgi-bin/ImageFolio31/imageLeech.cgi?source=IF&ct=1182373366&file=/Gas_Discharge_Lamps/Neon/Aerolux/Emblems/ne0057.jpg
http://bulbcollector.com/cgi-bin/ImageFolio31/imageLeech.cgi?source=IF&ct=1182373847&file=/Gas_Discharge_Lamps/Neon/Aerolux/Flowers/ne0048.jpg

This stuffs are really nice, you can find the whole collection on the antique light bulbcollector.

This remind me a bit the mad scientist light.

I know a little shop here in my town, that sells this kind of light bulbs (the Neon ones). The mad scientist bulbs doesn’t exist here in France, I’m unable to find one.

Ok, now I know where I should go for my next free time.

Enjoy light of the town ?

My New Cheap GSM / Voip wifi Phone (Twin v2)

Everybody have a mobile phone right now, and me too :) I just bought a nice little phone from my DSL provider. They offer a good deal for new users like me: Free phone when you call wired phone (or SIP) thought a Wifi connection, and pay at normal rate when you use the GSM bands. That’s fine for me cause, I just want to use a little, and the phone itself cost only 50Euros !!

The phone itself is pretty nice, use Linux (yes !! kernel 2.6.10 inside ) and can be hacked: http://opentwin.org/

http://jkx.larsen-b.com/photos/Electronic/twin1.sized.jpg
http://jkx.larsen-b.com/photos/Electronic/twin2.sized.jpg

You can use it to surf quite well. Opera does a really good job, and you can even watch TV for free.. This phone is a good piece of stuff for the price.

Hum, I ‘m guessing you will see some new post about Asterisk or other fun stuff here soon ;)

/Enjoy VoIP

Fonera SD Card Hack

I read on several websites, that some people managed to wire a SD Card (or a MMC) to a Fonera access point. After a little googling, I discover this can be done easily, so I decided to test.. but I run into one issue so I decided to describe the process here.

Here the finished result:

http://jkx.larsen-b.com/photos/Electronic/DSC02577.sized.jpg

Let’s give it a try:

Solder the SD Card

The first step, is to locate the SW pins (near the antenna).. simply solder some wires like this:

SD Car      -----    Fonera
DO  (pin 7)          SW1
CLK (pin 5)          SW2
DI  (pin 2)          SW5
CS  (pin 1)          SW6
Gnd (pin 3)          Gnd
Vcc (pin 4)          Vcc

Here you can see the SD Card pinouts

http://jkx.larsen-b.com/photos/Electronic/DSC02584_2.sized.jpg

You can solder the VCC, and Gnd on the serial pins.

Unsolder the Caps

In my first tests, I discovered the SD card is detected, so I checked the signals. And discover the clk isn’t really clear.. So I decided to remove the capacitor on the SPI bus. (C142, C143, C144, C145)

http://jkx.larsen-b.com/photos/Electronic/DSC02582.sized.jpg

Install software and test

Next we need to install the kernel module on OpenWRT. You can find it on the Phrozen website . Simply ipkg install the file and it should be ok. Now, let’s try: insert a SD Card, and reboot, you should see something like this in your log.

Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : MMC Driver for Fonera Version 2.5 (050507) -- '2B|!2B' (john@phrozen.org)
Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : Card Found
Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : card in op mode
Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : SIZE : 241, nMUL : 6, COUNT : 1932, NAME : 256MB
Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : Card Initialised
Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : The inserted card has a capacity of 253231104 Bytes
Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : adding disk
Jan  1 00:00:49 OpenWrt user.info kernel:  mmc1
Jan  1 00:00:49 OpenWrt user.warn kernel: mmc : Card was Found

So now you can mount it:

mount /dev/mmc0 /mnt

This stuff, is working really well, I managed to have around 150Ko/s (reading) which is far enough for my needs. The only issue right now, is that you need to carefully umount the card before removing it, otherwise the fonera will crash.

Enjoy Fonera ??

How to convert matroska MKV to AVI on Linux ?

Today, I discover that my M3100 player doesn’t know how to play Mastroka files. Mastroka files are really kool since the subtitles are embeded in .. but that’s it, my player refuse to play open it.

This stuff can be repack in a AVI (xivd..) file with some open source tools. Here, a little script to do the hard stuff ;)

You can find the script here : http://svn.pythonfr.org/public/pythonfr/utils/video/mkv2avi.py

#!/usr/bin/python
# Little script to depack Matroska file, and repack them
# in a AVI + subtitle format.

import sys
import os

def message(msg):
    print "=" * 78
    print "= %s" % msg
    print "=" * 78

def usage():
    print "Mastroka repacker script"
    print "  Usage: "+sys.argv[0]+ " filename"

if __name__ == "__main__":
    if len(sys.argv) < 2:
       usage()
    else:
       filename = sys.argv[1]
       basename = filename[:-4]
       message("Unpacking file: %s" % filename)
       os.system("mkvextract tracks %s 1:temp_video.avi 2:temp_audio.ogg 3:%s.srt" % (filename,basename) )

       message("Repacking file: %s.avi" % basename)
       os.system("ffmpeg -i temp_audio.ogg  -i temp_video.avi  -vcodec copy  %s.avi" % (basename) )

       message("Cleaning files")
       os.system("rm temp_video.avi temp_audio.ogg")

/Enjoy Video

Howto recover wrong fuses settings on a AVR

Yesterday, I ran into a issue with an ATMega32. In fact, I wanted to disable the Jtag support on the chips because I need to use the pins used by the Jtag (PC2-PC5). To disable the Jtag, you simply need to change some fuses. I changed the fuses with the help of the Avr Fuse Calculator, but I messed my ATMega with the wrong clock source. I don’t know how, but I choose the low freq clock. So my ATMega was totally frozen, as the clock settings was wrong, I was unable to reflash it, and worst, unable to change the fuses.

After a little googling, I found there is 3 ways to fixe this kind of issue:

  • Use a Jtag (as it doesn’t need a clocked micro)
  • Use a high voltage programmer (you can erase the fuse, with a programmer that do a parallel programming with RESET plug to a 12v PSU). This kind of programmer aren’t really easy to find. The only one I know right now is the STK500
  • Use an external clock (This is what I used, and describe here)

As, I don’t have any Jtag, or STK500, the only way to fix that is to use an external clock. In fact, I decided to ask on the #avr channel on freenode. And a really kool guy (“rue_mohr”) give me this tips. On every AVR micro, you can use a external clock if you messed the fuses settings. Simply plug a external clock on the clock pin (XTAL1 on the Mega32), and changes the fuses by this way.

Of course, you need a external clock at something like 1Mhz. Of course I don’t have this kind generator at home, but this can be easily done with another AVR micro this something like this:

void main()
{
  DDRA = 0xFF;
  while (1)
  {
     PORTA = ~PINA;
     nop();  // added some nop, to slow the clock a bit
     nop();
   }
}

Hello Technorati

Hum, this is a little post to announce that this website is now rated by Technorati. Hum, I mean I want to play with this stuff :) Perhaps, I will drop this soon, who know..

So, here is my Technorati Profile

Media Player (Dvico 3100) + Netgear WGT634U = Cheap Wifi Media Player

This year, for my birthday I have a very nice Media Player M3100. This stuff is really usefull, no need to use a noisy computer to watch recorded Divx. It’s pretty kool to watch films from beds you know..

The only issue: I need to take it back to my computer when I want to upload a new film, that’s it .. When I first received this gift, I went back to the shop to exchange it against a networked one. But 1) they cost a lot more money, 2) not available at the shop. (even if it’s a really big one).

Last week, somebody sent me a mail. He found some cheap wireless access point with a USB port: Netgear WGT634U. (50Euro) Hum, ok let’s give it a try. First test, plug a Media Player to this USB port… ok It’s working fine. But you know, I don’t have a network cable near my bed, so I decided to transform the Access Point in a Wireless client. By this way, I can simply plug the Media Player on the WGT634U and remotely put some Divx via FTP, without any wire.

Step 1 / Install OpenWRT

The default firmware on the WGT634 doesn’t support wireless client mode (It’s a AP). So I switched it to OpenWRT Kamikaze. I build the firmware from source, but the kamikaze snapshot shoud work too. I followed the OpenWRT guide step by step with a external serial plug. You can find the complete howto for the serial connection here

# hit Ctrl-C on the bootloader
CFE> ifconfig eth0 -auto
CFE> flash -noheader tftp_host:openwrt-wgt634u.bin flash0.os
CFE> reboot

The first boot is a bit long, but all is fine…

Step 2 / Install tools

Here the short list of needed tools:

  • kmod-usb2
  • kmod-usb-storage
  • kmod-vfat
  • kmod-nls-base, kmod-nls-cp437, kmod-nls-iso8859-1
  • pure-ftpd

with a simple ipkg install via the serial console

Step 3 / Configure OpenWRT in wireless client

This is really simple in kamikaze, only change some files:

The wireless config file need to be tweaked, as I want it to join my MyDummySSID network

/etc/config/wireless

config wifi-iface
option device   wifi0
option network  lan
option mode     sta
option ssid     MyDummySSID
option hidden   0
option encryption none

Let’s go for the network config: MyDummySSID Access Point is 192.168.3.0/24, gateway in 3.1 and local DNS server is 1.254

/etc/config/network

#### LAN configuration
config interface lan
option type     bridge
option ifname   "eth0.0"
option proto    'static'
option ipaddr   '192.168.3.2'
option netmask  '255.255.255.0'
option gateway  '192.168.3.1'
option dns      '192.168.1.254'

First test: ifdown wan (switch off network) / ifdown br-lan / ifup br-lan

Step 4 / Firewall

Ok that’s fine, but I want to restrict the access to my local network only.. so I need to hack the firewall a little to avoid remote access from other wireless clients (my wireless network is open you know..). Simply linked this little script in /etc/rc.d/

/opt/ftp-firewall

#!/bin/sh

# clear all firewall rules
for T in filter nat mangle ; do
iptables -t $T -F
iptables -t $T -X
done

# drop incomming packet
iptables -P FORWARD ACCEPT
iptables -P OUTPUT  ACCEPT
iptables -P INPUT   DROP

# accept traffic on localhost
iptables -A INPUT -p tcp -i lo -j ACCEPT
iptables -A INPUT -p udp -i lo -j ACCEPT

# accept ftp only from my home network
iptables -A INPUT -s 192.168.1.0/24 -p tcp -i br-lan --dport 21 -j ACCEPT

# accept incoming http / ssh
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

# finaly accept already open Cnx
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Step 5 / Misc

After some tests, I discover that I need a way to know if the WGT634U managed to join the wireless network or no. So I added this little script, that check for the wireless BSSID, and turn the power led in yellow if something goes wrong .. this is really usefull in fact.

/opt/led-daemon

#!/bin/sh

while true
do
{
STATE=$(iwconfig ath0 |grep  00:13:13:53:DA:D1 | wc -l)
[ $STATE -eq 1 ] && echo 0 > /proc/diag/led/power
[ $STATE -eq 0 ] && echo 1 > /proc/diag/led/power
sleep 20
}
done

Foo

Step 6 / Finally

Here the result:

http://jkx.larsen-b.com/photos/Electronic/DSC02573.sized.jpg

The finished product (grrr) works really fine and managed to achieve something like 850Ko/sec, I mean full speed ;) (11Mbs network) I need to remove the serial port right now, and close the box..

Important update

I read on Engadget that I use this to stream video to my TV, (like the Apple TV do), but this is absolutely wrong. This media player has a 320Go hard-drive. Why would stream film on this ? I just put it on that’s it :)

This is really amazing how people doesn’t read the article to see what I’ve done. It’s not the first time this happen in fact.

Here in France, most advanded users have some network TV from a long time, and this little boxes can play network stream (like the Apple TV) for a long time now. Beside you don’t pay for this service (rent for the boxes are included in DSL bill), the only issue is that you must have another computer to stream.

I guess nobody here (in France) would by a Apple TV, since we already have this kind of products for free for a long time. Look at a Freebox for example.

It’s time to watch a film :)

Howto hack USB port on a LG LAC-M6500R MP3 Player (CD/Radio/MP3 Player)

Some friends buy me a nice MP3 player for my car last year (birthday): LAC-M6500R

This stuff looks great and you can even plug a hard-drive. The main issue is that the firmware only support 999 files on a single USB device, so that’s enougth for ~4Go of MP3 but not more. So I decided to buy some USB sticks, it’s far more simple .. no external power supply, and just the room to place a quite large MP3 collection (simply buy 2/3 sticks and that rules)

http://jkx.larsen-b.com/photos/Electronic/DSC02235.sized.jpg

That’s ok, but hum, as you can see on this picture the USB plug is on the front panel. And that’s a mess, cause you have to unplugged it when you want to remove the front panel (some infamous guys already try to open my car 4 times..), or to put a CD in. Beside this is a gift, I decided to open it, and try add a external USB in the back. I think my friends will understand this: “If you can’t open it, you don’t own it” ..

First, I decided to open the front panel, to look how the USB plug is connected. As you can see on the aboves pictures, the USB power-supply come form the main board.

http://jkx.larsen-b.com/photos/Electronic/DSC02242.sized.jpg
http://jkx.larsen-b.com/photos/Electronic/DSC02541.sized.jpg

That’s fine.. We simply have to add take the power from the source ..

http://jkx.larsen-b.com/photos/Electronic/DSC02542.sized.jpg

When I look closely, I discover that the PSU provide 5.5v instead of 5.0v. The main reason, is that the front panel contain a small chips do the final regulation.. Ok, we can do the same ? :) I used a low drop 5.0v regulator: LP38691 with 2 small caps..

http://www.national.com/images/pf/LP38691/20126501.jpg

The final step, is to connect the data bus (DATA- / DATA+), this was really hard, because the front panel USB bus is connected to the main decoder board throught a small wire. As I’m not able to find the right plug, I decided to solder it on the board ..

http://jkx.larsen-b.com/photos/Electronic/DSC02553.sized.jpg

So we have something like this:

http://jkx.larsen-b.com/photos/Electronic/LG_gschm.png

The small PCB:

As you can see on this picture, on the left, there is the wires from the main board, and the 5.0v regulator. On the right the wire that goes to the decoder board, and the external new USB connector.

http://jkx.larsen-b.com/photos/Electronic/DSC02551.sized.jpg

Here the finished product:

http://jkx.larsen-b.com/photos/Electronic/DSC02558.sized.jpg

Ok, that’s fine, now, you can place this small board in system (there is a lot of room), and enjoy the external USB cable ;)

Dell Truemobile (D400/D410/D600..) wifi driver on Linux (BCM4309)

It’s time to get quit ndiswrapper to use something little more open. I decided to test the latest Broadcom bcm43xx driver on my Debian system. This seems to work fine, and is really simple to install (unlike ndiswrapper)

So, first build your kernel > 2.6.17) (I used a 2.6.19) with support for the bcm43xx enabled. “Device Driver/Network support/Wireless”. The next step is a little shorter, simply install bcm43xx-fwcutter (via apt-get of course). This will ask you if you want to download the required firmware, and of course you will answer yes.

Now, is time to reboot, and discover the results:

bcm43xx: Chip ID 0x4306, rev 0x3
bcm43xx: Number of cores: 5
bcm43xx: Core 0: ID 0x800, rev 0x4, vendor 0x4243, enabled
bcm43xx: Core 1: ID 0x812, rev 0x5, vendor 0x4243, disabled
bcm43xx: Core 2: ID 0x80d, rev 0x2, vendor 0x4243, enabled
bcm43xx: Core 3: ID 0x807, rev 0x2, vendor 0x4243, disabled
bcm43xx: Core 4: ID 0x804, rev 0x9, vendor 0x4243, enabled
bcm43xx: PHY connected
bcm43xx: Detected PHY: Version: 2, Type 2, Revision 2
bcm43xx: Detected Radio: ID: 2205017f (Manuf: 17f Ver: 2050 Rev: 2)
bcm43xx: PHY connected
bcm43xx: Microcode rev 0x127, pl 0xe (2005-04-18  02:36:27)
bcm43xx: Radio turned on
bcm43xx: Chip initialized
bcm43xx: 30-bit DMA initialized
bcm43xx: Keys cleared
bcm43xx: Selected 802.11 core (phytype 2)

Fine no ? this works really fine right now, but I need to do some extended check before.

Enjoy FakeMobile