Oscam server setup guide - Raspberry Pi from scratch.

There are 101 replies in this Thread which was already clicked 101,023 times. The last Post () by testowy.

  • 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.

    Code
    https://www.sdcard.org/downloads/formatter_3/


    Unpack and install.


    Disk imaging tool

    Code
    http://www.softpedia.com/get/CD-DVD-Tools/Data-CD-DVD-Burning/Win32-Disk-Imager.shtml


    Unpack.


    Insert SD card and format the card with SDformatter, ensuring that you turn format size adjustment on.


    Download the raspbian "wheezy" image from;

    Code
    http://www.raspberrypi.org/downloads


    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;

    Code
    sudo raspi-config


    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;

    Code
    sudo passwd root


    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;

    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
    apt-get install pcscd pcsc-tools


    Then create the following symbolic link so Smartreader support is added during the compile;

    Code
    ln -s /usr/lib/arm-linux-gnueabihf/libusb-1.0.a  /usr/local/lib/libusb-1.0.a


    Get the Oscam sources;

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


    Compile Oscam (note the two dots after the 5th line are there because they need to be).

    Code
    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;

    Code
    cd /usr/src/oscam-svn/build
    cp oscam /var/local/


    and move the list_smargo tool;

    Code
    cd /usr/src/oscam-svn/build/utils
    cp list_smargo /var/local/


    They are both now in /var/local - now we need to change permissions;

    Code
    cd /var/local
    chmod 755 oscam
    chmod 755 list_smargo


    Now oscam needs to start at boot by adding it to rc.local, and you can edit with nano;

    Code
    nano /etc/rc.local


    arrow down to a line just above 'exit 0' and below 'fi', and add the following;

    Code
    /var/local/oscam &


    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;

    Code
    nano /etc/crontab


    add the following two new lines;

    Code
    05 * * * * root echo 3 > /proc/sys/vm/drop_caches
    45 05 * * * root /sbin/reboot


    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


    Code
    http://wiki.debian.org/NetworkConfiguration


    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;

    Code
    [webif]
    httpport                      = 8888
    httprefresh                   = 5
    httpallowed                   = 127.0.0.1,192.168.0.0-192.168.255.255


    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;

    Code
    127.0.0.1:8888


    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!

    If I take a while to respond, you can see why.....


    :red:

  • Great tutorial.
    I think that I have setup the Pi correctly to run oscam. I only have oscam.config and oscam.server in usr/local/etc. Is this correct.
    Thanks in advance.


    There are a number of config files you could have in usr/local/etc


    oscam.conf is the most important because with this you can activate the webinterface by adding the following;


    Code
    [webif]
    httpport                      = 8888
    httprefresh                   = 5
    httpallowed                   = 127.0.0.1,192.168.0.0-255.255.255.255


    that way you can either access the oscam webinterface from a web browser either on the raspberry pi gui http://127.0.0.1:8888 or from a browser on a remote PC in your lan http://192.168.x.x:8888


    with the webinterface you can then add readers, users, edit configs etc.


    oscam.conf, oscam.user and oscam.server are probably the 3 most important, but you also put the srvid, services, provid, cert, ac and one or two others in here.

    If I take a while to respond, you can see why.....


    :red:

  • I'm planning on getting one of these today and tranfering my setup from pc tower to this, I run 2 instances of oscam now on the pc one for cache only and one for shares, may need some help in getting 2 instances running?

  • I'm planning on getting one of these today and tranfering my setup from pc tower to this, I run 2 instances of oscam now on the pc one for cache only and one for shares, may need some help in getting 2 instances running?


    Shouldn't be a problem especially as the new models have double the RAM - consider it is pretty much the same as having oscam running on a debian server, not tried it but sure it is possible. If you can't manage then consider the Raspberry Pi is so cheap you might want to just get 2 Raspbery Pi's!

    If I take a while to respond, you can see why.....


    :red:

  • Getting these error while trying to build?


    Scanning dependencies of target csmodules
    [ 1%] Building C object CMakeFiles/csmodules.dir/module-monitor.o
    In file included from /usr/src/oscam-svn/globals.h:42:0,
    from /usr/src/oscam-svn/module-monitor.c:1:
    /usr/src/oscam-svn/cscrypt/cscrypt.h:12:27: fatal error: openssl/aes.h: No such file or directory
    compilation terminated.
    make[2]: *** [CMakeFiles/csmodules.dir/module-monitor.o] Error 1
    make[1]: *** [CMakeFiles/csmodules.dir/all] Error 2
    make: *** [all] Error 2
    root@raspberrypi:/usr/src/oscam-svn/build#

  • all should work if all instructions are followed completely - did you note this?


    Compile Oscam (note the two dots after the 5th line are there because they need to be).

    If I take a while to respond, you can see why.....


    :red:

  • the requirement to install these packages was already stated as part of the guide, under the heading "First, you need to get your packages" Have you missed anything else out?

    If I take a while to respond, you can see why.....


    :red:

  • not sure what the problem is cause i only compiled mine a couple of weeks ago and I followed this guide to make sure it is sending people down the right track, unless something has changed with the image, packages or sources etc - you could always try the binaries I created, pick up the guide from after the compile part, create the folders as stated, and move these into the folders and change attribs as stated.

  • Cant get arm-coolstream to work for me...this thing should be renamed the Raspberry Pia for 'pain in arse' trying to get it running.....lol


    Your compiled version runs fine for me though, but I need the latest version to get my cache server running correctly.

  • Hi all,


    I need some assistance please. I have followed the guild I believe exactly and OSCam is up and running. I already have OSCam running on an Amiko Alien2 and so I added a Reader to the Pi for a User I setup from the Amiko and all seems to work OK.


    I have an external c-Line in my Amiko which works fine too but when I changed it and set it up on the Pi, the Status = Error. It correctly read the DNS for for C-Line hostname so I am lost as to why it worked OK on my Amiko but not then on the Pi.


    Any ideas anyone ?



    Regards
    C

  • probably not an issue around the raspberry pi - do you have the external share set up in the Raspberry Pi and the Amiko Alein at the same time? Post logs from Pi server so we can see what is happening

    If I take a while to respond, you can see why.....


    :red:

  • Hi,
    i'm trying to install osacm on my raspberry pi.
    I'm new in this, so please be nice with me...


    i install everything like in this post.


    when i connect to my oscam vie http i have this erros.


    I0m would like to use my nds *** italy card.
    i would like that my nds card is on raspberry pi with oscam, and that i can connect to it witm my dreambox, where i0m using cccam.


    i was using cccam +oscam on drem and i have cccam.cfg with all users inside.
    I read that i have to port all this users in oscam.users file? its this true.
    Do i have to use my old oscam files that i was using in dreambox with cccam?
    How can i connect cccam client to my oscam only raspberry pi server?


    this is my oscam log file. If i insert my nds card in smargo i did not see anything.
    2013/03/06 01:59:21 0 s >> OSCam << cardserver started, version 1.20-unstable_svn, build r8480 (arm-linux-gnueabihf)
    2013/03/06 01:59:21 0 s creating pidfile /tmp/.oscam/oscam.pid with pid 2137
    2013/03/06 01:59:21 0 s userdb reloaded: 25 accounts loaded, 0 expired, 0 disabled
    2013/03/06 01:59:21 0 s signal handling initialized
    2013/03/06 01:59:21 0 s camd35: initialized (fd=5, port=35000)
    2013/03/06 01:59:21 0 s newcamd: initialized (fd=6, port=35000)
    2013/03/06 01:59:21 0 s -> CAID: 09CD PROVID: 000000
    2013/03/06 01:59:21 0 s ***IT [internal] creating thread for device /dev/sci0
    2013/03/06 01:59:21 0 s loadbalancer: can't read from file /tmp/.oscam/stat
    2013/03/06 01:59:21 0 s waiting for local card init
    2013/03/06 01:59:21 1750F60 r ***IT [internal] ERROR: Opening device /dev/sci0 (errno=2 No such file or directory)
    2013/03/06 01:59:21 1750F60 r ***IT [internal] Cannot open device: /dev/sci0
    2013/03/06 01:59:21 1777D48 h webif: decompressed 50857 bytes back into 150432 bytes
    2013/03/06 01:59:21 1777D48 h HTTP Server listening on port 8181
    2013/03/06 02:00:21 1750F60 r ***IT [internal] ERROR: Opening device /dev/sci0 (errno=2 No such file or directory)
    2013/03/06 02:00:21 1750F60 r ***IT [internal] Cannot open device: /dev/sci0
    2013/03/06 02:01:21 1750F60 r ***IT [internal] ERROR: Opening device /dev/sci0 (errno=2 No such file or directory)
    2013/03/06 02:01:21 1750F60 r ***IT [internal] Cannot open device: /dev/sci0
    2013/03/06 02:02:21 1750F60 r ***IT [internal] ERROR: Opening device /dev/sci0 (errno=2 No such file or directory)
    2013/03/06 02:02:21 1750F60 r ***IT [internal] Cannot open device: /dev/sci0


    This is my oscam.conf
    # main configuration


    [global]
    nice = -1
    WaitForCards = 1
    ClientTimeout = 5 # dodal kikan 27/11/2012
    CacheDelay = 120 # dodal kikan 27/11/2012
    #LogFile = stdout
    logfile = /var/log/oscam.log
    maxlogsize = 120
    #preferlocalcards = 1
    saveinithistory = 1



    # monitor


    [monitor]
    Port = 0
    NoCrypt = # Ip allowed to connect dreambox
    MonLevel = 4



    # protocols


    [newcamd]
    key = 0102030405060708091011121314
    #port = 35000@09CD:000000
    port = 35000@09CD:000000


    [cs357x]
    Port = 35000


    #webif


    [webif]
    httpport = ****
    httpuser =****
    httppwd = *****
    httprefresh= 10
    httpallowed = 127.0.0.1,192.168.10.101,192.168.10.33 # Ip allowed to connect dreambox


    this is my oscam.server
    [reader]
    Label = ***IT
    Protocol = internal
    Detect = CD
    Device = /dev/sci0
    group = 1
    emmcache = 1,1,0
    boxid = *******
    blocknano = all
    mhz = 368
    cardmhz = 368
    blockemm-u = 1
    blockemm-s = 1
    blockemm-g = 1
    blockemm-unknown = 1
    blockemm-bylen = 183,81


    and this is my oscam.user


    [account]
    user = ***1
    pwd = ***1
    monlevel = 4
    group = 1
    uniq = 0
    au = 0
    #ident = 09CD:000000
    #caid =09cd


    [account]
    user=****
    pwd=*****
    group=1
    cccmaxhops=5
    cccreshare=0

    [account]
    user=ati
    pwd=*****
    group=1
    cccmaxhops=5
    cccreshare=0

    [account]
    user=mama
    pwd=****
    group=1
    cccmaxhops=5
    cccreshare=0


    thank you very much
    kikan

OSCam Support Forum

Configs, discussion, downloads and guides for OSCam Softcam.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!