Oscam server from scratch with Raspberry Pi
This guide assumes you have a Windows PC for downloading the image and transferring it to a correctly formatted SD card.
Items needed;
Raspberry Pi with power supply connected to the network.
SD card (suggested minimum 4GB) with Raspbian “wheezy” (can use other flavours or modifications but you might need to install more packages).
Either a SSH client connected to the network, or Input device direct to the Raspberry Pi connected to a display.
If you have not got an SD card preinstalled with Raspbian, then I would suggest the following.
SD card format tool.
Unpack and install.
Disk imaging tool
Unpack.
Insert SD card and format the card with SDformatter, ensuring that you turn format size adjustment on.
Download the raspbian "wheezy" image from;
Scroll down about halfway for the Raspbian Wheezy image and select torrent or direct download.
Unpack image.
Run Win32DiskImager.exe - I get an error message but I ignore it and it works.
Ensure the letter underneath where it says 'Device' is the same as your SD card.
Click the blue folder icon at the top right of the Win32DiskImager.exe app - and browse for the raspbian wheezy image.
When you are happy that you have found the file and you have selected the right device, click 'Write', and 'Yes' to confirm.
Once you get the 'Write Successful" message then you can go to the next stage.
Insert the SD card in your Raspberry Pi, turn on and wait a couple of minutes.
If you are connecting remotely using SSH, then you need to find the IP address of the Raspberry Pi.
You are best doing this anyway because you need to fix the IP address, usually you can do this in your router, the method depends on your router.
You can also do this direct on the Raspberry Pi if you have an imput device and the Rpi is connected to a display.
If you are connected to a display then the raspi-config will auto run on first boot, you can set timezone, etc.
I would suggest changing the memory split if you are using this as a dedicated Oscam server and nothing else - so that only 16mb is alocated to VideoCore.
To do this from an SSH client, then log in as user 'pi' and password 'raspberry' - and then do;
after you have changed the settings to how you want (I at this stage have only set timezone and memory split), then finish and reboot.
Once it reboots then log in as 'pi' and 'raspberry' again
Enable root password;
Then enter preferred password twice.
log out as current user.
Log in as 'root' using your chosen password.
Now we are ready to compile Oscam.
Thanks to the respective authors for guides on how to do this ('dui' for getting the info from another forum and 'pr2' for tweaking it) - but I want to put a clear one together for the benefit of all.
For the sake of this, we are going to compile Oscam with Smartreader and PCSC Support.
First, you need to get your packages;
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
apt-get install pcscd pcsc-tools
Then create the following symbolic link so Smartreader support is added during the compile;
Get the Oscam sources;
Compile Oscam (note the two dots after the 5th line are there because they need to be).
cd oscam-svn
mkdir build
chmod 755 build
cd build
cmake -DHAVE_LIBUSB=1 -DHAVE_PCSC=1 -DWEBIF=1 -DHAVE_LIBCRYPTO=1 -DWITH_SSL=1 ..
make
Make yourself a coffee - you have a bit of time and deserve one!
Now it is installed - we need to move it;
and move the list_smargo tool;
They are both now in /var/local - now we need to change permissions;
Now oscam needs to start at boot by adding it to rc.local, and you can edit with nano;
arrow down to a line just above 'exit 0' and below 'fi', and add the following;
To save, exit with 'CTRL' and 'x' - select 'y' and 'enter'.
Oscam will now run at boot.
To get it to restart daily at 5.45 am and to free memory every hour, edit the crontab file;
add the following two new lines;
and to save, exit with 'CTRL' and 'x' - select 'y' and 'enter'.
I won't go on about log files here because Oscam runs without them, and can be added later if you need them. Your config files (oscam.conf, oscam.user and oscam.server) go in /usr/local/etc
If you want, you can now delete the sources, which are found in /usr/src - just delete the oscam.svn folder.
you need to forward the port to the internal IP address of your Raspberry pi - this should have been fixed in your router as I went over earlier on, alternatively edit the /etc/network/interfaces file. Take care in doing this if you haven't got an input device and display for your Raspberry Pi as if you set this wrong then you will have no means to connect to your device. See the following for more info on this
From this point, I prefer to use an scp client to edit and add my config files. As a start - you can create an oscam.conf file in /usr/local/etc and add;
Save this.
Reboot your Raspberry Pi. You should now have Oscam running on reboot and you will be able to access the webinterface as well.
You can log on to webinterface locally on the Raspberry Pi if you use startx to run GUI and after running a web browser, use;
or from a remote computer by using the local IP address of the Raspberry Pi and port 8888 again
From this you can do all the setting up of your server - rather than add files to /usr/local/etc you can also cut and paste the info from your configs in the files section of webinterface if you prefer
This works with 2 Omnikey readers, one in each USB port and with a Hub, as tested by myself. For further info about card configs etc, this info is all over the forum so the search bar is your next step!
Enjoy!