Sunday, April 3, 2016

Version 1.5 released

The code base for the Arduino Enigma Machine Simulator has been quite stable lately, it has been tested extensively so there are no glaring issues. There was however, a small intermittent visual corruption bug in the plugboard view that was difficult to track down. Not having a specific sequence of steps to reproduce and not being able to make it happen on demand, it could not be fixed.

Lately, I have been active in the Engima World Code Group Forum and using the simulator a lot through the serial port with the Arduino Serial Monitor tool since it is the easier way to encode long texts.

I noted the plugboard view was getting the visual corruption quite regularly and was not sure if it was related to the age of the Touchscreen LCD display, since the simulator that I am using was built in October 2014 (Hint: the bug is not related to the age of the screen, it works fine).

This is the main screen, touching the area at the bottom of the screen below the PYXCV key row enters the plugboard view.

This is the corrupted plugboard view, notice the faint E between the K and the L. It turns out it is in exactly the same position as the E in the lamp field in the main view. Touching the T shaped keys at the top of the screen returns to the main view.

If the plugboard view is entered again the visual corruption disappears.

During one of the enigma message sessions I noticed the last key encoded with the machine was the one showing up as a visual corruption in the lamp field. And here is where the bug was hiding. If a letter is encoded, the resulting letter would normally be illuminated in the lamp field. If a letter is encoded through the serial port, the resulting letter is only shown in the serial monitor window, but if the plug board is opened to make changes to the plugboard, the resulting letter will be shown as a visual corruption in its normal lamp field position.

Having a reliable sequence of steps that would reproduce the bug, fixing it was easy, clear out the encoded key variable if the letter is received and encoded through the serial port routine. Version 1.5 has been released to fix this. 

This bug was hard to track down because the plugboard had to be opened right after encoding a character through the serial port. If the Enigma logo was touched to open the machine instead and then the plugboard view was opened, it would display correctly.

New customers will get this updated version on their units. Existing customers can download the latest version at the usual download location provided in their welcome e-mail.