Spanish Abertis DTT Sat @ Hispasat 30W - Chat & How to guides

Oskar3

Registered
Messages
91
Astra-SM is installable on Linux with no problem, you have to download and build it yourself, it doesn't take very long though.

As for TVHeadend, it's a bit more involved because TVHeadend doesn't let services have generic 'data' PIDs like Enigma2 does now (with the c:15xxxx option). I can write a guide but it will take a little bit of time.

For Abertis, I use a small C program, but there's also a little Python3 script that works as part of a pipe -

Python:
import sys

pid = int(sys.argv[1])

packet = sys.stdin.buffer.read(188)

while packet !="":
    tspid = ((packet[1] & 0x1f) << 8) | packet[2]
    if tspid == pid :
        afc = packet[3] & 0x30
      
        if afc == 0x10 :
            sys.stdout.flush()
            sys.stdout.buffer.write(packet[4:])
        elif afc == 0x30 :
            sys.stdout.flush()
            sys.stdout.buffer.write(packet[packet[4]+5:])
          
    packet = sys.stdin.buffer.read(188)

Save as abertis.py

I can go through how that then works with TVHeadend, but it will take a little more time to write :)
I can see the pids linking sat ip with STB but no hat services. Compiling astra-sm shouldn't take long but so far I haven't been able to do it for a long time....
In any case, if it doesn't work with TVheadend, astra-sm won't help me at all.
Thank you
 

granavi

Registered
Messages
9
Astra-SM is installable on Linux with no problem, you have to download and build it yourself, it doesn't take very long though.

As for TVHeadend, it's a bit more involved because TVHeadend doesn't let services have generic 'data' PIDs like Enigma2 does now (with the c:15xxxx option). I can write a guide but it will take a little bit of time.

For Abertis, I use a small C program, but there's also a little Python3 script that works as part of a pipe -

Python:
import sys

pid = int(sys.argv[1])

packet = sys.stdin.buffer.read(188)

while packet !="":
    tspid = ((packet[1] & 0x1f) << 8) | packet[2]
    if tspid == pid :
        afc = packet[3] & 0x30
       
        if afc == 0x10 :
            sys.stdout.flush()
            sys.stdout.buffer.write(packet[4:])
        elif afc == 0x30 :
            sys.stdout.flush()
            sys.stdout.buffer.write(packet[packet[4]+5:])
           
    packet = sys.stdin.buffer.read(188)

Save as abertis.py

I can go through how that then works with TVHeadend, but it will take a little more time to write :)
thanks very much , take your time
 

Adam792

Registered
Messages
101
I can see the pids linking sat ip with STB but no hat services. Compiling astra-sm shouldn't take long but so far I haven't been able to do it for a long time....
In any case, if it doesn't work with TVheadend, astra-sm won't help me at all.
Thank you

First off, to build astra-sm in Linux (here in Ubuntu, with apt package manager). You need libtool and autoconf along with a C compiler -

Code:
sudo apt install autoconf libtool
git clone https://github.com/crazycat69/astra-sm.git
cd astra-sm
./autogen.sh
./configure
make
sudo make install

Create an astra directory and put your astra.conf file in - /etc/astra.

Then you can create a service file to run astra-sm -

Code:
sudo nano /etc/systemd/system/astra-sm.service

With the following inside -

Code:
[Unit]
Description=Astra SM
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=astra /etc/astra/astra.conf
WorkingDirectory=/etc/astra/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=hts

[Install]
WantedBy=multi-user.target

Finally run

Code:
sudo systemctl start astra-sm
sudo systemctl enable astra-sm

And the astra-sm service will be running, including automatically on machine boot.
 

Oskar3

Registered
Messages
91
:oops:
First off, to build astra-sm in Linux (here in Ubuntu, with apt package manager). You need libtool and autoconf along with a C compiler -

Code:
sudo apt install autoconf libtool
git clone https://github.com/crazycat69/astra-sm.git
cd astra-sm
./autogen.sh
./configure
make
sudo make install

Create an astra directory and put your astra.conf file in - /etc/astra.

Then you can create a service file to run astra-sm -

Code:
sudo nano /etc/systemd/system/astra-sm.service

With the following inside -

Code:
[Unit]
Description=Astra SM
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=astra /etc/astra/astra.conf
WorkingDirectory=/etc/astra/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=hts

[Install]
WantedBy=multi-user.target

Finally run

Code:
sudo systemctl start astra-sm
sudo systemctl enable astra-sm

And the astra-sm service will be running, including automatically on machine boot.
I tried to compile by cloning and also downloading the files. I don’t know if the problem is that I have since Debian 11, so today I also tried a clean installation with Debian 10. " git: command not found".
Will I have to install Ubuntu?
 

Adam792

Registered
Messages
101
For Abertis in TVHeadend, to use the new TVE UHD mux as an example, the kind of thing you have to do is -

1. Create directory /home/hts/Abertis and put the above file abertis.py inside.
2. Create another file inside /home/hts/Abertis called tdt.sh - it should have the following contents:

Code:
#!/bin/bash
curl -s http://127.0.0.1:9981/stream/service/$1 | python3 /home/hts/Abertis/abertis.py $2

3. Make sure the files/folder have the right permissions for TVHeadend to execute them -

Code:
sudo chown -R hts:hts /home/hts/Abertis
sudo chmod +x /home/hts/Abertis/tdt.sh

4. Now in TVHeadend, you need to scan the Hispasat muxes if you've not already done so. Then go into Configuration > DVB Inputs > Services
5. Change the 'Hide' dropdown to 'None'
6. Find the 10922V service with SID 1802, and copy the UUID from the play link ( e.g. http://127.0.0.1:9981/play/ticket/stream/service/17efd118f1f63b813ea011c1610ff1d0 - the bit in bold is the UUID)
7. Use tvh-json.py to modify the service with the correct details: https://github.com/tvheadend/tvheadend/blob/master/lib/api/python/tvh-json.py - you'll need to modify tvh-json.py to contain your user details to access the TVH REST API (line #27 and #28 - create a user in TVHeadend first and paste the credentials you've created in the py file on these lines.)

Code:
./tvh-json.py export 17efd118f1f63b813ea011c1610ff1d0 > abertis802.json

File abertis802.json will contain something like the following -

Code:
{
    "pmt": 802,
    "force_caid": 0,
    "prefcapid": 0,
    "stream": [],
    "lcn": 0,
    "dvb_servicetype": 0,
    "dvb_ignore_eit": false,
    "verified": 0,
    "uuid": "17efd118f1f63b813ea011c1610ff1d0",
    "pcr": 0,
    "priority": 0,
    "sid": 1802,
    "pts_shift": 0,
    "auto": 0,
    "srcid": 0,
    "lcn_minor": 0,
    "lcn2": 0,
    "prefcapid_lock": 0,
    "created": 1668812335,
    "enabled": true,
    "s_type_user": -1,
    "last_seen": 1669169044
}

We need to edit that file to force PID 802 to be recognised and decrypted in OSCam.

- We change the service ID to 802 (I use same as Abertis PID for SID, but this can be any non-existing value in the mux. If you don't change it, the changes get wiped by TVH)
- We change the PMT PID to 8000 (fake PMT PID, again to stop TVH from reading the 'real' PMT and wiping the changes)
- We add details into "stream":[] array for the 802 payload PID and CAID so that OSCam decrypts it. Plus we change PCR value also to 802.
- We add a svcname value just so we can see a name in TVHeadend for the service.
- We set "verified" to 1, so TVHeadend doesn't hide the service from us (in older versions this value doesn't exist)

The final file with the edits looks like this -

Code:
{
    "pmt": 8000,
    "force_caid": 0,
    "prefcapid": 0,
    "stream": [
        {
            "type": "H264",
            "pid": 802,
            "position": 0
        },
        {
            "type": "CA",
            "caidlist": [
                {
                    "caid": 9728
                }
            ],
            "pid": 8191,
            "position": 262144
        }
    ],
    "lcn": 0,
    "dvb_servicetype": 0,
    "dvb_ignore_eit": false,
    "verified": 1,
    "uuid": "17efd118f1f63b813ea011c1610ff1d0",
    "pcr": 802,
    "priority": 0,
    "sid": 802,
    "pts_shift": 0,
    "auto": 1,
    "srcid": 0,
    "lcn_minor": 0,
    "lcn2": 0,
    "prefcapid_lock": 0,
    "created": 1668808494,
    "enabled": true,
    "s_type_user": -1,
    "svcname": "Abertis PID 802",
    "last_seen": 1668808494
}

Note: You'll need to do this rather than just copying my examples because your UUIDs will be different to mine, and everything needs to match in your install for it to work.

With the json file edited with the changes, re-import it into TVHeadend using tvh-json.py :

Code:
./tvh-json.py import abertis802.json

Now you should have a service under 10922V called "Abertis PID 802", this has the same UUID as we copied earlier as we've just edited it.

You'll need the BISS key in OSCam constant.cw to match the fact that we're using the 'fake' service ID 802 and fake PMT 8000, so that will look like this :

Code:
2600:000000:0322:1F40:1FFF:0322:XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX ;Abertis PID 802

8. Next, in TVHeadend we need to add a new IPTV network. Configuration > DVB Inputs > Networks > Add+

Type: IPTV Network
Name: Abertis
Enabled: Ticked
Maximum # input streams: 2

9. We now add a mux to the created IPTV network. Configuration > DVB Inputs > Muxes > Add+

Network: Abertis
URL: pipe:///home/hts/Abertis/tdt.sh 17efd118f1f63b813ea011c1610ff1d0 802

Using your UUID here, and PID 802.
Mux Name: Abertis PID 802 (or whatever you like!)
Click to add/save.

10. This new mux will be added, we need the link again from the play button for it in Configuration > DVB Inputs > Muxes. e.g. http://127.0.0.1:9981/play/ticket/stream/mux/dbedb6bee8b066373859df11424b4508?title=UHD%20%2F%20TDT

Copy the address and remove the bits in bold and add ?pids=4096 onto the end (not vital, but helps efficiency).

11. In /etc/astra/astra.conf you need to add this mux link as your source for the T2-MI conversion -

Code:
tdtuhd1 = make_t2mi_decap({
        name = "TDT UHD T2",
        input = "http://127.0.0.1:9981/stream/mux/dbedb6bee8b066373859df11424b4508?pids=4096",
        plp = 0,
        pnr = 0,
        pid = 4096,
})

make_channel({
        name = "uhd1",
        input = { "t2mi://tdtuhd1", },
        output = { "http://0.0.0.0:17981/tdt/uhd1", },
})

Save astra.conf, and restart astra-sm

Code:
sudo systemctl restart astra-sm

12. Now we add another IPTV mux in TVHeadend using the output of Astra-SM. Configuration > DVB Inputs > Muxes > Add+

Network: Abertis
URL: http://127.0.0.1:17981/tdt/uhd1
Click Save.

Provided that everything worked, playing this new mux should play the TVE UHD mux, it may take a couple of seconds to start because of the decryption steps.
 

Adam792

Registered
Messages
101
:oops:

I tried to compile by cloning and also downloading the files. I don’t know if the problem is that I have since Debian 11, so today I also tried a clean installation with Debian 10. " git: command not found".
Will I have to install Ubuntu?

You need to install git first in that case -

sudo apt install git
 

Oskar3

Registered
Messages
91
:oops:
You need to install git first in that case -

sudo apt install git
configure.ac:726: the top level
configure.ac:41: error: possibly undefined macro: LT_LIB_DLLOAD
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: error: /usr/bin/autoconf failed with exit status: 1
 

Adam792

Registered
Messages
101
:oops:

configure.ac:726: the top level
configure.ac:41: error: possibly undefined macro: LT_LIB_DLLOAD
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: error: /usr/bin/autoconf failed with exit status: 1


Hmm installing libtool should have fixed that, maybe also try -

sudo apt install libltdl-dev
 

Oskar3

Registered
Messages
91
Hmm installing libtool should have fixed that, maybe also try -

sudo apt install libltdl-dev
astra/core/child.c: In function ‘asc_child_close’:
astra/core/child.c:471:41: error: ‘sys_siglist’ undeclared (first use in this function)
471 | , signum, sys_siglist[signum]);
| ^~~~~~~~~~~
astra/core/child.c:471:41: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:2005: astra/core/child.lo] Error 1
make[2]: exits the directory '/home/astra-sm/src'
make[1]: *** [Makefile:1119: all] Error 2
make[1]: exits the directory '/home/astra-sm/src'
make: *** [Makefile:443: all-recursive] Error 1
 

MusicaFM

Registered
Messages
5
Hola, para los que tengáis receptor o tele compatible con 4K y seáis de Talavera y Comarca de Talavera ¿Podéis escanear el Canal 35 de la TDT para ver si captaís Tve UHD y UHD2? Gracias, según Telecom CLM ya está funcionando el mux 35
 

granavi

Registered
Messages
9
For Abertis in TVHeadend, to use the new TVE UHD mux as an example, the kind of thing you have to do is -

1. Create directory /home/hts/Abertis and put the above file abertis.py inside.
2. Create another file inside /home/hts/Abertis called tdt.sh - it should have the following contents:

Code:
#!/bin/bash
curl -s http://127.0.0.1:9981/stream/service/$1 | python3 /home/hts/Abertis/abertis.py $2

3. Make sure the files/folder have the right permissions for TVHeadend to execute them -

Code:
sudo chown -R hts:hts /home/hts/Abertis
sudo chmod +x /home/hts/Abertis/tdt.sh

4. Now in TVHeadend, you need to scan the Hispasat muxes if you've not already done so. Then go into Configuration > DVB Inputs > Services
5. Change the 'Hide' dropdown to 'None'
6. Find the 10922V service with SID 1802, and copy the UUID from the play link ( e.g. http://127.0.0.1:9981/play/ticket/stream/service/17efd118f1f63b813ea011c1610ff1d0 - the bit in bold is the UUID)
7. Use tvh-json.py to modify the service with the correct details: https://github.com/tvheadend/tvheadend/blob/master/lib/api/python/tvh-json.py - you'll need to modify tvh-json.py to contain your user details to access the TVH REST API (line #27 and #28 - create a user in TVHeadend first and paste the credentials you've created in the py file on these lines.)

Code:
./tvh-json.py export 17efd118f1f63b813ea011c1610ff1d0 > abertis802.json

File abertis802.json will contain something like the following -

Code:
{
    "pmt": 802,
    "force_caid": 0,
    "prefcapid": 0,
    "stream": [],
    "lcn": 0,
    "dvb_servicetype": 0,
    "dvb_ignore_eit": false,
    "verified": 0,
    "uuid": "17efd118f1f63b813ea011c1610ff1d0",
    "pcr": 0,
    "priority": 0,
    "sid": 1802,
    "pts_shift": 0,
    "auto": 0,
    "srcid": 0,
    "lcn_minor": 0,
    "lcn2": 0,
    "prefcapid_lock": 0,
    "created": 1668812335,
    "enabled": true,
    "s_type_user": -1,
    "last_seen": 1669169044
}

We need to edit that file to force PID 802 to be recognised and decrypted in OSCam.

- We change the service ID to 802 (I use same as Abertis PID for SID, but this can be any non-existing value in the mux. If you don't change it, the changes get wiped by TVH)
- We change the PMT PID to 8000 (fake PMT PID, again to stop TVH from reading the 'real' PMT and wiping the changes)
- We add details into "stream":[] array for the 802 payload PID and CAID so that OSCam decrypts it. Plus we change PCR value also to 802.
- We add a svcname value just so we can see a name in TVHeadend for the service.
- We set "verified" to 1, so TVHeadend doesn't hide the service from us (in older versions this value doesn't exist)

The final file with the edits looks like this -

Code:
{
    "pmt": 8000,
    "force_caid": 0,
    "prefcapid": 0,
    "stream": [
        {
            "type": "H264",
            "pid": 802,
            "position": 0
        },
        {
            "type": "CA",
            "caidlist": [
                {
                    "caid": 9728
                }
            ],
            "pid": 8191,
            "position": 262144
        }
    ],
    "lcn": 0,
    "dvb_servicetype": 0,
    "dvb_ignore_eit": false,
    "verified": 1,
    "uuid": "17efd118f1f63b813ea011c1610ff1d0",
    "pcr": 802,
    "priority": 0,
    "sid": 802,
    "pts_shift": 0,
    "auto": 1,
    "srcid": 0,
    "lcn_minor": 0,
    "lcn2": 0,
    "prefcapid_lock": 0,
    "created": 1668808494,
    "enabled": true,
    "s_type_user": -1,
    "svcname": "Abertis PID 802",
    "last_seen": 1668808494
}

Note: You'll need to do this rather than just copying my examples because your UUIDs will be different to mine, and everything needs to match in your install for it to work.

With the json file edited with the changes, re-import it into TVHeadend using tvh-json.py :

Code:
./tvh-json.py import abertis802.json

Now you should have a service under 10922V called "Abertis PID 802", this has the same UUID as we copied earlier as we've just edited it.

You'll need the BISS key in OSCam constant.cw to match the fact that we're using the 'fake' service ID 802 and fake PMT 8000, so that will look like this :

Code:
2600:000000:0322:1F40:1FFF:0322:XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX ;Abertis PID 802

8. Next, in TVHeadend we need to add a new IPTV network. Configuration > DVB Inputs > Networks > Add+

Type: IPTV Network
Name: Abertis
Enabled: Ticked
Maximum # input streams: 2

9. We now add a mux to the created IPTV network. Configuration > DVB Inputs > Muxes > Add+

Network: Abertis
URL: pipe:///home/hts/Abertis/tdt.sh 17efd118f1f63b813ea011c1610ff1d0 802

Using your UUID here, and PID 802.
Mux Name: Abertis PID 802 (or whatever you like!)
Click to add/save.

10. This new mux will be added, we need the link again from the play button for it in Configuration > DVB Inputs > Muxes. e.g. http://127.0.0.1:9981/play/ticket/stream/mux/dbedb6bee8b066373859df11424b4508?title=UHD%20%2F%20TDT

Copy the address and remove the bits in bold and add ?pids=4096 onto the end (not vital, but helps efficiency).

11. In /etc/astra/astra.conf you need to add this mux link as your source for the T2-MI conversion -

Code:
tdtuhd1 = make_t2mi_decap({
        name = "TDT UHD T2",
        input = "http://127.0.0.1:9981/stream/mux/dbedb6bee8b066373859df11424b4508?pids=4096",
        plp = 0,
        pnr = 0,
        pid = 4096,
})

make_channel({
        name = "uhd1",
        input = { "t2mi://tdtuhd1", },
        output = { "http://0.0.0.0:17981/tdt/uhd1", },
})

Save astra.conf, and restart astra-sm

Code:
sudo systemctl restart astra-sm

12. Now we add another IPTV mux in TVHeadend using the output of Astra-SM. Configuration > DVB Inputs > Muxes > Add+

Network: Abertis
URL: http://127.0.0.1:17981/tdt/uhd1
Click Save.

Provided that everything worked, playing this new mux should play the TVE UHD mux, it may take a couple of seconds to start because of the decryption steps.
Uau , Thank Adam
We need Astra-sm only for this mux?
or is it necessary for all?
 

Adam792

Registered
Messages
101
Uau , Thank Adam
We need Astra-sm only for this mux?
or is it necessary for all?

Only for this mux, for the others just repeat steps 1 to 9 (modifying the respective services using tvh-json.py - e.g 11222H SID 3025 for PID 2025 and so on) and the first IPTV mux has the decoded channels :) I use PMT 8000 for everything, and make the Service ID equal to the Abertis PID.

As for the final error @Oskar3 I’m not sure about this sorry, it just worked for me in Ubuntu to build after installing the few dependencies.
 

markjose

Registered
Messages
169
Edited lambdb and all the steps for Enigma 2 the "services" part of my lamdb config disappears and i see these errors in the logs

Obvs no bitrate the transponder info stays but the serivices section for 802 gets removed.

I have tried editing with nano and in winscp

Nov 23 20:41:23 zgemmah9combo user.err astra[2119]: [10992plp0 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:23 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:24 zgemmah9combo user.err astra[2119]: [10992plp0 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:24 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:25 zgemmah9combo user.err astra[2119]: [10992plp0 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:25 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:26 zgemmah9combo user.err astra[2119]: [10992plp0 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:26 zgemmah9combo user.err astra[2119]: [10992plp0] Failed to switch to reserve Nov 23 20:41:26 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:26 zgemmah9combo user.err astra[2119]: [Abertis PID 802] Failed to switch to reserve Nov 23 20:41:26 zgemmah9combo user.err kernel: dvb_demux_feed_del: feed not in list (type=0 state=0 pid=ffff) Nov 23 20:41:26 zgemmah9combo user.err kernel: dvb_demux_feed_del: feed not in list (type=0 state=0 pid=ffff) Nov 23 20:41:32 zgemmah9combo user.err astra[2119]: [http_request 0.0.0.0:9999/abertis/pid802] receiving timeout Nov 23 20:41:38 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:39 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:40 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:41 zgemmah9combo user.err astra[2119]: [Abertis PID 802 #1] Bitrate:0Kbit/s PES:0 CC:0 Nov 23 20:41:41 zgemmah9combo user.err astra[2119]: [Abertis PID 802] Failed to switch to reserve
 

Ramboide

Registered
Messages
202
The transponder on Hispasat frequency 10922000, where PID 802 is, always disappears from lamedb; it seems impossible for this to remain in the file. I always disable Enigma2 with "init 4" and reactivate it with "init 3". when i edit the file.
 

Ramboide

Registered
Messages
202
I have edited and configured the transponder and all the service parameters, with dramboxEDIT, and I see that all the parameters are correct. I made all the other steps and still not working. I'm going to see if all the other parameters are still correct. I have been trying this with two receivers, an Edision OS mio 4K and an Octagon SF8004, but now I am configuring the Octagon.
Step 9 still not. I'm going to try this now.
I have done the steps 9 and the result is error messages in red.
 
Last edited:
Top