stentura protege

256 views
Skip to first unread message

Jordan Metzmeier

unread,
Jan 12, 2012, 8:37:29 PM1/12/12
to Plover
Hello,

I am trying to get a stentura protege to work with Plover. I saw on
the blog and another thread that I can press the 2nd and 3rd buttons
on the machine to put it into "bolt" mode. This causes plogger to
throw an exception.

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in
__bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/plover/machine/
txbolt.py", line 78, in run
self._pressed_keys.append(STENO_KEY_CHART[(key_set * 6) + i])
IndexError: tuple index out of range

I added some debugging code to possibly help:

key_set: 3 | key_set * 6: 18 | i: 0 | KEY_CHART length: 23
key_set: 3 | key_set * 6: 18 | i: 1 | KEY_CHART length: 23
key_set: 3 | key_set * 6: 18 | i: 2 | KEY_CHART length: 23
key_set: 3 | key_set * 6: 18 | i: 3 | KEY_CHART length: 23
key_set: 3 | key_set * 6: 18 | i: 4 | KEY_CHART length: 23
key_set: 3 | key_set * 6: 18 | i: 5 | KEY_CHART length: 23
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in
__bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/plover/machine/
txbolt.py", line 79, in run
self._pressed_keys.append(STENO_KEY_CHART[(key_set * 6) + i])
IndexError: tuple index out of range


Do you know what modifications might be needed to get this working on
the protege? I assume that STENO_KEY_CHART needs something added, but
I am not sure what to add.

I am also curious why SIGINT is not trapped to clean the lockfile. Is
this for Windows compatibility? If not, would you like a patch?

I might have a misunderstanding of what the 2nd and 3rd buttons are. I
assume they are the 2nd and 3rd from the left above the actual steno
keys. The STENO_KEY_CHART appears to only include the actual keys.
Pressing the buttons causes the machine to beep, but does not change
any display on the LCD screen. Attempting to type on the keyboard does
not log anything in the plogger.log file.

I would really like to get this working and am willing to do some work
myself if I can get pointed in the right direction.

Also, I have already written a python script to convert a csv
dictionary dump (this one came from Digital CAT student edition) to
JSON. I would be happy to offer this as contribution under the GPLv2
(to match the license of the rest of the code).

Thanks in advance!

Regards,
Jordan Metzmeier

Josh Lifton

unread,
Jan 13, 2012, 2:19:03 AM1/13/12
to Plover
Jordan,

Thanks for the bug report! More below...

> I am trying to get a stentura protege to work with Plover. I saw on
> the blog and another thread that I can press the 2nd and 3rd buttons
> on the machine to put it into "bolt" mode.

I haven't actually tested Plover with machines put into TX Bolt mode in
this way, so I'm not surprised there's a bug somewhere in there.

<snip>


> key_set: 3 | key_set * 6: 18 | i: 5 | KEY_CHART length: 23

<snip>


> IndexError: tuple index out of range

Yep, that looks like an out of range error. Not sure why exactly that's
happening, though. What keys are you pressing to cause this error?

> Do you know what modifications might be needed to get this working on
> the protege? I assume that STENO_KEY_CHART needs something added, but
> I am not sure what to add.

Mirabai can probably speak better to this point. Mirabai?

> I am also curious why SIGINT is not trapped to clean the lockfile. Is
> this for Windows compatibility? If not, would you like a patch?

I remember thinking about this, but I don't remember why it didn't happen.
I'm pretty sure it was because the first thing I tried didn't work, or I
didn't try anything at all, neither of which are particularly good
reasons. Either way, a patch would be great!

> I might have a misunderstanding of what the 2nd and 3rd buttons are. I
> assume they are the 2nd and 3rd from the left above the actual steno
> keys. The STENO_KEY_CHART appears to only include the actual keys.
> Pressing the buttons causes the machine to beep, but does not change
> any display on the LCD screen. Attempting to type on the keyboard does
> not log anything in the plogger.log file.

I've never used one of these machines. Again, Mirabai might be able to
better explain.

> I would really like to get this working and am willing to do some work
> myself if I can get pointed in the right direction.

We'd certainly appreciate the help! I think the first step is verifying
that your machine is in the right mode, as you allude to above.

> Also, I have already written a python script to convert a csv
> dictionary dump (this one came from Digital CAT student edition) to
> JSON. I would be happy to offer this as contribution under the GPLv2
> (to match the license of the rest of the code).

This would be great. I was tempted to remove Digital CAT dictionary
support from Plover 2.2.0 because I don't know anyone that uses it and I'm
fairly certain that it's broken after having languished for so long. If
you send me the original dictionary file, your conversion script, and the
output of your conversion script, I'll see what I can do to make sure the
Digital CAT dictionary format is maintained, or can at least be converted
into the Eclipse format that has received more development attention in
Plover.

Thanks again,
Josh

Hesky Fisher

unread,
Jan 13, 2012, 10:39:42 AM1/13/12
to plove...@googlegroups.com
Hi Jordan,

Sorry for the trouble.

For clarity, I'd like to confirm what happened. You pressed the second and third buttons simultaneously (from the left, the leftmost being the power button) on the protege and without you pressing any other buttons or keys an error occurred. Is that correct?

Assuming the scenario described above, I'm guessing that this is what's happening: The button combo that you pressed caused the protege to send some data over the serial port. Plover was expecting the data to be tx bolt (which only sends data when you're typing other than the occasional zero byte) and blindly started interpreting the data as keystrokes. I also seem to have missed adding sanity checking on the input so it failed when the incoming bytes couldn't be interpreted as a keystroke.

We need to add some sanity checking on the input so plover doesn't crash on some unexpected inputs. That won't help you much other than preventing crashes. 

On the protege that I used for testing, pressing the two buttons simultaneously made the machine beep and a serial port icon appeared on the little screen to indicate the mode change. Could you possibly try a few other button combinations to see if you can get that serial port icon to appear on the screen? You don't need to be connected or have plover running while you do this. Hopefully, we can figure out how to get your machine to output tx bolt.

Alternatively, I have some documentation for the actual stentura protocol but I haven't had a chance to implement it yet. I plan to get to it soon but if anybody wants to take a crack at it sooner I'll forward on the documentation.

Hesky

Jordan Metzmeier

unread,
Jan 13, 2012, 6:57:37 PM1/13/12
to Plover
It looks like was I mistaken about what actually caused the error.
Simply having the machine in bolt mode causes the exception, without
pressing any keys. I was using a serial->usb converter, but today I
tested using serial->serial. I pressed the 2nd and 3rd keys on the
stenograph and the serial icon appeared on the LCD display. I fired up
plover and without touching anything the exception was thrown. I have
tested this a couple of time and it was easily reproduced.

I adjusted the baudrate back to 9600, where I had it when I first
started testing (I found somewhere on google that said 1200 baud, but
it looks like this was incorrect).

Testing under 9600 baud, every key works except for -F and -T:

By debugging print is the same for both keys:
key_set: 3 | key_set * 6: 18 | i: 5 | KEY_CHART length: 23

Oddly enough, this only occurs when another key has been hit first. Eg
- hitting -T and then -T works properly and the debugging output
shows:
key_set: 3 | key_set * 6: 18 | i: 0 | KEY_CHART length: 23

I have tried adjust other serial settings such as the stop bits, Xon/
Xoff, and RTS/CTS. They all produce the same results.

Any ideas on if this is a configuration issue?

Matt Thomas

unread,
Jan 13, 2012, 7:00:42 PM1/13/12
to plove...@googlegroups.com
Midi
Sent in Transit (mst)

Jordan Metzmeier

unread,
Jan 13, 2012, 7:17:29 PM1/13/12
to Plover
Josh,

> I remember thinking about this, but I don't remember why it didn't happen.
> I'm pretty sure it was because the first thing I tried didn't work, or I
> didn't try anything at all, neither of which are particularly good
> reasons. Either way, a patch would be great!

I did some quick tests with registering a singal handler and I believe
I have found the reason
that you originally did not implement it. The wx mainloop appears to
interfere with Python's signal
handling:

http://wxpython-users.1045709.n5.nabble.com/How-to-quot-catch-quot-a-signal-td2361734.html

I will look into this further to see if there is anything that can be
done.

> This would be great. I was tempted to remove Digital CAT dictionary
> support from Plover 2.2.0 because I don't know anyone that uses it and I'm
> fairly certain that it's broken after having languished for so long. If
> you send me the original dictionary file, your conversion script, and the
> output of your conversion script, I'll see what I can do to make sure the
> Digital CAT dictionary format is maintained, or can at least be converted
> into the Eclipse format that has received more development attention in
> Plover.

I will clean up the script and add some input validation before I send
it over.

Regards,
Jordan Metzmeier

Jordan Metzmeier

unread,
Jan 13, 2012, 7:39:52 PM1/13/12
to Plover
Alright, I am now up and working. The last setting was the parity. My
downfall was I started adjusting the serial settings when the machine
initially didn't work, before I found the blog post with instructions
on turning the machine to bolt mode (hey, it worked for routers and
switches).

Thanks everyone for your replies.

Jordan Metzmeier

unread,
Jan 13, 2012, 8:27:49 PM1/13/12
to Plover
> This would be great. I was tempted to remove Digital CAT dictionary
> support from Plover 2.2.0 because I don't know anyone that uses it and I'm
> fairly certain that it's broken after having languished for so long. If
> you send me the original dictionary file, your conversion script, and the
> output of your conversion script, I'll see what I can do to make sure the
> Digital CAT dictionary format is maintained, or can at least be converted
> into the Eclipse format that has received more development attention in
> Plover.
>
> Thanks again,
> Josh

Josh,

Now that I have the machine working, it looks like my conversion
script was not so smooth. At first it looked like the problem was "-"
in the steno side of things. I see that there are some "-" included in
the default dict.json, so I am not sure when it is needed and when it
is not. The csv dump for DigitalCAT included these characters.

I had the following that was non-functioning from the CSV:
"TKW-EPBLT": "definitely",

Changing to this and it works properly:
"TKWEPBLT": "definitely",

Moving on the next one:
"TPHEUG": "anything",

2012-01-13 19:14:44,391 Translation(TPHEUG : None)

I am not sure why the translation on this one fails.

Here is another example:
"AO*EUPLT": "I'm not",

Any ideas on why some things are translating an others are not?


Josh Lifton

unread,
Jan 14, 2012, 12:58:44 AM1/14/12
to plove...@googlegroups.com
> We need to add some sanity checking on the input so plover doesn't crash on
> some unexpected inputs.

Yes, this is very much needed. Automated testing is long overdue as well.

> Alternatively, I have some documentation for the actual stentura protocol
> but I haven't had a chance to implement it yet. I plan to get to it soon
> but if anybody wants to take a crack at it sooner I'll forward on the
> documentation.

I'm not sure if I'll get to it any sooner than you, but it would be great
to see the documentation.

Cheers,
Josh

Josh Lifton

unread,
Jan 14, 2012, 1:15:24 AM1/14/12
to Plover
>> I remember thinking about this, but I don't remember why it didn't happen.
>> I'm pretty sure it was because the first thing I tried didn't work, or I
>> didn't try anything at all, neither of which are particularly good
>> reasons. Either way, a patch would be great!
>
> I did some quick tests with registering a singal handler and I believe
> I have found the reason
> that you originally did not implement it. The wx mainloop appears to
> interfere with Python's signal
> handling:
>
> http://wxpython-users.1045709.n5.nabble.com/How-to-quot-catch-quot-a-signal-td2361734.html

Yes, that was the reason.

> I will clean up the script and add some input validation before I send
> it over.

I'm looking forward to it.

Thanks for pushing on both these fronts.

Cheers,
Josh

Josh Lifton

unread,
Jan 14, 2012, 1:25:54 AM1/14/12
to Plover

I just realize I did effectively remove support for Digital CAT by
removing the dictionary format configuration option. However, this
shouldn't affect you since it looks like your are using Eclipse format in
the conversion anyway. As for why some are translating and some are not,
Plover needs to be restarted after any changes to the dictionary in order
for those changes to take effect. Are you making without restarting
Plover?

Jordan Metzmeier

unread,
Jan 14, 2012, 1:32:31 AM1/14/12
to plove...@googlegroups.com
> I just realize I did effectively remove support for Digital CAT by
> removing the dictionary format configuration option. However, this shouldn't
> affect you since it looks like your are using Eclipse format in the
> conversion anyway. As for why some are translating and some are not, Plover
> needs to be restarted after any changes to the dictionary in order for those
> changes to take effect. Are you making without restarting Plover?

I restarted the program after making the change. I am off work
tomorrow, so I will have time to do more testing and hopefully
get some debugging output that would be useful (possibly a patch).

Thanks,
--
Jordan Metzmeier

Hesky Fisher

unread,
Jan 19, 2012, 11:29:46 AM1/19/12
to plove...@googlegroups.com
This kind of experience reinforces my opinion that the serial port settings (at least the defaults) should be determined by the protocol rather than being entered by the user.

Jordan Metzmeier

unread,
Jan 19, 2012, 3:08:59 PM1/19/12
to plove...@googlegroups.com

Hello,

Part of the reason I started mucking with the serial settings was
because it was not working on the initial attempt. My background of
working with old enterprise networking hardware (without
documentation) is what prompted me to mess with the settings until it
worked. I don't think that most users will be as comfortable changing
serial device settings.

Regards,
--
Jordan Metzmeier

Josh Lifton

unread,
Jan 19, 2012, 4:30:14 PM1/19/12
to plove...@googlegroups.com

On Thu, 19 Jan 2012, Jordan Metzmeier wrote:

> On Thu, Jan 19, 2012 at 11:29 AM, Hesky Fisher <hesky....@gmail.com> wrote:
>> This kind of experience reinforces my opinion that the serial port settings
>> (at least the defaults) should be determined by the protocol rather than
>> being entered by the user.
>>

> Hello,
>
> Part of the reason I started mucking with the serial settings was
> because it was not working on the initial attempt. My background of
> working with old enterprise networking hardware (without
> documentation) is what prompted me to mess with the settings until it
> worked. I don't think that most users will be as comfortable changing
> serial device settings.

Yes, probably true. On the other hand it can only help the user experience
to add reasonable default settings depending on the machine. I have in
mind what I think should be a relatively clean solution to this problem.
For now, I've registered a blueprint:

https://blueprints.launchpad.net/plover/+spec/per-machine-default-serial-settings

Josh

Fubrite

unread,
Jan 20, 2012, 7:17:36 AM1/20/12
to Plover
Just to add a bit of info, though I'm by no means qualified to talk
about the development side of things...

In the dictionary "-" is used to indicate that no vowels are used, so
"PW-F" or "-R" or "T-" is just that, with no vowels. As you can see,
for single letters, it also helps to indicate which side of the
keyboard it is on.

Hope that's of some use...

Stefan

glendaro...@yahoo.com

unread,
Mar 6, 2012, 8:51:41 PM3/6/12
to plove...@googlegroups.com
This is on another subject, but can any of you tell me how to enter the time (ex:  1:30) into Digital Cat dictionary?   I have tried everything! 

Glen Warner

unread,
Oct 24, 2015, 2:48:11 AM10/24/15
to Plover
I know this is old, but if anybody else anybody else is wondering about this, take a look at this article:


--gdw

Achim Siebert

unread,
Oct 24, 2015, 8:43:19 AM10/24/15
to Plover
Huh? I don't see how this could be "translated" to Plover ... there's no such thing as automatic formatting (yet?). Since Python has a format() for strings this would not be too complicated to implement, I think.
Common times like the 1:30 above I'd stroke using WUPB/THEURT or WO*URBG as defined in my Magnum dictionary.
Reply all
Reply to author
Forward
0 new messages