Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £99! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £149! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

Check if a channel can tune in with a bash script

Let's say a channel I am recording from every day changes service reference and I have a script that runs every day to check the SNR of that service reference. Surely the service reference my script is checking for will have SNR = 0 for a day or two after the channel I need finally leaves that sRef?

If the SRef changes and the old transponder remains active the returned SNR will appear normal.
 
This is what I get

working on 11222MHz, Vertical
Service reference = 1:0:1:CFA2:83A:2:11A0000:0:0:0:

Code:
http://192.168.1.179/api/zap?sRef=1:0:1:CFA2:83A:2:11A0000:0:0:0
{
 "result": true,
 "message": "Active service is now '1:0:1:CFA2:83A:2:11A0000:0:0:0'"
}


http://192.168.1.179/api/tunersignal
{
 "tunertype": "DVB-S",
 "tunernumber": 0,
 "snr": 68,
 "snr_db": "11.04",
 "agc": 98,
 "ber": 0,
 "inStandby": "false"
}


Not working on 11641 Mhz, H
Service reference = 1:0:1:1BC0:835:2:11A0000:0:0:0:

Code:
http://192.168.1.179/api/zap?sRef=1:0:1:1BC0:835:2:11A0000:0:0:0:
{
 "result": true,
 "message": "Active service is now '1:0:1:1BC0:835:2:11A0000:0:0:0:'"
}


http://192.168.1.179/api/tunersignal
{
 "tunertype": "DVB-S",
 "tunernumber": 0,
 "snr": 71,
 "snr_db": "11.50",
 "agc": 98,
 "ber": 0,
 "inStandby": "false"
}
 
The suggestion I gave earlier is easy for someone of your abilities. All you would be doing is checking if your service reference exists in the output file. If it doesn't exist, then send an e-mail

To recap
1. Add the mix file so it creates the csv file. You will have to adapt it so the date added to filename does not change.
2. Read the file and check if you reference exists
3. Apply your true/false instructions

A sample mix file is here:
https://github.com/davesayers2014/CustomMix_Files/blob/master/Standard/sat_282_sky_uk_CustomMix.xml

A line in the output file is
Code:
BBC One Lon HD,1:0:19:287B:800:2:11A0000:0:0:0:,BBC One Lon HD,101,3000,0,BSkyB,0x287b,0x800,25,#SERVICE 4097:0:19:287b:800:2:11a0000:0:0:0:,287B_800_2_11A0000

Alternatively, check the example file abm creates
/etc/enigma2/AutoBouquetsMaker/custom/EXAMPLE_hd_sat_282_sky_irl_CustomLCN.xml

For example, BBC One Lon HD will be
<configuration lcn="101" channelnumber="101" serviceid="10363" channelid="3000" description="BBC One Lon HD"></configuration>
If it changes transponder, the service ID should change
 
Last edited:
The suggestion I gave earlier is easy for someone of your abilities. All you would be doing is checking if your service reference exists in the output file. If it doesn't exist, then send an e-mail

To recap
1. Add the mix file so it creates the csv file. You will have to adapt it so the date does not change (line 258)
2. Read the file and check if you reference exists
3. Apply your true/false instructions

A sample mix file is here:
https://github.com/davesayers2014/CustomMix_Files/blob/master/Standard/sat_282_sky_uk_CustomMix.xml

The output would be
Code:
BBC One Lon HD,1:0:19:287B:800:2:11A0000:0:0:0:,BBC One Lon HD,101,3000,0,BSkyB,0x287b,0x800,25,#SERVICE 4097:0:19:287b:800:2:11a0000:0:0:0:,287B_800_2_11A0000

You can edit the mix file to only create what you want/need. Huevos helped add most those details for my work with picons.

Alternatively, check the example file abm creates
/etc/enigma2/AutoBouquetsMaker/custom/EXAMPLE_hd_sat_282_sky_irl_CustomLCN.xml

For example, BBC One Lon HD will be
Code:
<configuration lcn="101" channelnumber="101" serviceid="10363" channelid="3000" description="BBC One Lon HD"></configuration>
If it changes transponder, the service ID should change
 
Last edited:
Alright, you guys have convinced me.
There are too many reasons my quick and dirty script could not be relied upon.

I'm gonna look at ABM and those mix files this weekend.

Hopefully this won't be days and days of work like all my homelab scripts end up taking!

Cheers,

Flex
 
In my lamedb I have one Islam TV with service reference:
1_0_1_CB35_813_2_11A0000_0_0_0_
https://www.lyngsat.com/muxes/Astra-2G_Europe-Ku_11112-H.html
In your lamedb there are two Islam TVs with service references:
1_0_1_CFA2_83A_2_11A0000_0_0_0
1_0_1_1BC0_835_2_11A0000_0_0_0
https://www.lyngsat.com/muxes/Astra-2G_Europe-Ku_11224-V.html
https://www.lyngsat.com/muxes/Astra-2G_Europe-Ku_11641-H.html

1_0_1_CFA2_83A_2_11A0000_0_0_0 - only this OK
 
Just wanted to update this thread to say I ended up writing a python script to scrape https://en.kingofsat.net/news.php?filtre=Clear&pos=28.2E for frequency changes to named channels. It runs a few days a week in a cron.

That link announces when channels on Astra 28.2E start transmitting at a new frequency and separately announces when a channel stops transmitting at a certain frequency. There usually seems to be a week or so between each event. Probably not all channels transmit simultaneously on multiple frequencies but I mostly make timer recordings on the major channels which seem to work it like this for a few days when they change transponders.

This way I have time to scan the channel at its new frequency, delete and re-create the corresponding Timer recording... before it stops broadcasting at its old frequency.

Cheers,

Flex
 
You could also stop Enigma2 with "init 4", then edit auto/timers, transfer back, and restart. Only the service reference needs changing.
 
Auto timers create timers. I used the slash to indicate both. Your wording is better, thanks.
 
@abu baniaz
Are you suggesting I update the Timer in the python script?
Do I not need to tune the channel in on the new frequency first and add it to my channel lists?
Or only need to update the sRef in the Timer and it will find that channel anyway?

This is an example announcement on the KingOfSat page for the change to the transponder of ITV2+1 last Nov 2024:
Code:
Sky Digital: New frequency for ITV 2 +1: 11343.50MHz, pol.V (DVB-S2 SR:27500 FEC:2/3 SID:55281 PID:2389[MPEG-4]/2391 nar,2390 English- Clear).

There are some methods in the OpenWebIf API I could use to update a Timer programmatically.
timeradd
timerchange
timerdelete

But how do I create a service reference from the KingOfSat information? Can I or no?

For Enigma2 the sRef format is:
Code:
1_0_<A>_<B>_<C>_<D>_<E>_0_0_0

A = service type, “0” for radio, “1” for TV, “3” for data
B = hex service ID
C = transponder SID (i.e. MUX number)
D = transponder NID (i.e. network ID)
E = service namespace:
 for Astra 2A/2B/2D, E = "11A0000"

I'm only interested in TV channels on Astra 28.2E so I only really need two things: the service id and the transponder service id.

Code:
1:0:1:[SID]:[TSID]:2:11A0000:0:0:0

But KingOfSat only supplies the SID (55281)?

I could do a hack where I scrape https://en.kingofsat.net/pos-28.2E.php with the frequency (e.g: 11343.50) then take the TSID from the html table (2112) then assemble an sRef after a bunch of hex conversions.

Shame they don't include the TSID as well as the SID in the transponder change announcement!

Flex
 
You need to scan the new transponder so details are added to lamedb. If an entry is not in lamedb, the receiver will not tune to it. (As you are going to ask, yes you can edit lamedb instead of scanning, but lets keep things simple.)

I was suggesting you just edit the service reference in the timer files so that you don't have to use your remote to set it again. I had a text editor in mind. But, yes you can do it by script. I don't know how you would get the details from kingofsat. They are present on LraiZers wiki. You don't have to use his website, you can install it on your receiver and let it upload to your website.

I was thinking of editing the files on the receiver, not about using openwebif. (timers.xml and autotimer.xml Both in /etc/enigma2) The timer change function will obviously be easier. I know nothing about it.

Edit:
The wiki page you want is here:
http://commando.org.uk/wiki/bskyb/sdt.html
 
Last edited:
Whatever you are doing how do you know channel X is replaced by channel Y?

Only way to know for sure is compare self against channel ID.
 
Thanks @Huevos

That's my concern with the autobouquetswiki approach. It's a really useful resource but it's retrospective information. The updates pages are able to tell you that a channel has changed frequency because it is no longer transmitting on the frequency it was transmitting on yesterday. If I rely on that approach I will almost certainly loose at least a day or two of my Mon-Fri timer recordings, depending on how quickly I can update my box.

Also, my script could query this autobouquetswiki page daily but again if I am querying based on a sRef then I only know something changed after the fact. Another option would be to keep track of how many sRefs a channel broadcasts on and is there one more or one less today then expected etc.. that logic will fall apart with test channels and be unworkable where channels already transmit on multiple sRefs anyway.

I don't know if the KingOfSat Astra 28.2E updates page is much more reliable but at least I only have to query it for a change to a channel by channel name and not have to keep track of sRefs and how many sRefs were there before and now many now etc.. From what I saw on that KingOfSat channel updates page the "big name" channels always have a period of overlap where they broadcast on an outgoing and incoming frequency simultaneously when embarking on a frequency changeover.

On this date they announced that ITV 2+1 started on a new frequency and then on this date they announced that it stopped transmitting on the old frequency. So I would have had about 2 weeks to update my Timer while that channel was transmitting on both frequencies.

Flex
 
Last edited:
King-of-sat is retrospective also. First someone reports a change then someone else checks it and updates the site.
 
On 24th Oct 2024 KingOfSat announced that ITV2+1 started to broadcast on a new frequency.

On 7th Nov 2024 KingOfSat announced that ITV2+1 ceased broadcasting on the older frequency.

I took a look through the autobouquetswiki Updates archive. I checked every day from the 1st October 2024 right through to the 7th Nov 2024. It has no record of any changes to ITV2+1 until 7th November 2024 when that channel stopped broadcasting on its old frequency. By this time it had already being broadcasting on its new frequency for 14 days.

On 7th Nov 2024 the autobouquetswiki Updates archive mentions two things about ITV2+1: that it has stopped broadcasting on its older frequency and that it has started broadcasting on its new frequency.

I have not read through the autobouquetswiki sourcecode... I am not that good at programming and it doesn't help that this project has pretty much ZERO documentation.

But from what I can tell it looks like the logic within autobouquetswiki is that it currently is not designed to detect and report when a new channel frequency is ADDED to Astra 28.2E but only when an existing frequency, that it already knows about, is REMOVED.

I don't know how retrospective are the channel updates on the KingOfSat website are but they seem to offer me a more reliable way of signposting that a channel I have in a daily Timer recording is likely to stop transmitting on that frequency in the coming days. More reliable because I have time to act and change my timer recordings as opposed to having no time to act because the channel has already stopped broadcasting on the frequency that is in my Timer recording.

If I am still misunderstanding something please let me know.

Cheers,

Flex
 
strange story because I never had to change timers when a channel gets a new frequentie.Just adapt my channel in the bouquet and timers continue to work fine
 
The channels when they launch in test mode don't have names, they are just service IDs, when they take a name when they replace the channel. So won't be good for you. Sorry.

Terrestrial frequencies don't change as often as satellite if that is of any use to you
 
Yes I have read that post.

I have a Timer recording than runs every week day, Monday to Friday.
In my case my goal is to have a method whereby I can be notified of an upcoming channel frequency change....... in advance of that frequency change. Otherwise I will probably miss one or more days of recordings. I find this very annoying.
As a human being I don't work with Channel IDs I think in terms of the Channel name that is in my Timer recordings.
With the KingOfSat approach my script can "listen in" for announcements about changes to the frequency of a channel by the channels name.
The way channel update announcements work on KingOfSat I have the option to know about an upcoming channel frequency change BEFORE it occurs so I have the chance to update my timer and not miss any timer recordings.
The autobouquetswiki wouldn't tell me anything about the channel frequency change until it has already occurred and now my Timer went for one or more days not recording my favourite daily TV show.

I'm sure you still think I have this wrong though. If so please come back to me.

Flex
 

OpenViX Feeds Status

Back
Top