Programming in the dark

By Hans Schou <blind@schou.dk> November 2001. Proof reading by Vibeke Olsen.

There was not a Linux driver for this terminal, to be found on the net. We know the rules: either you make one yourself, or you are lucky to get help from someone on the net who knows how to do it. We were lucky - Dave Mielke wrote a new driver within only two days and it was working right out of the box.

It might have been easier for Dave Mielke, if he actually had the hardware in front of him. But as Dave Mielke lives in Canada and we in Denmark (Europe) and he had no device, he had to do it in blind - so to speak. Well, Dave Mielke is actually 100% blind, so the C program really was written in the blind.


Braille display

When a blind person uses a computer, it can be done with a standard QWERTY keyboard and speech module, or he can use an electronic Braille display. A Braille display has fewer keys than a QWERTY keyboard and the display has only got one row and 18 columns. The pictures show a LogText with 32 columns and a Braille Lite with 18 columns. The LogText has 19 keys and the Braille Lite has 9 keys. That's all. To compare this with an old terminal, which had 80x25 characters on the screen and 100 keys on the keyboard, this Braille display is quite limited but easy to get an overview of. In the early 1980's we were lucky if we had this kind of terminal with 80x25 characters. Today, blind people feel lucky if they have 9 keys and 18 characters. A braille display is a great thing - if you have a driver for it.

Picture: LogText
LogText
  Picture: Braille Lite
BrailleLite

Linux drivers

No crying here - you know how it is. If you have some special hardware and there is no driver, you either have to write it yourself or get someone to do it for you. Of course we could find Linux drivers for braille displays on the net and we easily found one for Braille Lite. Thomas Sørensen, which is a new blind Linux user, had borrowed Braille Lite and could get started with Linux. But we had to find a solution that would last into the future. Thomas Sørensen has another Braille display, the LogText, but there was no driver for it. The LogText is from a Danish company and is almost only used in Denmark. As there are no 100% blind Linux users in Denmark and the LogText is manufactured in Denmark there was of course no driver for this display.

How hard can it be? Get the documentation for the device, do some testing and write a driver. The documentation was just a phone call away and one day later I got it - on paper. As the documentation was written in Danish, I knew I had to translate it anyway, so that was not a problem and luckily it was only one page. This one page documentation was only a description of the protocol and when it can fit on one page it cannot be that hard to implement. The Braille driver BRLTTY had all the functionality, which should be used, so it was obvious to start with that.

BRLTTY

Dave Mielke has been the maintainer of BRLTTY since June 2001. He responded very quickly on our request and asked if he should write the driver. Having Dave as maintainer is sure a good idea. He is 44 years old and has started with programming in the early 1970s. His programming language skill touches C, C++, Java, Pascal, Algol and PL/I. This was done on mainframes, mini-computers, workstations - you name it - he has been there. During the past two years he has submitted patches, so he is not a newbie to the BRLTTY project. At daily basis Dave maintains the configuration management system (software and documentation) for Nortel Networks but he has also carried out the development of low-level drivers too. All in all, it looks like the BRLTTY is in good hands.

Since it can be just a little difficult to write a driver for hardware you do not have, we asked Dave Mielke for advice on which driver we should base the LogText on. Dave Mielke wrote that the LogText was rather simple to implement compared to the other drivers. So it would be much easier to write a new driver from scratch. We went along with that and asked Dave for help on 17th October 2001.

Despite the fact that, Dave Mielke lives in Canada, a country with a time difference of six hours away, we got a lot of questions from Dave an hour after sending the first mail. What is the baud rate? How many keys does it have? How does it look? How it looks was quite easy to answer, so we send a photo of it. Dave did not respond to the photo but asked again. Then we had to ask the silly question: Are you blind? And yes, Dave Mielke is actually 100% blind and has been so since he was 2½ years old because of an eye problem (familial exudative vitreoretinopathy). He can feel pain in his eyes when he looks directly at the sun, that's all.

"Well, can you 'see' ASCII art?" Here is the drawing I send Dave - you can compare it with the photo of the LogText. Each key is named with one character, which were explained elsewhere.

  LCDLCDLCDLCDLCDLCDLCD
        321 456
      C7   u   8A
          ljr
       L   d   R
e BRAILLEBRAILLEBRAILLE e

Based on this drawing and a lot of mails during the day, Dave made the first version, which I reviewed and commented. Dave wants to emphasize that without my quick response and peer review he could not have made the driver so quickly.

Thomas Sørensen who owns the LogText was not at home that day, so on Thursday the 18th of October 2001 was also used for more coding and discussion. Thursday evening I got hold of Thomas on the phone and asked him to call up the Internet, so I could login to his laptop. Making and installing the alpha-version of the driver was as simple as it used to be. Thomas had to use the Braille Lite to dial up the Internet, so I asked him to disconnect and attach the LogText to the laptop. A critical step if we lost the connection to the Internet, as Thomas would have problems with dialling up without the right driver. However, that was not a problem - the driver worked out the first time round! While we were looking at the debug log file, we discussed the testing over the phone. Of course there were problems with the translation tables the first day, especially because we use some funny letters here in Denmark (æøå), but the driver worked very well.

We were quite impressed. Dave Mielke wrote this driver in only two days together with taking care of his wife, seven daughters and six sons. Without having the hardware in front of him and then having to program in the dark. Without detailed description. Without being able to see - which we guess to Dave is not a problem. And the LogText driver is the second BRLTTY driver Dave Mielke wrote from scratch.

Daves tools

The secret must be in the tools Dave uses. The OS is Linux. The compiler is gcc. The editor is vim. The mail program is pine. The browser is lynx. These are not much different from the tools we use ourselves. Then it must be the 80 character Papenmeier Braille display Dave uses - I might get one of those despite the fact that I can see - or maybe I should just get the same skills as Dave ;-)

Picture: Papenmeier
Papenmeier. Not exactly the braille display Dave Mielke use but it is similar. Photo from: http://www.papenmeier.de/reha/products/el2d_80.JPG

Many thanks to Dave Mielke who wrote the LogText driver in two days and specially also to Nicolas Pitre who have maintained BRLTTY since 1995!


Braille - characters used by visual impaired

Braille is mostly know as raised dots on paper and the Braille display is just an electronic device which raises dots with solenoids, motors or piezzo electric crystals. The reader touches the pattern with the finger and feels, which pattern and letter it is. The Braille pattern was invented in 1825 by Louis Braille, France, and was in a long time 2x3 dots. Mostly all displays use 2x4 dots today, as it is more convenient when writing with seeing people. Programmers would quickly see that 2x4 dots will give 256 different combination, such as raising one of the dots at the time and the have 8 different patterns. However, in the standard definition of Braille there is only one pattern which has one dot raised, otherwise it would be too difficult to read at a reasonably speed. The keyboard works by pressing one or more dots (keys) down at the same time. Upon release the key-code is send. The letter 'b' is represented by pressing dot 1 and dot 2 at the same time. Below is the layout of Braille patterns, which is used to read.
1 4
2 5
3 6
7 8