Schedule Entry Rename – How?

Black Hole

May contain traces of nut
I have the "obligatory" 4.20am scheduled reminder (see spoiler) set on a supported-user's HDR-FOX, and she would like it to be running GB News (takes all sorts) first thing instead of coming up Red Button (24/7 operation, so Boot Settings are not particularly useful).

In order to change the service number for the reminder schedule, I needed to use the SUI: Guide >> Schedule (yellow). This then picked up the programme name in the EPG for the first occasion the reminder is valid, and this will be the name attached to that reminder until the schedule entry is manually edited again (regardless of what the EPG might say on successive occasions). It can't be edited in WebIF >> Schedule (and neither can the other details of the manual entry, except to delete it).

I'm not an SQL aficionado, but I presume there is an incantation I can use on the command line... please? I would like to give it a display name such as "Do not delete!"!

It would be nice if these functions were available through WebIF >> Schedule.

  • Neuters the 4.30am OTA firmware update scan, which otherwise makes the HDR-FOX (and HD-FOX) unusable for about 10 minutes (even though there are no updates broadcast any more), and prevents an unwanted update occurring and wiping out the CF (but this is no longer a "thing").

  • Provides an EPG update were the unit to be in standby for a long period of time.

  • Having at least one permanent entry in the recording/reminder schedule avoids problems with auto-schedule-restore (which can automatically recreate the schedule after a retune or startup wizard wipes the schedule, but only on reboot).

  • I really should add a consecutive reminder on a different mux to ensure EPG doesn't go stale on a 24/7 set-up.

  • Idling on Red Button (or some other data-only service) ensures minimum HDD activity.

  • More info: Preventing External Events from Disturbing the CF; AR & Padding 101.
 
Last edited:
The event schedule belongs to the settop program, so you must either modify the entry in the startup before the settop program has (fully) started (ie, xinit-time) or using RTS (nugget). Then you have the problem of finding the entry that has to be changed.

Possibly a script on these lines:
Code:
#!/bin/sh

# parameter 1: event name (quoted on command line to preserve whitespace)
evt="$1"
[ -n "$evt" ] || { echo "Usage: $0 event_name"; exit 1; }

echo Committing from the settop program - should say OK ...
nugget schedule.save
# update the (any) schedule entry matching $evt
# - create the command
sql_cmd="$(printf "attach '/var/lib/humaxtv/rsv.db' as rsv; update rsv.TBL_RESERVATION set szevtname = 'Do not delete!' where szevtname = '%s'" "$evt")"
echo Updating reservation ...
echo "${sql_cmd};" | sqlite3 && echo OK
echo Reloading to the settop program
nugget schedule.load
In case the event name to be changed contains a single quote, double it for use as a sqlite3 literal.
 
If there are difficulties with the implementation of the SQL there is another possible approach.

You could created a dummy data channel tuning on the BBC A mux called "Do not delete!". As there would be no transmission of that channel the channel name would not be changed by the epg broadcast and any reminder set to that channel would be given the title of that channel i.e. "Do not delete!" .

To create the dummy data channel prpr's CLONE1 command would be something like:

CLONE1|99|Do Not Delete|<Unique>|1|1|1|0|0|<Unique>|8192|8192|8191|<usTsId>|0|1|fp.bbc.co.uk

Parm 0: "CLONE1"
Parm 1: LCN
Parm 2: Channel Name
Parm 3: usSvcId UNIQUE
Parm 4: eSvcType
Parm 5: eVideoType
Parm 6: eCasType
Parm 7: ucVideoCodec
Parm 8: ucAudioCodec
Parm 9: usPmtPid UNIQUE
Parm 10: usVideoPid
Parm 11: usAudioPid
Parm 12: usPcrPid
Parm 13: usTsId Use same value as other channels in the BBC A mux
Parm 14: ? Always 0
Parm 15: eOrgSvcType
Parm 16: aucDefaultAuthority

The values for parms 3, 9 and 13 can be decided on by examining table TBL_SVC via the WebIf diagnostics' Database Browser, either on the target HDR-FOX T2 or one tuned to the same transmitter as the target HDR-FOX T2.

Once you have evaluated the values for CLONE1 it can be injected by
EITHER
tunefix-update to insert via its config file
OR
use /mod/boot/tunefix.conf (but if your channel name includes multiple consecutive spaces DON'T save the main UI for tunefix afterwards otherwise repeat spaces will be removed).

With the absence on any defined boot channel this will result in the dummy channel being tuned to at first switch on of the day and result in the error message "/!\ No programmes are currently being broadcast on this channel.". The boot-setting package can be used to get around that possible cause of confusion.

1671622243736.png
 
Last edited:
In maintenance mode, settop isn't running so that would give access (but with no assistance from WebIF). On the other hand it might be possible to stop the settop process from the command line and still retain full WebIF functionality?
 
Stopping the settop process causes the system to restart in normal mode. As discussed elsewhere, the Linux startup is rather strange in that the system never actually gets out of the startup procedure but just starts running the settop program in that procedure.

The script I suggested works (at least the individual steps did when I tried them) while settop is running, provided that:
  • RTS is enabled
  • settop doesn't update the reservation table between the two calls to nugget**
  • you know the event name of the reservation to be renamed.

The tricky part is to identify the reservation that you want to rename. You might for instance try to find a reservation on a particular channel that starts in a certain time window. As the channel that you see in the UI isn't in TBL_RESERVATION, it has to be joined with TBL_SVC in channel.db on the common column hsvc. All of this, and the original script, might be easier and more robust in Jim using the Webif classes that encapsulate access to the schedule.

**
Depending on how the nugget hook works with the settop program, there is a possible explanation for lost events when using RTS.

Let's suppose that the nugget hook uses a similar procedure:
1. flush the settop copy of the reservation data to the DB
2. update the DB
3. reload the modified reservation data.

Unless there is a check at step 2.5 that the settop program hasn't independently updated the reservation data, eg at the end of a recording, the settop program's changes will be overwritten. It would be possible to compare the settop program's copy against the originally flushed copy at the start of step 3 and restart from step 1 if it differed; but unless a lock can be taken against the settop program it could in general be possible for a race condition to occur in the window between the consistency check and the reload. The specific case that would override the general is if the invocation of the nugget hook always happened in a single thread of the settop program that managed the reservation data: then the nugget processing might block any updates generated by the settop program.
 
I shall have a play, but what am I looking for in terms of "event name" as the input parameter?
 
The programme name set from the EPG.

But I have an event (a manual weekly reminder on BBC News) that maintains the name "Weekly EPG refresh" so maybe all this is a lot easier. Is it the case that the SUI manual event is subtly different (has no intrinsic name?) and gets updated by the EPG when it's scheduled, while a WebIf manual event is given its own name that isn't overridden?

Try deleting the existing reservation and then creating the GB News reservation as a Webif manual event named "Do not delete!".
 
Good point! That works (on my HD-FOX, anyway), and should achieve what I need to do.

Hopefully posts 3 and 4 provide options for anyone looking to rename a non-manual event.
 
Back
Top