hostname:9981 :: ref_01 :: ref_02 :: ref_03
Hardware (capture card):
- ensure capture-card firmware files are in /lib/firmware
- reboot &
lspci
ordmesg | grep dvb
to check for presence/recognition of card
Fedora:
dnf install tvheadend
openSUSE:
zypper in tvheadend
Updating /etc/sysconfig/tvheadend ...
==> IMPORTANT: Post configuration tasks;
==> 1. Start the tvheadend service (to create home directory).
==> 2. Run tvheadend_super to set default username and password.
==> 3. Restart tvheadend service.
==>
==>
==> All further configuration is maintained through the web interface:
==>
==> http://localhost:9981/
==>
Grant tcp access to tvheadend ports
firewall-cmd --permanent --add-port=9981/tcp
firewall-cmd --permanent --add-port=9982/tcp
firewall-cmd --reload
systemctl enable tvheadend
systemctl restart tvheadend
/etc/sysconfig/tvheadend:
#Configuration file for the tvheadend service.
MALLOC_ARENA_MAX=4
OPTIONS="-c /var/lib/tvheadend/config -u tvheadend -g video -6 -C --http_port 9981 --htsp_port 9982"
Run as daemon, and see realtime logging:
- Stop the service
systemctl stop tvheadend
- Run from the command line as configured in /etc/sysconfig/tvheadend
tvheadend -c /var/lib/tvheadend/config -u tvheadend -g video -6 -C --http_port 9981 --htsp_port 9982
- exit the cli comand, then restart the service
systemctl restart tvheadend
!! Must stop the service before changing any config files !!
- config file for each user:
/var/lib/tvheadend/config/accesscontrol/<each-entry> - remove to clear epg database:
/var/lib/tvheadend/config/epgdb.v2
usermod -aG smbgrp tvheadend
#gives tvheadend access to alt storage pathusermod -aG video <username>
#add tvheadend, cyril, & kodi to video group- timeshift path: /storage/share/Video/.tv_timeshift
- recording path: /storage/share/Video/tv
tvheadend looks at a grab_file to determine where to get its epg data.
The grab_file may:
- point directly to a specific site (sd_json)
- point to a local epg-data file (ex: xmltv.xml)
- activate a scan, to populate a local epg-data file
looking at it another way:
EPG data from the interwebs is compiled into a xmltv.xml file, which is referenced by the grab_file that tvheadend is pointed to.
installation
- setup & test scraper
- add (or symbolically link) tv_grab_file to /usr/bin, and configure as needed
- systemctl restart tvheadend #to see new tv_grab_file
- enable tv_grab_file in tvheadend [ configuration > channel/epg > EPG Grabber Modules ]
tvheadend
- Configuration > channel/epg > channels > epg source :: enter/select grab_file_channel
- configure frequency
- re-run internal epg grabbers
Following the recommended path in the wiki, I did initial setup through kodi (password is in the clear!), tells me access denied.
found github issue instructing to run http://YOUR.IP.ADDRESS:9981/api/mpegts/service/grid
this request was denied until I used a tvheadend account with administrative privilege.
On the kodi device, a successful setup&scan generates settings & configuration files in a userdata folder under:
~/.kodi/userdata/../addon_data
or
~/.var/app/tv.kodi.Kodi/data/userdata/addon_data
Migrating the setup to be managed by a (headless) tvheadend backend/server involves two steps:
-
Copying the kodi-configured (& tested) addon for tvheadend server usage
- Copy the contents of .kodi/addons/script.module.zap2epg (core addon files) to user@serverip:/var/lib/tvheadend/script.module.zap2epg
- Copy the contents of .kodi/userdata/../addon_data/script.module.zap2epg (configuration and settings) to user@serverip:/var/lib/tvheadend/script.module.zap2epg
-
Setting up the tv_grab_file
- settings.xml:
Assuming that<setting id="tvhurl">dubserv</setting>
in settings.xml, be sure thatdubserv
is defined in /etc/hosts, and that the appropriate network range is configured for the kodi user via the tvheadend web interface. - script.module.zap2epg/bin/tv_grab_zap2epg:
ADDON_HOME & ADDON_DIR: Modify to the actual location of the addon files
/var/lib/tvheadend ln -s
(or copy) to /usr/bin/- test to verify functionality. Success:=new xmltv.xml generated
. tv_grab_zap2epg
Systemctl restart tvheadend
#make tvheadend notice grabber additions/changes- Enable tv_grab_zap2epg in tvheadend [ configuration > channel/epg > EPG Grabber Modules ]
- Edit cron frequency [ configuration > channel/epg > EPG Grabber > Internal Grabber ]
- settings.xml:
ssh -A -t kodi@kodibox scp -r /home/kodi/.kodi/addons/script.module.zap2epg [email protected]:/home/tvheadend/
ssh -A -t kodi@kodibox scp -r /home/kodi/.kodi/userdata/profiles/kids/addon_data/script.module.zap2epg/* [email protected]:/home/tvheadend/script.module.zap2epg/
userdata/profiles/kids/addon_data/script.module.zap2epg/*
Seems nice
First, from web-interface:
configuration > channel/epg > epg grabber modules
on left side, lots of red circles, look for:
internal: XMLTV: Schedules Direct JSON API
present? then check the parameters for the grab_file path, grab some terminal:
sudo -u tvheadend /path/to/tv_grab_zz_sdjson --configure
follow the prompts, then restart tvheadend
systemctl restart tvheadend
go back to the web-interface > modules menu, disable the OTA module, enable the appropriate schedules direct JSON, [save], profit.
try the %C thing :: ref_01 :: ref_02 :: ref_03
works:
Configuration > General > Base
- Picon
- Channel icon path: file:///home/tvheadend/.xmltv/icons/%C.png
- Channel icon name scheme: Service name picons
- Picon path: BLANK
- Picon name scheme: Standard
- Channel (re)name:
- Channel_name : filename ? auto-fills-in
- IconTest : icontest.png
- Channel 1 : channel1.png
- 3.4 name : 34name.png
great source of logo png (& svg) images:
https://logos.fandom.com/wiki/