Slinke Python Linux Support Tidbits

Eric Woudenberg
May, 2000

Here are a few collected goodies for people wishing to use the Nirvis Slink-e box under Linux/Python. I have tested it with Python 1.5.2 and Linux 2.2.14 and it runs fine.

Table of Contents

User Manual

First, a Slinke user manual "for the rest of us." It uses frames and dispenses with the java-script fold-up Table of Contents buttons which didn't work right for me under Linux/Netscape. I created it by running this python script in the Slinke "help" directory.

Python Slink-e Controller Class

Next, a Python "Slinke" Class ("slinke.py") which can be incorporated into Python programs for controlling a Slink-e device. It can read-in and use Nirvis devices files. It can also read and write simple Python "pickle" based code files if all you want to do is memorize new remote codes and play them back.

Class Methods

To learn how to use this class, I recommend reading the the "main" and "test" routines at the end of slinke.py, which are implemented with it. Here is a listing of its public members:

Standalone Slink-e Controller Program

If the slinke.py Class program is run standalone, it functions as a simple Slink-e controller. Here is the help message:

Slinke control program, usage:

slinke.py [options] learn | do | tty | test | nop [buttons]

  commands:
    learn <button>      ; learn IR code from remote,
			wait for  button to be pressed and store it as <button>

    do <button> [<button> ...]
                        ; send IR codes, given button names

    tty                 ; send IR codes read one per line from tty

  options:
    -s seconds  ; set intercode delay (default 0s)
    -f codefile ; set button code file (default 'device_files/Sony/dvd3.cde' or 'dvd.codes')
    -S          ; use control-S (baseband) coding
    -P          ; use simple pickle type helper class (supports 'learn' command)

  buttons:
        symbol names from button files   

Examples

Connecting your Slink-e to Linux

It is important to follow the Nirvis directions for making the serial connection. Here are some points to bear in mind.
  1. You must connect the CTS (clear to send) flow control line, otherwise you will overflow the Slink-e's internal buffer and things will not work.
  2. The control program must turn on RTSCTS handling (for the reason listed in 1). Slinke.py does this for you with an "stty" command during initialzation.
  3. I connected the Slink-e to /dev/ttyS0, you will need to change slinke.py if you use a different port for your serial connection.
  4. I found that my Slink-e would receive spurious codes occasionally, especially in sunlight or with bright fluorescent lights. The slinke.py software is designed to ignore them in general, but it can get confused if you are trying to learn new codes. I found it easiest to keep black tape over the IR reciever port and uncover it whenever I needed to learn new codes.

Good luck! I hope you find this helpful, and of course I'm always interested in your comments.