Author Topic: Wyse 85 keyboard and Soarer’s Wyse Converter  (Read 4509 times)

0 Members and 1 Guest are viewing this topic.

Offline invariance

  • Thread Starter
  • Posts: 257
  • Location: Brisbane, Australia
  • ...here with all the other boson's
Wyse 85 keyboard and Soarer’s Wyse Converter
« on: Sat, 14 January 2017, 23:25:25 »
 Thought that I would put together a bit of a worklog with what I have done and some of the issues I came up against whist putting this together, so you might have seen some this before.....

 I received this Wyse keyboard a few years ago with the hope of putting it into service someday.
157632-0
When I finally got around to doing something with it, I first of all had to find out what model it was, as there wasn’t anything on it, no label on the back and the pcb has 980062-01.
157634-1]
A nice touch on the pcb is each key has been screen printed, making it much easier to put the keycaps back on or if a previous owner changed the layout.
Eventually determined it is a Wyse 85 keyboard which goes with the 85 terminal (pics from terminls-wiki.org).


Also in the research I found Soarer’s Wyse Converter Firmware will get this baby up and running.  The converter uses a Teensy 2.0 which is built around an Atmega32u4 microcontroller and lo-and-behold, so does an Arduino Leonardo that I had left over from a failed dishwasher controller repair attempt.  So it was time to do something about this and get building, well slowly at least.
Dug out an aluminium enclosure, purchased a 4P4C modular socket, spent a bit of time drilling and filing the holes for the connectors and voilà
157636-2
157638-3
157640-4
Next to get the hex file onto the Arduino Leonardo.  As the Arduino sketch environment doesn’t handle hex files, the most common method is to use avrdude but a few frontends I looked at didn’t do Leonardo, but then I found Arduino Builder and it has a nice gui as well.
Loading the firmware is a little tricky in getting the timing right between pressing the reset button on the Leonardo and initiating the upload in Arduino Builder.  I found that I had to press and hold the reset button on the Leonardo for 5 seconds, but at the 3 second mark press (and release) the COM3 button in Arduino Builder.   Nothing much else seemed to work.
By the way, my ‘seconds’ were a slow count approximating the real thing. J
 
« Last Edit: Mon, 16 January 2017, 03:04:24 by invariance »
The only BS I
want to hear is
from a Model M:
PN:1391401
DOB: 04FEB87
      Wyse 85      Mtek K104
SMK Blue: Chicony KB-5181; HyperX Aqua: HyperX Alloy Origins *Yet-to-rebuild: A 69 key C. P. Clare Foam & Foil assy *Rubber: Digital LK46W-A2; uSoft Natural Pro RT9401, Natural Multimedia 1.0A RT9470, Natural Ergonomic 4000 KU-0460; "Avid" Sejin SLKR2233; "Diamond Touch" Mitsubishi 6511-PB

Offline invariance

  • Thread Starter
  • Posts: 257
  • Location: Brisbane, Australia
  • ...here with all the other boson's
Re: Wyse 85 keyboard and Soarer’s Wyse Converter
« Reply #1 on: Mon, 16 January 2017, 06:40:00 »
I had a look at what the keyboard was sending using hid_listen and it was different to what others had posted:
Mine:
Code: [Select]
WYSE...
ID: 00
Model: WY85


Keyboard ID: 0000
Code Set: 2 (extended)
Mode: AT/PS2

\4E +04 \4F +42 d04 d42
/4E -04 /4F -42 u04 u42
\5B +05 \5C +1F d05 d1F
/5B -05 /5C -1F u05 u1F
\13 +06 \14 +27 d06 d27
/13 -06 /14 -27 u06 u27

Others (@Pardalis):


So I was a bit thrown by the double output and thought that I had done something wrong, so I tried Soarer’s XT/AT/PS2/Terminal to USB Converter to see if I could anything like Pardalis (for example).  As to be expected, that was a dead end because it wasn't designed for the Wyse protocol.

I eventually got the Wyse Converter firmware back onto the Leonardo and all keys were responding, but as the Wyse 85 terminal was an emulator for the DEC terminals of the time (VT100) it has the same non-standard layout.  The default layout of the firmware is ansi so some of the keys needed remapping.
As Soarer mentioned in his original post for the wyse converter that...
Quote
All of the configuration features of my XT/AT/PS2/122 Converter and my Keyboard Controller firmwares are supported (remapping, layers, macros etc)
.....I started off using the tools from the XT/AT…USB converter to create the remap file and load it onto the Leonardo.  All well and good, I had the nav cluster just the way I wanted it:
Find = Home
Select = End
Insert Here = Insert
Prev Scrn = Page Up
Re-move = Delete, and
Next Scrn = Page Down

157763-0   compared to the standard horizontal layout    157765-1

Onto the next part, configuring the lock leds.

« Last Edit: Wed, 18 January 2017, 02:56:08 by invariance »
The only BS I
want to hear is
from a Model M:
PN:1391401
DOB: 04FEB87
      Wyse 85      Mtek K104
SMK Blue: Chicony KB-5181; HyperX Aqua: HyperX Alloy Origins *Yet-to-rebuild: A 69 key C. P. Clare Foam & Foil assy *Rubber: Digital LK46W-A2; uSoft Natural Pro RT9401, Natural Multimedia 1.0A RT9470, Natural Ergonomic 4000 KU-0460; "Avid" Sejin SLKR2233; "Diamond Touch" Mitsubishi 6511-PB

Offline invariance

  • Thread Starter
  • Posts: 257
  • Location: Brisbane, Australia
  • ...here with all the other boson's
Re: Wyse 85 keyboard and Soarer’s Wyse Converter
« Reply #2 on: Wed, 18 January 2017, 02:52:48 »
Somewhere between getting a double output (ie \4E +04 \4F +42 d04 d42) and configuring all the keys to suit the keyboard's layout, I re-read an important piece of information in the OP:
Quote
WY85 (non-gate array) requires a pull-up resistor between Data and +5V
With this installed, I was getting the correct output with hid-listen
157875-0


The configuration file I used:
Code: [Select]
#Wyse 85 keyboard configuration

remapblock
  layer 0
    INSERT HOME      #set the "Find" key to become HOME
    HOME INSERT      #set the "Insert Here" key to become INSERT
    PAGE_UP DELETE   #set the "Re-move" key to become DELETE
    DELETE END      #set the "Select" key to become END
    END PAGE_UP      #set the "Prev Scrn" key to become PAGE UP
endblock
macroblock
  macro EUROPE_2 shift
    PUSH_META CLEAR_META all
    SET_META shift
    PRESS PERIOD   #set SHIFT + "<>" key to become >
    POP_ALL_META
  endmacro
  macro EUROPE_2
    PUSH_META CLEAR_META all
    SET_META shift
    PRESS COMMA      #set the "<>" key to become <   
    POP_ALL_META
  endmacro
  macro COMMA shift
    CLEAR_META shift
    PRESS COMMA      #set SHIFT + ",," key to become ,
  endmacro
  macro PERIOD shift
    CLEAR_META shift
    PRESS PERIOD   #set SHIFT + ".." key to become .
  endmacro
endblock

Perfect.  Now to get the lock leds working.  I put the sample code supplied with the Wyse Converter (wyse_leds.sc) into the config..
Code: [Select]
#Wyse 85 keyboard configuration

led caps +PF5
led num +PF6
led scroll +PF7

remapblock
.
.
.
......
and assembled it with the XT/AT...to USB converter tools (scas v1.10) but it threw an error at line 1: invalid command.
Even just making a config file with the led commands created an error.
I tried looking around for a worked example of it being used but couldn't find a thing: nothing in the docs and I gave up looking when I got half way through the XT/AT.. to USB thread.

OK, so I thought I would try using the Keyboard Controller Firmware tools to see if they would work.
The led config file compiled; hooray!
Wrote the led commands into the main config file and compiled.
More

#Wyse 85 keyboard configuration

led caps +PF5
led num +PF6
led scroll +PF7

remapblock
  layer 0
    INSERT HOME      #set the "Find" key to become HOME
    HOME INSERT      #set the "Insert Here" key to become INSERT
    PAGE_UP DELETE           #set the "Re-move" key to become DELETE
    DELETE END              #set the "Select" key to become END
    END PAGE_UP      #set the "Prev Scrn" key to become PAGE UP
endblock
macroblock
  macro EUROPE_2 shift
    PUSH_META CLEAR_META all
    SET_META shift
    PRESS PERIOD   #set SHIFT + "<>" key to become >
    POP_ALL_META
  endmacro
  macro EUROPE_2
    PUSH_META CLEAR_META all
    SET_META shift
    PRESS COMMA      #set the "<>" key to become <   
    POP_ALL_META
  endmacro
  macro COMMA shift
    CLEAR_META shift
    PRESS COMMA      #set SHIFT + ",," key to become ,
  endmacro
  macro PERIOD shift
    CLEAR_META shift
    PRESS PERIOD   #set SHIFT + ".." key to become .
  endmacro
endblock


Error at line 14: invalid command.  AAARRRGGGHHHH  W! T! F!

So the error was at "endblock".  I commented it out (thinking maybe it only needs one at the end of the file) and it compiled; hooray again!

Errors out of the road, it was time to investigate the leds as they weren't operating.
I decided I would use the Digital (PWM) pins as a continuation from the clock and data which fell on PWM 2 and PWM 3 respectively.
NumLock would be PWM 4 which is PD4 on the Atmega32u4
CapsLock would be PWM 5 which is PC6, and
ScrollLock would be PWM 6 which is PD7.
Made the changes to the config and set them to active high (ie +PD4, +PC6, +PD7) but still not working.  Checked with a multimeter and confirmed they were going high (+5v) but still not lighting up the leds. :-(
Eventually I looked up how led's are set up on the arduino and they were from V+ -> resistor -> led -> pin.  The pins are a current sink, not a current source.  Ref Edit.
Rewired the leds and changed the config again to an active low (-PD4, -PC6, -PD7) and the lock leds are now working.


Edit: This is not totally correct. This is what I found:
Quote
NOTE: If you do not set the pinMode() to OUTPUT, and connect an LED to a pin, when calling digitalWrite(HIGH), the LED may appear dim. Without explicitly setting pinMode(), digitalWrite() will have enabled the internal pull-up resistor, which acts like a large current-limiting resistor.
https://www.arduino.cc/en/Reference/DigitalWrite
Also
Quote
Arduino (Atmega) pins default to inputs
https://www.arduino.cc/en/Tutorial/DigitalPins

Quite possibly the pinMode hasn't been set, but for some reason it was able to sink the current.
Anyway, I got it working for my situation.
« Last Edit: Wed, 01 March 2017, 06:51:46 by invariance »
The only BS I
want to hear is
from a Model M:
PN:1391401
DOB: 04FEB87
      Wyse 85      Mtek K104
SMK Blue: Chicony KB-5181; HyperX Aqua: HyperX Alloy Origins *Yet-to-rebuild: A 69 key C. P. Clare Foam & Foil assy *Rubber: Digital LK46W-A2; uSoft Natural Pro RT9401, Natural Multimedia 1.0A RT9470, Natural Ergonomic 4000 KU-0460; "Avid" Sejin SLKR2233; "Diamond Touch" Mitsubishi 6511-PB

Offline invariance

  • Thread Starter
  • Posts: 257
  • Location: Brisbane, Australia
  • ...here with all the other boson's
Re: Wyse 85 keyboard and Soarer’s Wyse Converter
« Reply #3 on: Thu, 26 January 2017, 02:14:37 »
Wyse Converter Firmware loaded onto Arduino Leonardo?: Check.
Lock leds working?: Check
Remapped keys working correctly?: Checking with an online keyboard tester.... WAIT! WOT?? ???  The PrevScrn key didn't remap from END to PageUp?!?!?!

What the hell was going on now?

I pulled the config from the µcontroller (using scrd) then converted it from binary to a text (scdis) and found that instead of "endblock", it used "end".

Now I know why it didn't work, END is a keyword with the Keyboard Controller Firmware assembler: scas.exe v1.20.


    In summary:
        XT/AT..to USB Converter can remap End in the nav cluster and it supports lock leds but the leds are not configurable.  They cannot be moved to different pins or changed to an active low output as it is hardcoded into the firmware.
        Keyboard Controller Firmware cannot remap End in the nav cluster, it supports lock leds and they are totally configurable.


Dammit! I'm screwed either way.


I suppose I could re-arrange the keys in the nav cluster, but then it's not a true "Wyse 85"; it's a wyse 85 with an ansi nav cluster. :(
Looks like I'll have to make a little circuit to invert the led power so I can use the XT/AT to USB assembler and have leds and a remapped End.  Edit: cannot do due to above summary.
It's tough wanting to have my cake and eat it too.
« Last Edit: Sat, 28 January 2017, 02:03:13 by invariance »
The only BS I
want to hear is
from a Model M:
PN:1391401
DOB: 04FEB87
      Wyse 85      Mtek K104
SMK Blue: Chicony KB-5181; HyperX Aqua: HyperX Alloy Origins *Yet-to-rebuild: A 69 key C. P. Clare Foam & Foil assy *Rubber: Digital LK46W-A2; uSoft Natural Pro RT9401, Natural Multimedia 1.0A RT9470, Natural Ergonomic 4000 KU-0460; "Avid" Sejin SLKR2233; "Diamond Touch" Mitsubishi 6511-PB

Offline invariance

  • Thread Starter
  • Posts: 257
  • Location: Brisbane, Australia
  • ...here with all the other boson's
Re: Wyse 85 keyboard and Soarer’s Wyse Converter
« Reply #4 on: Wed, 01 February 2017, 02:25:02 »
To be able to have lock leds and a remapped navigation cluster, I realised that I would have come to a compromise.
Using scas.exe v1.20 from the Keyboard Controller Firmware, I configured the leds, then as the Prev Scrn key was locked into End, I made the Select key become Page Up just so the top row of nav keys more closely emulated what was printed on them.
Also to help with remembering which key does what when I next pull it out to use, I made up this nifty little key layout which I have printed and laminated to keep in the box I made for it.
159188-0


As you can see, I got a little carried away and created some macros to make the arrow keys act as media controls.


Here is the full configuration file I am running on an Arduino Leonardo.
More

#Wyse 85 keyboard configuration for use on an Arduino Leonardo


led num -PD4      #assign the NumLck led to PD4 (PWM 4, active low)
led caps -PC6      #assign the CapLck led to PC6 (PWM 5, active low)
led scroll -PD7     #assign the ScrLck led to PD7 (PWM 6, active low)
remapblock
  layer 0
    INSERT HOME      #set the "Find" key to become HOME
    HOME INSERT      #set the "Insert Here" key to become INSERT
    PAGE_UP DELETE   #set the "Re-move" key to become DELETE
    DELETE PAGE_UP   #set the "Select" key to become PAGE UP and
    #END PAGE_UP   #the "Prev Scrn" key will remain as END as the assembler cannot remap END
end
macroblock
  macro EUROPE_2 shift      #set SHIFT + "<>" key to become >
    PUSH_META CLEAR_META all
    SET_META lshift
    PRESS PERIOD
    POP_ALL_META
  endmacro
  macro EUROPE_2      #set the "<>" key to become <
    PUSH_META CLEAR_META all
    SET_META lshift
    PRESS COMMA   
    POP_ALL_META
  endmacro
  macro COMMA lshift      #set SHIFT + ",," key to become ,
    CLEAR_META lshift
    PRESS COMMA
  endmacro
  macro PERIOD lshift      #set SHIFT + ".." key to become .
    CLEAR_META lshift
    PRESS PERIOD
  endmacro
  macro UP lshift lctrl      #Shift + Crtl + Up arrow for volume up
    PUSH_META CLEAR_META all
    PRESS MEDIA_VOLUME_UP
    POP_ALL_META
  endmacro
  macro DOWN lshift lctrl   #Shift + Crtl + Down arrow for volume down
    PUSH_META CLEAR_META all
    PRESS MEDIA_VOLUME_DOWN
    POP_ALL_META
  endmacro
  macro LEFT lshift lctrl   #Shift + Crtl + Left arrow for stop
    PUSH_META CLEAR_META all
    PRESS MEDIA_STOP
    POP_ALL_META
  endmacro
  macro RIGHT lshift lctrl   #Shift + Crtl + Right arrow for play/pause
    PUSH_META CLEAR_META all
    PRESS MEDIA_PLAY_PAUSER
    POP_ALL_META
  endmacro
endblock



And the final image.
159190-1


Some more random pics
More
159192-2  159194-3   159196-4


159198-5   159200-6   159202-7


159204-8   159206-9   159208-10




I hope some day what I have found might be useful some else.
Thanks for looking.
« Last Edit: Sat, 18 February 2017, 07:04:00 by invariance »
The only BS I
want to hear is
from a Model M:
PN:1391401
DOB: 04FEB87
      Wyse 85      Mtek K104
SMK Blue: Chicony KB-5181; HyperX Aqua: HyperX Alloy Origins *Yet-to-rebuild: A 69 key C. P. Clare Foam & Foil assy *Rubber: Digital LK46W-A2; uSoft Natural Pro RT9401, Natural Multimedia 1.0A RT9470, Natural Ergonomic 4000 KU-0460; "Avid" Sejin SLKR2233; "Diamond Touch" Mitsubishi 6511-PB

Offline xandwich

  • Posts: 10
Re: Wyse 85 keyboard and Soarer’s Wyse Converter
« Reply #5 on: Wed, 01 February 2017, 21:36:24 »
That's right! I noticed the stupid "END" problem when I was doing a full remap of my keyboard.  But (thankfully) Soarer included the source for the utilities so I just commented out the offending line -- and it turns out that 'end' is entirely superfluous.  It just means the same as endmacro; endblock;

So I'm on linux and don't know how to make a windows executable, but if you're able to compile the source yourself just comment out line 1236 from scas.cpp to get END working right.  Or if you want to send me your sc file I can send you back a proper scb.

Aluminum enclosure looks great, btw.

Offline invariance

  • Thread Starter
  • Posts: 257
  • Location: Brisbane, Australia
  • ...here with all the other boson's
Re: Wyse 85 keyboard and Soarer’s Wyse Converter
« Reply #6 on: Thu, 02 February 2017, 06:40:53 »
Thanks for the info Xandwich, I will have a crack at it some day.
Cheers re the enclosure, I was thinking of painting it but a) I couldn't be bothered and b) the paint would chip with a few decent hits and look crappy, so I just ran over it with some auto cut 'n polish.
If it gets a bit dull I can always give it another quick rub.

Another good thing about the enclosure is it's big enough to fit another controller to run Soarer's AT2Usb converter.  Then I can use my Mtek K104 too.


Sent from my iPhone using Tapatalk
The only BS I
want to hear is
from a Model M:
PN:1391401
DOB: 04FEB87
      Wyse 85      Mtek K104
SMK Blue: Chicony KB-5181; HyperX Aqua: HyperX Alloy Origins *Yet-to-rebuild: A 69 key C. P. Clare Foam & Foil assy *Rubber: Digital LK46W-A2; uSoft Natural Pro RT9401, Natural Multimedia 1.0A RT9470, Natural Ergonomic 4000 KU-0460; "Avid" Sejin SLKR2233; "Diamond Touch" Mitsubishi 6511-PB

Offline invariance

  • Thread Starter
  • Posts: 257
  • Location: Brisbane, Australia
  • ...here with all the other boson's
Re: Wyse 85 keyboard and Soarer’s Wyse Converter
« Reply #7 on: Wed, 01 March 2017, 05:19:14 »
Finally got around to editing scas and removing the troublesome 'end' issue.
That was a journey in itself to work out how to compile and build the executable using a copy of Visual Studio 6 which I had lying around from my youth and had never used before.
Performed a few touch ups to the config file, loaded it and everything is where it should be (well where I want it to be anyway).
My final config file (for the time being):
Code: [Select]
#Wyse 85 keyboard configuration for use on an Arduino Leonardo

led num -PD4 #assign the NumLck led to PD4 (PWM 4, active low)
led caps -PC6 #assign the CapLck led to PC6 (PWM 5, active low)
led scroll -PD7  #assign the ScrLck led to PD7 (PWM 6, active low)
remapblock
  layer 0
    INSERT HOME #set the "Find" key to become HOME
    HOME INSERT #set the "Insert Here" key to become INSERT
    PAGE_UP DELETE #set the "Re-move" key to become DELETE
    DELETE END #set the "Select" key to become END and
    END PAGE_UP #set the "Prev Scrn" key to become PAGE UP
endblock
macroblock
  macro EUROPE_2 shift #set SHIFT + "<>" key to become >
    PUSH_META CLEAR_META all
    SET_META lshift
    PRESS PERIOD
    POP_ALL_META
  endmacro
  macro EUROPE_2 #set the "<>" key to become <
    PUSH_META CLEAR_META all
    SET_META lshift
    PRESS COMMA
    POP_ALL_META
  endmacro
  macro COMMA lshift #set SHIFT + ",," key to become ,
    CLEAR_META lshift
    PRESS COMMA
  endmacro
  macro PERIOD lshift #set SHIFT + ".." key to become .
    CLEAR_META lshift
    PRESS PERIOD
  endmacro
  macro UP lalt #Left Alt + Up arrow for volume up
    PUSH_META CLEAR_META all
    PRESS MEDIA_VOLUME_UP
    POP_ALL_META
  endmacro
  macro DOWN lalt #Left Alt + Down arrow for volume down
    PUSH_META CLEAR_META all
    PRESS MEDIA_VOLUME_DOWN
    POP_ALL_META
  endmacro
  macro LEFT lalt #Left Alt + Left arrow for stop
    PUSH_META CLEAR_META all
    PRESS MEDIA_STOP
    POP_ALL_META
  endmacro
  macro RIGHT lalt #Left Alt + Right arrow for play/pause
    PUSH_META CLEAR_META all
    PRESS MEDIA_PLAY_PAUSE
    POP_ALL_META
  endmacro
endblock

Just a few further notes: I haven't configured F17, by 'defualt' F18 is PrtScn, F19 is ScrLk and F20 is Pause/Break.

I am very happy with the outcome of this project and the board feels great to type on.
The only BS I
want to hear is
from a Model M:
PN:1391401
DOB: 04FEB87
      Wyse 85      Mtek K104
SMK Blue: Chicony KB-5181; HyperX Aqua: HyperX Alloy Origins *Yet-to-rebuild: A 69 key C. P. Clare Foam & Foil assy *Rubber: Digital LK46W-A2; uSoft Natural Pro RT9401, Natural Multimedia 1.0A RT9470, Natural Ergonomic 4000 KU-0460; "Avid" Sejin SLKR2233; "Diamond Touch" Mitsubishi 6511-PB