Saturday, October 18, 2008

Using udev to connect my phone

I want to use udev to recognise my mobile phone and then have a script run which puts all my Podcasts onto the phone.

When I connect the phone, I get the following from dmesg
usb 5-2: new full speed USB device using uhci_hcd and address 2
usb 5-2: configuration #1 chosen from 1 choice
usb 5-2: New USB device found, idVendor=22b8, idProduct=6410
usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 5-2: Product: Motorola Phone (RAZRV3xx)
usb 5-2: Manufacturer: Motorola Inc.
usb 5-2: SerialNumber: 615044B60B0909
Initializing USB Mass Storage driver...
scsi4 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.


Which unfortunately does not tell me what /dev/ is being used.

I know the phone was mounted as /mount/disk, so I use the following:
mount | grep disk
/dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500)

OK, so I know the phone is mounted on /dev/sdb, partition 1

udevinfo -q path -n /dev/sdb1
/devices/pci0000:00/0000:00:1d.3/usb5/5-2/5-2:1.0/host4/target4:0:0/4:0:0:0/block/sdb/sdb1

The udevinfo tells me to look at
/sys/block/sdb/sdb1
to get more info about the phone

Or use udevinfo to get a nice formatted output
udevinfo -a -p /block/sdb/sdb1 | more

In /etc/udev/rules.d I created the file
10-udev-default.rules

in this file I added the rule
KERNEL=="sd[a-z]1", BUS=="scsi", SYSFS{vendor}=="Motorola", SYSFS{model}=="RAZRV3xx", NAME="%k", SYMLINK="/razr"

My /etc/fstab is updated with
/dev/sdb1 /media/razr vfat defaults 0 0


Thats the first part over.... to be continued

Getting the driver for my Nova DVB-S2 card

The best page to describe DVB-S2 support in Linux I found was at:
http://linuxtv.org/wiki/index.php/S2API

The S2 support is via an API called S2API. This replaced multiproto (although I found links out there at present telling you to use multiproto).

Kernal 2.6.28 should have the S2API included, but since I can't wait for that I will try to load it via the development repository at
http://linuxtv.org/hg/~stoth/s2

My card (the Nova S2) is also called Hauppauge_WinTV-HVR-4000Lite DVB-S/S2 PCI (also known as the S2 Lite). This is supported by S2API.

To get the driver software, it is required to install mercurial version control software.
This is described at:
http://www.linuxtv.org/wiki/index.php/How_to_install_DVB_device_drivers

I downloaded software via the command
hg clone http://linuxtv.org/hg/~stoth/s2
cd s2
hg update

I have to contine with this by copying the s2 directory to my Myth box and then compiling it there.



This is the best link I found:

http://linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-4000