InternetDVB

From LinuxTVWiki
Revision as of 01:58, 30 August 2006 by Andiahdin (talk | contribs) (→‎DVB Packages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

HOWTO

This information about HOWTO setup DVB PCI Card for internet (tested with b2c2 chipset) using Ubuntu 5.10 Breezy Badger and Ubuntu 6.06 Dapper Drake.

Requirement

  • Processor Clock 800 Mhz
  • HDD
  • Memory 256Mb
  • Ethernet Card
  • DVB PCI Card (i used b2c2 from technisat http://www.technisat.com)


Fresh New Server

We need fresh server from ubuntu, so we have to install ubuntu in server mode. For detail instructions howto install in server mode see http://www.howtoforge.com/perfect_setup_ubuntu_5.10

if you don't like to be root, choose sudo or fakeroot ! i like to be root https://help.ubuntu.com/community/RootSudo

$ sudo passwd
$ su

put Ubuntu Install CD back into CDROM drive

as root

apt-get install build-essential


DVB Packages

get the packages from linuxtv.org linuxtv-dvb-apps-1.1.1.tar.gz

tar -zxvf linuxtv-dvb-apps-1.1.1.tar.gz

make it simple

mv linuxtv-dvb-apps-1.1.1 linuxtv

i have made my own patch for better display. linuxtv-dvb-apps-dvbnet.patch

patch and compile them all.

cd linuxtv
patch -p0 <linuxtv-dvb-apps-dvbnet.patch
make

if no error report copy all off them to /usr/local/bin

cp util/dvbnet/dvbnet /usr/local/bin
cp util/dvbtraffic/dvbtraffic /usr/local/bin
cp util/scan/scan /usr/local/bin
cp util/szap/szap /usr/local/bin
cp util/szap/femon /usr/local/bin
cp util/dvbdate/dvbdate /usr/local/bin

Testing

before we do some testing, we need this informations from satellite internet provider (DVB-S) :

  • Satellite band freq (c-band, ku-band)
  • Polarization
  • Frequency
  • Symbol rate
  • FEC
  • PID


my configurations is

  • Satellite Band freq = C-BAND
  • Frequency = 3680 Mhz
  • Polarization = Horizontal
  • Symbolrate = 26666 ksym/s
  • FEC = 3/4
  • PID = 4004
  • mkdir /root/.szap
  • cd /root/.szap


Testing : dvbnet

what we need here is PID (from dvb internet provider). for example our pid is 4004 (decimal)

dvbnet -p 4004

now you can see your new adapter dvb0_0

ifconfig dvb0_0

if you didn't see correct MAC address

ifconfig dvb0_0 hw ether "$YOUR_MAC_ADDRESS" 


Testing : scan

we are ready to scan the transponder now i assume that satellite dish is on the right pointing

cd /root/.szap
echo S 3680000 H 26666000 3/4 > sat.conf
scan -l c-band sat.conf

this will ok if no error message.


Testing : szap

this session will create our channels configuration (this is my configuration).

cd /root/.szap
echo myprovidername:3680:h:0:26666:0:0:7 > channels.conf

we will tune it now !!

szap -l c-band -n 1 

if you see "FE_HAS_LOCK" ... dvb card is tuned fine !

CTRL+C to stop it !

make it run as daemon

start-stop-daemon --start -q -b -x /usr/loca/bin/szap -- -l c-band -n 1  

from now, you can only check it by using femon

femon


Testing : dvbtraffic

testing data capability

dvbtraffic

you can also monitor internet packet at dvb0_0

tcpdump -i dvb0_0

you can also using iptraf


rc.d "init_dvb"

we will make it start automatic every times our pc is re-boot. we need this script init_dvb or get it from init_dvb and put it on /etc/init.d


#!/bin/sh
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# Nama file : init_dvb 
# Path      : /etc/init.d/
# Applikasi : intenet dvb 
# Linux     : Debian
# Homepage  : www.prima-info.com
# Author    : A. Ahdin
# email     : ahdin@telkom.net
#
# note :
# Create & Copy this to  /etc/init.d/ 
# execute  "update-rc.d init_dvb defaults"
# 
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

DEV_NAME=dvb0_0

IP_ADDR=169.254.255.29
NETMASK=255.255.0.0
BROADCAST=169.254.255.255
SZAP=/usr/local/bin/szap
DVBNET=/usr/local/bin/dvbnet

# put your DVB PID here (from your ISP)
PID=4004

# Leave it blank MAC_ADDRESS if want to use default mac address
# or modify it if you didn't see correct mac address  
# MAC_ADDR=00:01:02:03:04:05
MAC_ADDR= 

. /lib/lsb/init-functions
chk=`$DVBNET -l | grep dvb0_0`
hk=`ps ax | grep szap | grep -v grep | awk '{print $1}'`

load_szap () {
   sleep 1
   start-stop-daemon --start -q -b -x $SZAP -- -l c-band -n 1 -c /root/.szap/channels.conf
}

load_pid () {
  $DVBNET -P $PID 
  RET=$?
  sleep 1
  if [ "$RET" -gt 0 ] ; then 
        log_end_msg $RET
 	 echo   "   Error: Unable to create dvb0_0 ...!"
        exit 1;
  fi
}

unload_dvb () {
        ifconfig dvb0_0 down
        sleep 1
        $DVBNET -D 0 
        sleep 1
}

case "$1" in
start) 
        if [ -n "$chk" ] ; then
                log_begin_msg "Re-starting dvb..."
                unload_dvb
                load_pid
        fi

        if [ -z "$chk" ] ; then 
                log_begin_msg "Starting dvb..."
                load_pid
        fi

        if [ -z "$MAC_ADDR" ]; then
                ifconfig $DEV_NAME $IP_ADDR netmask $NETMASK broadcast $BROADCAST up
        else
                ifconfig $DEV_NAME $IP_ADDR netmask $NETMASK broadcast $BROADCAST hw ether $MAC_ADDR up
        fi

        if [ -n "$hk" ] ; then
                kill "$hk"
                load_szap
        fi
        if [ -z "$hk" ] ; then
                load_szap
        fi
                log_end_msg $?
;;
stop) log_begin_msg "Stopping dvb..."
  sleep 1
        if [ -n "$chk" ] ; then
                ifconfig dvb0_0 down
                unload_dvb
                sleep 1
        else 
                log_end_msg 1
                echo  "   Error: no such interface dvb0_0 ...!"
                exit 1
        fi

        if [ -n "$hk" ] ; then
                kill "$hk"
        fi

                log_end_msg $?
;;

*)  log_success_msg "****************************** *"
    log_success_msg "                               *"
    log_success_msg "  Usage: init_dvb start|stop   *"
    log_success_msg "                               *"
    log_success_msg "****************************** *"
  exit 1
;;
esac


don't forget to make it executable

chmod 755 /etc/init.d/init_dvb

link it to /usr/local/sbin

cd /etc/init.d/init_dvb
ln init_dvb /usr/local/sbin

make it stay on rc.d then reboot

update-rc.d init_dvb defaults
reboot


Links