Kodi is a mediacenter, Synology is a NAS, Tvheadend is a piece of server software for things like television and oscam is a cardreader client/server. Put this all together and you have a PVR client. This basicly allows you to have TV from your own provider, in my case Ziggo. Together with some nice logo’s which is referred too as picons. (i don’t use a physical tv card but instead i use hdhomerun)
This is not your standard cup of tea. I thought it might be a click and go but its not.
- Install hdhomerun
- Install tvheadend
- Install usb drivers
- Install oscam
- Configure CAS (card sharing)
- Configure picons
- Setup Tvheadend (Kodi)
Things to know before you start. If you use a Synology disk station and you want to install something that might not come from a repository make sure you have the right package. You can find what architecture you need from http://forum.synology.com/wiki/index.php/What_kind_of_CPU_does_my_NAS_have in my case a DS415+ which is a avaton.
1. Just download the latest package from hdhomerun website. I do have a windows client with me so i can just run that one. After doing so it will automaticly update your version to the latest which is a good thing. Follow the instructions, its pretty straightforward. You should be able to watch free to air with the right client (you can test that if you get stuck later on to make sure its not this issue)
2. Add to your package center the following repository: http://syno.dierkse.nl/ after that you will find your tvheadend-testing. I did have one issue that a certain version (latest) didn’t work for me. I picked 1 version lower and installed it manually. Strange thing is that i could upgrade it and then i would still have the latest. (if you browse to the url you can still find the correct one too)
Once done you should be able to go to http://<ip>:9981/ in there go to “Configuration -> DVB Inputs -> TV Adapters” You should see 4 adapters right now for hdhomerun already. (this is the easy part) Go to the next tab “Networks” click on “Add” and select DVB-C (important) Add a name (in my case Ziggo) and leave the defaults it should be good. Now go back to the TV Adapters tab and select the 4 tuners. There you have the select the network is Ziggo which you just defined. Network id should be “5555” for ziggo, leave the rest as it is again. At this point it should create 4 muxes int he tab “Muxes” but it doesn’t do much this is because its not running on the correct mhz. For Ziggo this is 474000000. (Information like 5555 and 474 can be find here at the providers page here) so change all 4 muxes to point to the correct 474 range and then go back to the TV adapter and select all interfaces (edit -> enable -> select network you just created) it should show active muxes and services. On the Services tab it should start to populate the channels. Depending on how things are done you can always google around, this part didn’t cost me that much time.
Last thing here to do is to “map” the channels, as long as you don’t map them it wont show anywhere! So on the “Configuration -> DVB Inputs -> Services” you can just make the list bigger by clicking in the right bottom corner. Then just select all channels you want and then click the “Map Selected” (you can do Map All but i don’t want the crap) DONT forget to mark the “include encrypted channels” otherwise it will skip them out of the selection.
3. As far as i know there are 2 ways to install it (i found that out later) but the one that worked for me was using the ipkg from http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh Just download it, chmod +x it and sh <file> run it. After that you have ipkg working and can get the drivers for most smart card readers (ipkg install usbutils) Or like i stated the other way. I do believe http://jadahl.dscloud.me/sspks/packages/UsbSerialDrivers_3.0.2.spk should also just work (it picks the correct architecture for you)
4. Oscam, download it manually. I could not get it via repo but its at http://oscam.myqnapcloud.com/oscam/ or https://packages.fastxl.nl/index.php?fulllist=true so in my case i had to get the avaton one. Now this one is a real “pain” so many manuals say what you have to do, some of them tell you to do a lsusb to get the bus and device numbers which might just work for you but it didn’t for me. Even if you go to oscam at http://<ip>:8888/ and go to readers and scan usb it didn’t show me anything. In the end i just typed in “dmesg” on my nas after i plugged in the device and saw /dev/ttyUSB0. I am using this right now because i don’t have a better solution. Just remember that this device name can change pretty quick on reboots!
Now for the settings, go to files and just fill in all this info:
logfile = /usr/local/oscam/var/oscam.log
port = 10000@0604:000000
allowed = 127.0.0.1,192.168.1.0-192.168.1.255
key = 000102030405060708090A0B0C0E
keepalive = 1
httpport = 8888
httpallowed = 127.0.0.1,0.0.0.0-255.255.255.255
user = <username>
pwd = <password>
au = 1
group = 1
ident = 0604:000000
cccignorereshare = 1
cccstealth = 1
label = Ziggo
description = Ziggo
protocol = mouse
device = /dev/ttyUSB0
caid = 0604
boxkey = 1122334455667788
rsakey = 3C8633AAC0D367533DEC7BB2EEEDEB8CA3ADA52E58B99BB34672783277A1DAAC3B6106AD0909774E031B2A6E30195B437683AD0FC599B87D08CEA47BE1B6C76A
detect = cd
mhz = 600
cardmhz = 600
group = 1
emmcache = 1,3,2,0
blockemm-u = 1
Things that could be different for providers: Caid, boxkey, rsakey, ident. The “key” that is used in oscam will be used later in tvheadend. Now that all these things are in place, make sure you set the reader to mouse and the usb device you found with “dmesg”. Normally you could set instead of mouse “smartcardreader” or something like that and use the device/bus but like i said, i could not get that to work. Now go to the Readers-> Reload Readers. You should see something in the Live Logs. At some point it will say Success. Just keep in mind that if you play around with this thing and you get weird error messages that if you “overload” your card you have to reinsert the card and try again. You will only see the overload message in “dmesg” so pay attention to that too. Also if you want EMM (updates off the card every month so you don’t have to re-activate it each time) you need the “cccXXXXX” stuff in the oscam.user. Otherwise you will get: “Will not forward EMMs (not allowed by server)” error message in tvheadend.
5. Assuming it works you need to add this oscam server to tvheadend. Go to “Configuration -> CAS -> Add” and fill in the details from above (from oscam.user & newcamd) so port in this example is 10000 and userid/pwd is the one you filled in for oscam.user and the DES key is the key from newcamd. (And also mark the update EMM options) so in the future if tvheadend has an encrypted channel it will use this CAS server to get the keys from the card from your smartreader. A small note for Ziggo card users, you might need to go to the ziggo website and choose smartcards and click the “reset” button or whatever it is called if you have some issues. Best thing -> install it in a tv, make sure it works, then use it.
6. This is straight forward, go to “Configuration -> General -> Picon” Select prefer picons. In the Channel and picon path i just fill in “http://picons.bytework.eu/” Credit where credit is due, found those at https://www.sat4all.com/forums/topic/344764-nieuw-07-02-2015-ziggo-radio-tv-xpicons-metal-look/?p=2288286 so you need to find the correct pictures for your provider and upload them somewhere for ease of use (you can do it locally on the synology too but if you share your setup externally it wont work)
7. Kodi setup tvheadend: http://kodi.wiki/view/PVR/Backend/Tvheadend its pretty clear, setup PVR, choose tvheadend, use the username/pwd you used to enter tvheadend or create your own. Pictures will show up too eventually same for EPG (usually takes some time)
8. At some point i got a lot of crap error messages like “viasat_baltic: invalid checksum (len 183, errors 106)” etc etc, turns out the EPG Grabber has the “over-the-air-grabbers” turned on for Viasat, Opentv, UK etc. Just disable that and your good to go clean.
Update: Turns out you can set the protocol to “smartreader” and use the tool on your NAS, in my case its located in “/volume1/@appstore/oscam/bin” and doing “./list_smargo” gave me this output:
Looking for smartreader compatible devices...
bus 002, device 004 : 0403:6001 Smartreader2 plus (type=SRv2, in_ep=02, out_ep=81; insert in oscam.server 'device =
So it even tells you what you need to add to oscam.server 🙂