Wednesday 18 July 2012

HOWTO: Compile OSCAM on Raspberry Pi, Dockstar or similar NAS running Debian

HOWTO: Compile OSCAM on Raspberry Pi, Dockstar or similar NAS running Debian


1. Preparations:

Update apt-list and install required packes:



Code:
apt-get update 
apt-get -y install apt-utils dialog usbutils
apt-get -y install gcc g++ wget
apt-get -y install build-essential subversion libpcsclite1 libpcsclite-dev
apt-get -y install libssl-dev cmake make 
apt-get -y install libusb-1.0-0-dev nano

If you need PCSC support:

Code:
apt-get install pcscd pcsc-tools


2. Get OSCAM source
Now switch to /usr/src, create a directory for oscam and download sources:


Code:
cd /usr/src
svn co http://www.oscam.to/svn/oscam/trunk oscam-svn

3. Compile OSCAM
Now compile oscam for your machine:

Code:
cd oscam-svn
mkdir build
chmod 755 build
cd build
cmake -DWEBIF=1 .. (those 2 dots are required. THIS IS IMPORTANT)
make

NOTE: If you get Errors while compiling e.g.

Code:
--   no libusb 1.0 found. No smartreader support
See the hint at the bottom before proceeding

Now we got our oscam binary
We're gonna move it to /var/local

Code:
cd /usr/src/oscam-svn/build
ls
there should be a file called "oscam"
So lets copy it:

Code:
cp oscam /var/local/
cd /var/local
chmod 755 oscam

4. Make OSCAM start at system startup:
We're adding oscam to rc.local to make it start at system boot.


Code:
nano /etc/rc.local
Now add

Code:
/var/local/oscam &
right above line

Code:
exit 0
Oscam will start everytime the system boots up from now on

5. configs and logfiles
We still need to get some config files.
By default oscam looks in /usr/local/etc for these file

Code:
cd /usr/local/etc
ls
There should be at least 3 files: oscam.user, oscam.server, oscam.conf
If not, copy your configs here

Now we need to create some logfiles and make them writable:


Code:
cd /var/local
mkdir oscam
chmod 755 oscam
cd oscam
mkdir cw
chmod 755 cw
nano oscamuser.log (enter a space and save file)
nano oscam.log (enter a space and save file)
chmod 755 oscamuser.log
chmod755 oscam.log
Thats it

6. Start oscam
You can now run oscam to check if it works

Code:
cd /var/local
./oscam


HINT: Oscam compile error: No smartreader support:
If you get Errors while compiling e.g.

Code:
--   no libusb 1.0 found. No smartreader support
go to /usr/src, get libusb 1.0.6 from sourceforge and compile for your system:

Code:
cd /usr/src/
mkdir libusb
chmod 755 libusb
cd libusb
wget http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.6/libusb-1.0.6.tar.bz2
tar xjf libusb-1.0.6.tar.bz2
make
install
 
After make install of libusb, start over with compiling oscam

No comments:

Post a Comment