Archive for July, 2006

ipw2100 wireless, WPA and Linux 2.6.17

Thursday, July 20th, 2006

I have a Thinkpad X31 with a build in ipw2100 wireless network adaptor. When i bought it (a long time ago) Linux did not support a lot of the hardware in it, so I ended up running Windows XP…

But, now I finally installed Linux and almost everything seems to be working. I did have problems with wireless and WPA-PSK authentication though. I used wpa_supplicant with the following configuration:
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
eapol_version=1
network={
ssid="myssid"
group=TKIP
pairwise=TKIP
key_mgmt=WPA-PSK
priority=5
proto=WPA
psk=psk generated with wpa_passphrase
}

When calling wpa_supplicant one of the arguments is the driver name. The help message says to use ipw for Intel ipw2100/2200 driver. So I did that… The output was:
ioctl[IPW_IOCTL_WPA_SUPPLICANT]: Operation not supported
ioctl[IPW_IOCTL_WPA_SUPPLICANT]: Operation not supported
Failed to set encryption.
ioctl[IPW_IOCTL_WPA_SUPPLICANT]: Operation not supported
Failed to set encryption.
ioctl[IPW_IOCTL_WPA_SUPPLICANT]: Operation not supported

etc… Google suggested that I was missing encryption modules, that the driver shipped with the kernel was buggy and other things. And then finally I found this link that sugested to use the generic wireless driver instead. I tried that, and:
# wpa_supplicant -Dwext -c/etc/wpa_supplicant.conf -i eth2
Trying to associate with 00:16:b6:5c:00:f1 (SSID='myap' freq=0 MHz)
Associated with 00:16:b6:5c:00:f1
WPA: Key negotiation completed with 00:16:b6:5c:00:f1 [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:16:b6:5c:00:f1 completed (auth) [id=0 id_str=]

it finally works!

With the following in /etc/network/interfaces the interface comes up automatically:
iface eth2 inet dhcp
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
auto eth2

Problem with PVR500, ivtv and Linux 2.6.17.3 solved!

Thursday, July 6th, 2006

After upgrading to Linux 2.6.17.3 and ivtv 0.7.0 my PVR500 card suddenly stopped working. It looked like the driver was loaded, but i could not read any data from /dev/video0.

When trying to read data from the device or trying to use ivtv-tune the following was logged by the kernel:

[68705.613937] ivtv0: i2c hardware 0x00000001 not found for command 0xc008561c!
[68705.613941] ivtv0: i2c addr 0x44 not found for command 0x4008646f!
[68705.613944] ivtv0: i2c hardware 0x00000020 not found for command 0x4008646d!
[68705.613947] ivtv0: i2c hardware 0x00000001 not found for command 0x4008646d!
[68705.613977] ivtv0: i2c hardware 0x00000001 not found for command 0xc008561c!
[68705.617982] ivtv0: i2c hardware 0x00000001 not found for command 0xc008561c!
[68705.618952] ivtv0: i2c hardware 0x00000001 not found for command 0xc008561c!

I read a lot of mailinglist posts suggesting that it meant that the card was broken etc… but finally I also saw the line:

[68705.887156] ivtv1: Failed to load module cx25840

and after some investigation found that this driver is no longer included in ivtv – it is now shipped as part of the Linux kernel. So i enabled the modules cx25840 and wm8775 in the kernel, and now my card works like a charm again.

DVB-T and Linux

Thursday, July 6th, 2006

I have a MediaCenter PC running Ubuntu Linux and MythTv. It works very well, and until now my TV input has been through a Hauppauge PVR 500 card.

I just added a Hauppauge Nova-T DVB-T card since it is now possible to receive DVB-T signals in Denmark.

It was fairly easy to get working once I had a good enought antenna.

The driver, cx8800, is included in the Linux kernel. I’m currently using 2.6.17.3 which gives me working DVB-T, but broke ivtv and my PVR500 card….

When the driver was loaded i tested the signal with the scan and tzap applications from the dvb-utils package. On www.digi-tv.dk i found that there is one transponder near Copenhagen and that the frequency is 714000000 hz.

The dvb-utils package comes with definition files for a lot of countries, but not for Denmark. I created one myself containing:
# Denmark - Copenhagen
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 714000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE

I saved the file as dk-Copenhagen and used the scan tool to look for channels:
$scan dk-Copenhagen
scanning dk-Copenhagen
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 714000000 0 2 9 3 1 3 0
>>> tune to:
714000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE
0x0000 0x0065: pmt_pid 0x0000 DigiTV -- DR1 (running)
0x0000 0x0066: pmt_pid 0x0000 DigiTV -- DR2 (running)
0x0000 0x0067: pmt_pid 0x0000 DigiTV -- Tegnsprogstolkning (running)
0x0000 0x00d9: pmt_pid 0x0000 DigiTV -- TV 2 (Lorry) (running)
Network Name 'Kbh. Vest'
dumping lists (4 services)
DR1:714000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:111:121:101
DR2:714000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:211:221:102
Tegnsprogstolkning:714000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:311:0:103
TV 2
(Lorry):714000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2111:2121:217
Done.

Which tells me it’s working! The output (not the first line) must be saved in a file called $HOME/.tzap/channels.conf and then the signal quality can be checked using the tzap command. E.g.
$ tzap DR1
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 714000000 Hz
video pid 0x006f, audio pid 0x0079
status 01 | signal 0030 | snr 8000 | ber 00003fff | unc 00000000 |
status 1f | signal 0031 | snr ffff | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 0031 | snr ffff | ber 00000000 | unc 00000000 | FE_HAS_LOCK

If you don’t get FE_HAS_LOCK you need to adjust the antenna. If you do get locked on to a signal however, you should be able to play an mpeg stream with
dvbstream -o -ps -qam 64 -cr 3_4 111 121 | mplayer -
where 111 and 121 are the video and audio pid found as third and second last values on the channels line in channels.conf