EngineDriver icon indicating copy to clipboard operation
EngineDriver copied to clipboard

Changing speed steps in JMRI crashes ED on MCII

Open SonnysHansen opened this issue 6 years ago • 12 comments

I have discovered a strange behavior on my ESU MCII with Engine Driver app. When I use a throttle from JMRI with the same engine number as on ESU MCII, and set speed step in JMRI throttle to 28, then the Engine Driver app is crashing. It looks like the ESU MCII with the Engine Driver app can´t handle 28 speed steps.

Sonny.

SonnysHansen avatar Apr 20 '18 12:04 SonnysHansen

@SonnysHansen I'm not aware of any interaction between the JMRI Throttle Window and Engine Driver. Can you be specific with the steps you're taking to see this? What version of JMRI are you running, and what hardware are you connected to? Also, what do you have selected as the EngineDriver preference "Speed Units"?

mstevetodd avatar Apr 20 '18 12:04 mstevetodd

Yesterday I was visiting an H0 US train club, to show my ESU MCII working with Engine Driver app. The club uses Lenz equipment, and a Lenz USB unit to connect to JMRI version 4.10. Also started up was the Withrottle. Some of the members use Engine Driver on Smart phones, and they have no problems. When I, with my ESU MCII acquire e.g. loco address 554, MCII shows speed step 27 in the speed step field. I turn the throttle knob up on my ESU, and the speed stops on speedstep 6, when the knob is all the way up. Then I tried to use the finger slider and the app crash. My ESU Engine Driver was in preferences set to speed units, Auto speed steps. I change that to 128 speed steps, and try again. Now I could turn the knob all way up, and it shows 27 in the speed step field. trying to use the finger slider and the app crash, to great fun for the members of the club. After I while trying to get it to work, I realized. Lenz LZV100 command station always start up in 27 speed steps, and you can´t change that. If you want 128 speed steps, you have to change it on the Lenz throttles. After several attempts whit the same fault results, I was ready to give up, but then I tried open a JMRI throttle, set it as the same address as in my ESU Engine Driver, change the JMRI throttle speed step window from slider to show speed steps. It shows 27 speed steps, then I change it to 128, and the ESU Engine Driver worked again, with no problems. I have to do this every time I change to another loco address. I have this morning try the same on my JMRI version 4.11.3. I used Lenz Express Simulator to try it out. The same fault acquire, until I change the speed steps in a JMRI throttle. Does this make sense or do you need more information?

SonnysHansen avatar Apr 20 '18 14:04 SonnysHansen

Update: I figured out how to change the speed steps in the JMRI Throttle window. If I set the EngineDriver "Speed Units" preference to "Auto Speed Steps", acquire the same address in ED and in a JMRI Throttle Window, and then change the speed steps in the JMRI Throttle window to "28 SS", the speed steps value in ED changes to match. (a "s2" message is sent). No crash on my phone, but the speed value isn't updated until something changes.

mstevetodd avatar Apr 20 '18 14:04 mstevetodd

@SonnysHansen I don't see this crash reported to the Play Store. Are you running the production version of EngineDriver 2.18.1 installed from the Play Store?

mstevetodd avatar Apr 20 '18 14:04 mstevetodd

Yes! my version is 2.18.1

SonnysHansen avatar Apr 20 '18 14:04 SonnysHansen

Do I have to rapport it, when Engine Driver crash on my ESU MCII?

SonnysHansen avatar Apr 20 '18 14:04 SonnysHansen

Thanks, @SonnysHansen that detailed narrative is very helpful. Also thanks for verifying it happens with the Lenz Simulator, as I doubt that the developers who have MCII's also have Lenz hardware. If you are prompted to send a crash report to the Play Store, always select Yes. The report includes a detailed stack trace showing the actual error message and the lines of code that crashed.

mstevetodd avatar Apr 20 '18 15:04 mstevetodd

@mattharris I connected ED on the MC II to my Digitrax system, set a loco to 28 step mode using a JMRI throttle, acquired the same loco on ED and was able to crash ED by moving the speed slider. Did the same thing and used only the speed Knob and ED did not crash, however the speed scaling is incorrect and the speed shown in JMRI with the Knob at max rotation was step 6.

@mstevetodd You should get a crash report.

I tried the same test using ED on my phone and it worked fine. No crashes, speed value as expected. When I increased the speed on the phone (or the JMRI throttle), eventually the MC II showed the correct speed. For instance I increased the speed to full throttle everything showed a speed of 27. However if I then reduced the speed using the Knob on the MC II the speed immediately dropped to 6.

So it appears that the ED MC II throttle code is not scaling properly based on the speed step.

n3ix avatar Apr 20 '18 17:04 n3ix

@mattharris Another issue I noticed while testing is that the Knob is not rotated in response to external speed changes. For instance if I change the speed using a JMRI throttle, the displayed speed in ED on the MC II changes however the Knob doesn't move. If I change the speed using the slider in ED on the MC II, the Knob does move to track the change.

n3ix avatar Apr 20 '18 17:04 n3ix

@n3ix I've separated out the external speed change issue into #292.

mattharris avatar Jul 20 '18 22:07 mattharris

We've another user report of this same issue.

mattharris avatar Feb 15 '19 13:02 mattharris

Just a quick update to say that I'm still working on identifying the root cause for this, but it looks to be in the way we deal with the speed step response from the WiThrottle server and not correctly considering the ESU Throttle Scaling setting. Still need to debug directly on a device which is taken a bit longer due to some problems I had in my dev environment (now fixed).

mattharris avatar Feb 20 '19 11:02 mattharris