There was a problem loading the comments.

Example TV Server script: Scheduling TVs to turn off via RS-232

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

The IPTV 250m set-top box receiver can be used to send RS-232 commands to an attached screen via optional Encoded Media USB to RS-232 cable.

 

This KB Article details an example script which triggers the TV Server appliance to connect with every set-top box connected to it, and then have each box send the required RS-232 commands to power off an attached screen at a predetermined time.

 

The commands in the example script are specific to NEC MultiSync LCD4020 and LCD4620 displays, but can be adapted to suit any RS-232 compatible TV or panel by modifying the sequence of commands sent.

 

Though scripts are tested extensively, the downloading of example code either in whole or in part is done so entirely at your own risk. Encoded Media cannot accept responsibility for errors, omissions or unwanted behaviour arising from your use of example code.

 

The steps to initiate the script are as follows:

  1. Download the plain text file attached to this message.  Edit the HOUR_ON and HOUR_OFF values to reflect the hour of day during which you wish the commands to be sent.
  2. Access your TV Server console.
  3. Select Maintenance (5), then Advanced (4), then Launch Command Shell (3)
  4. Add a new hourly cron job by running the following command at the prompt:
pico /etc/cron.hourly/rs232
  1. Paste the contents of the text file you downloaded earlier and save the job by pressing CTRL+X followed by pressing Y to confirm.
  2. Now make the script file executable with the following command:
chmod a+x /etc/cron.hourly/rs232
  1. Next, edit crontab by running the following command at the prompt:
pico /etc/crontab
  1. Now edit the following line so that the first column is as follows:
0 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
  1. The number in the first column denotes the minutes past the hour at which the job will run. In the line provided above the job runs on the hour, every hour. For testing purposes, you can alter this number to trigger sooner.
  2. Save your new configuration by pressing CTRL+X followed by pressing Y to confirm.

* If you do not know the root password for the IPTV 250m set-top box, please raise a support ticket with Encoded Media by emailing support@encodedmedia.com

 

Example Scripts

Some example script files have been included below.

Attachments


Share via

Related Articles

© Encoded Media