Getting started

The following instructions will guide you through the setup and configuration of your stb-tester ONE appliance. If you need any help, please contact us at support@stb-tester.com.

We also have a short video that covers the physical setup and demonstrates the web interface.

Physical setup

images/external-connectors.png

Connect the stb-tester ONE as per the above diagram. Then press the power button on the front of the stb-tester ONE.

  • The infrared transmitter is self-adhesive; stick it over the set-top box’s IR receiver. This is a low-power transmitter (to avoid interfering with other set-top boxes in your test lab) so it has to be close against the IR receiver. Some set-top boxes are very sensitive to the placement of the transmitter; using a torch can help to find the position of the IR receiver behind the set-top box’s plastic case.
images/redrat.jpg

We may have also supplied a USB Infrared Receiver, shown at right. Do not plug this into the stb-tester ONE. It is only used when you need to record an infrared configuration for your system-under-test (we will explain this in Record your remote control configuration, below).

What is the stb-tester ONE’s IP address?

The stb-tester ONE’s MAC address is printed on a sticker at the front of the appliance. Ask your network administrator to assign a static IP address for this MAC address.

For example, if the front of the stb-tester ONE says “stb-tester-one-abcdef123456.local”, then the MAC address is “ab:cd:ef:12:34:56”.

Once you know the IP address, go to http://<ip address> in your browser.

Note

On Linux or Mac OS X, you can use the stb-tester ONE’s Zeroconf address directly in your web browser. This address is on the front of the stb-tester ONE. For example: http://stb-tester-one-abcdef123456.local

images/avahi-discovery.png

If you are running Linux, you can also find out the stb-tester ONE’s IP address by running avahi-discover and searching for “stb-tester-one-…”.

You can install avahi-discover with your package manager (apt-get on Ubuntu, yum on RedHat, etc).

Install software updates

Visit the stb-tester ONE’s user interface in your browser: http://<ip address>

images/install-now.png

When it boots, your stb-tester ONE will connect to our update servers and download a software update if there is one available. When it is ready to install, you will see a green banner like the screenshot above.

Press “Install software update”.

The stb-tester ONE will install the new software and reboot. This takes about 30 seconds in total.

Updating your stb-tester ONE is always safe; our software updates never introduce breaking changes. We have a separate mechanism for managing breaking changes.

Run a test

images/run-tests.png

The stb-tester ONE comes with some example test cases. Select one (or more) test cases and press “Run tests”.

While the test runs, you will see the status of the test in the right-hand side of the stb-tester ONE’s user interface.

This test will probably fail, because:

  • Your set-top box doesn’t understand the infrared signals that the stb-tester ONE is sending.
  • Your set-top box doesn’t behave in the way that the test case expects.

Don’t worry! Soon we will show you how to specify the infrared configuration for your set-top box, and how to write your own test cases.

View test results

When the test has completed, click on “Test results”, then select “master”. You will see the results of all the tests that have run before. Select a test to view a video recording, logs, etc.

images/results-view.png

Clone the test-pack git repository

(This section assumes a basic familiarity with git. See http://git-scm.com/ for downloads and tutorials.)

The stb-tester ONE’s configuration is stored in a git repository, along with the test cases (Python scripts).

Clone the git repository from the stb-tester ONE:

git clone http://<address>/git/test-pack.git

(where <adress> is the IP address or hostname of the stb-tester ONE – see What is the stb-tester ONE’s IP address? above).

Record your remote control configuration

images/redrat.jpg

The stb-tester ONE needs to know the infrared protocol that your system-under-test understands. To record this information you will need a Windows PC and the USB Infrared Receiver that you received with your stb-tester ONE.

Download the RedRat IR Signal Database Utility and install it on your Windows PC by following RedRat’s instructions.

Connect the USB Infrared Receiver to your Windows PC and install the RedRat3-II driver.

Now run the RedRat IR Signal Database Utility. Select Edit > New Device/Remote Wizard.

images/wizard.png

Follow the instructions in the Wizard to record the infrared configuration for your device.

When the Wizard asks you to press a button, press the button as briefly as possible. This is so that it doesn’t record a longer signal (when you play back a single button-press during a test, you don’t want it to look like a double press).

When you have finished, select your device in the RedRat window:

images/selected.png

Select Edit > Export Device/Remote > LIRC Format (Linux).

images/export.png

Save the file, then copy it to your test-pack git repository as test-pack/config/remote-control/<name>.lircd.conf (where <name> is any name to identify the remote-control or the set-top box).

We recommend that you name the remote-control buttons to match the Linux input-event-codes.h key names. You can change the names by editing the <name>.lircd.conf file. For example, instead of “0” use “KEY_0”:

  • KEY_0
  • KEY_1
  • KEY_2
  • KEY_3
  • KEY_4
  • KEY_5
  • KEY_6
  • KEY_7
  • KEY_8
  • KEY_9
  • KEY_AUDIO
  • KEY_BACK
  • KEY_BLUE
  • KEY_CHANNELDOWN
  • KEY_CHANNELUP
  • KEY_CLOSE
  • KEY_DOWN
  • KEY_EPG
  • KEY_FASTFORWARD
  • KEY_GREEN
  • KEY_HOME
  • KEY_INFO
  • KEY_LEFT
  • KEY_MENU
  • KEY_MUTE
  • KEY_NEXT
  • KEY_OK
  • KEY_PAUSE
  • KEY_PLAY
  • KEY_POWER
  • KEY_PREVIOUS
  • KEY_RECORD
  • KEY_RED
  • KEY_REWIND
  • KEY_RIGHT
  • KEY_STOP
  • KEY_SUBTITLE
  • KEY_TV
  • KEY_UP
  • KEY_VOLUMEDOWN
  • KEY_VOLUMEUP
  • KEY_YELLOW
  • KEY_ZOOM

Commit and push your changes

Commit the new or changed file to your git repository:

git add config/remote-control/<name>.lircd.conf
git commit

And push your change to the stb-tester ONE:

git push

Test your new infrared configuration by going to the Manual control section of the stb-tester ONE’s user interface:

images/manual-control.png

Write a new test case

The following instructions are also available as a video here.

Test cases are Python functions

Test cases are Python functions stored in the test-pack git repository under tests/*.py. The function name must begin with test_ (for example test_that_pressing_EPG_opens_the_guide).

Edit test-pack/tests/example_test.py (or create a new Python file in that directory) and create your own Python function. In the test case you can use the following functions:

  • stbt.press("KEY_EPG") to send an infrared key-press. You can use any of the key names from the previous section (Record your remote control configuration) if you recorded the corresponding signal from your remote control.
  • stbt.wait_for_match("guide-logo.png") to search for an image and fail the test if the specified image isn’t found within 10 seconds. See Screenshots below for how to create these images.
  • stbt.match("guide-logo.png") is like wait_for_match but instead of failing the test, it returns a false value if the image isn’t found. You can use this to implement more complex logic in your tests.
  • stbt.wait_for_motion(mask="channel-patch-mask.png") searches for motion and fails the test if it doesn’t detect motion within 10 seconds. You can specify an optional mask image to specify which areas of the frame to ignore.

For more details, see the stbt Python API reference.

Screenshots

images/screenshot-button.png

Press the Screenshot button underneath the live video view in the stb-tester ONE user interface. This will take a screenshot from the system-under-test as a PNG file.

Save the screenshot into your test-pack git repository under test-pack/tests/. Open the image in your favourite image editor (for example Paint on Windows, Preview.app on OS X, or Gimp on Linux). Crop the image so that it only contains the part that you want to match in your test case.

The image you give to stbt.wait_for_match in your Python code is a relative path from the Python file itself. For example you can put your images in test-pack/tests/images/ and use stbt.wait_for_match("images/name.png").