BlinkenBone setup - Testing the "Blinkenlight API" high-level interface

Parent Category: Projects Category: BlinkenBone - How to connect a console panel Written by Administrator

After you have connected the panel to a BlinkenBoard, the panel must be published over the "Blinkenlight API" network interface. 

mark matlock ready


For simulator programs like SimH, the panel is accessed as a set of "controls" over a client/server network interface. See here for the concept.

The Development Cycle

To develop a "Blinkenlight API" interface for your panel, you must repeat these steps:

1. Login to the BeagleBone, all further work is done under the Angstrom Linux

2. Stop the "blinklightd" server on the BeagleBone (he is started automatically after power on).
You do this by getting its process id and then killing it:

root@blinkenbone:~# ps | grep blink
 80 root      2004 S    /home/root/blinkenlightd -c /etc/blinkenlightd.conf -b
102 avahi     2936 S    avahi-daemon: running [blinkenbone.local]272 root      2116 S    grep blink
root@blinkenbone:~# kill 80

3. Edit the configuration file

The configuration file is explained here. You should make a local copy of/etc/blinkenlight.conffor editing.

4. Test the configuration file for syntax errors.

The demon (which reads the configuration file) has also a "test" option:

root@blinkenbone:~# ./blinkenlightd  -c blinkenlightd.conf -t

After read-in a dump of the file is produced. Any syntax errors are show first, so you have a big way to scroll up to get back to the first output line ... sorry for that inconvenience.

5. Start the server demon with the new configuration file

Open a new terminal window to do this, then type

root@blinkenbone:~# ./blinkenlightd  -c blinkenlightd.conf
[22:56:42.187] *** blinkenlightd v1.07 - server for BeagleBone blinkenlight panel interface ***
[22:56:42.188]     Compiled Sep  8 2013 22:26:41
[22:56:42.189]     Copyright (C) 2012-2013 Joerg Hoppe.
[22:56:42.189]     Contact: This email address is being protected from spambots. You need JavaScript enabled to view it.
[22:56:42.189]     Web:
[22:56:42.231] Starting Blinkenlight API server

This starts the server in foreground mode (after reboot, he is started as background process). The server will run until you hit ^C. No further output is shown.

6. Run test client program "BlinkenlightApiTest"

Start the test program with:

root@blinkenbone:~# ./blinkenlightapitst localhost

BlinkenlightApiTest connects with the server and lets you control the panel. This tests everything:

  • the network interface between client and server
  • the configuration file
  • and the wiring of your panel

At first run BlinkenlightApiTest from the BeagleBone itself, then you have to connect to "localhost". You have lot of options, see below. Be sure to test every single control (lamp or switch).

7. repeat from step 2 until ready

8. Implement the changes

If everything is working save the configuration file as "/etc/blinkenlightd.conf" and reboot.

Then perform step 6 one last time.

You do not need to make a backup of the configuration file ... neither human nor technical errors ever happen on the BeagleBone Linux platform (try not to laugh while saying this!)

9. Access the panel through your network from other hosts.

This step is optional, you can skip it if if you only plan to run SimH locally on the BeagleBone itself. Then testing connection to "localhost" is all you need.

Otherwise you can should run "blinkenlighttapitst" from a x86 Linux or Win32 system and try to remote control the panel from there.


Operating "BlinkenlightApiTest"

BlinkenlightApiTest is THE test program for the BlinkenBone system.

  • It is a client for the blinkenlight server daemon.
  • It gives complete manual control over the connected panels
  • It contains the same libraries which are used in other clients (like SimH).
  • It is available for ARM7 Linux, for x86 Linux and Win32, so it can verify a broad range of network setups.

Test network contact to server

BlinkenlightApiTest has a special function to just "ping" the Blinkenlight API server. Use the command line

blinkenlightapitst -p 10 <hostname>If you run on the BeagleBone, the hostname is "localhost". For example:

root@beaglebone:~#  ./blinkenlightapitst -p 10 localhost


*** blinkenlightapitst v1.05 - client for BeagleBone Blinkenlight API panel interface ***
    Compiled Aug 26 2013 16:36:44
    Copyright (C) 2012-2013 Joerg Hoppe.
    Contact:  This email address is being protected from spambots. You need JavaScript enabled to view it.

Pinging Blinkenlight API server on host localhost ...
Blinkenlight API server on host localhost is alive.If you see this message, network and RPC connectivity is OK.

Panel test: Start and main menu

Start blinkenlightapitst by specifiy the server to connect to, and the optionally the screen width of the terminal.

root@blinkenbone:~# ./blinkenlightapitst -w 80 localhost

Then the main menu appears:

apitest start


BlinkenlightApiTst is a pure text application. You select a menu item by typing one of the commands listed.

In the main menu there are these menu items:

  • most important are the items with numerical command characters (or "panel id") . These are sub menus for access to different panels. The server can support many panels in parallel, but mostly there will be only one panel, so a "0" (zero) is displayed.
  • "info" (gives information about the server process.
  • "enable" and "test" are seldom used.

To test a panel enter its id:

>>> 0 <ENTER>

The panel sub menu appears:

Panel sub menu

apitest 1170

A list of all control of the panel is displayed. (This is the information you entered into the configuration file.)

  • the upper half shows the status of all "input controls", meaning "switches". These data is pure informational. To change them, you must operate the physical panel.
  • the lower half shows all output controls. Each has a "control id" assigned, which you can use as command char to change the value of the controls.

All values are displayed in the number system set in the configuration file. In the DEC world, this will be "octal".

Query THE value of an input control (=switches)

The value of the inputs is updated every time you press <ENTER>. Then the menu is displayed again with new values.

For example, set the data  switches of an PDP-11/70 panel as in the picture. In the configuration file all the data switches are grouped together as one control with name "SR" (DEC's name for "Switch Register".)


apitest panel sr=12345670

So after pressing <ENTER> you see the changed value here. If a control value changed against the last menu display, it is marked with an '!'

apitest sr=12345670

The "!" disappears, if you hit ENTER a second time.

Setting the value of an output control (LEDs)

You also can control the LEDs. For example, if you want to set the DATA LEDs to (octal)123456, look which "id" they have (here it is "1"). Again the name "DATA" is defined in the configuration file. At the ">>>" prompt type

>>> 1 123456<ENTER>

apitest dataled=123456

The updated display shows the new value, and the physical panel should also respond:

apitest panel dataleds=123456



If you test your wiring and your configuration file, you must test every single switch and every single LED.

For input switches, there's no possibility to make your life easier: you must switch them yourself, and hit <ENTER> again and again.

But for output controls, there are some options to generate patterns for you:

  • "mo" and "mz" let a single "light" or a single "black hole" move through all bits of an output control.
  • "i" inverts the bit patterns of an output control.

Setting all output controls at once

If you use "*" instead of a certain control id, you can set all controls to the same value. Most use ful is

>>>* 0

which clears all LED controls.

And be sure to show your friends

>>>* mo