EngineDriver icon indicating copy to clipboard operation
EngineDriver copied to clipboard

App crashes on Power Screen when DCC-EX command station has an output set to MAIN_AUTO

Open and-ampersand-and opened this issue 4 months ago • 7 comments

I recently set the B output of my DCC-EX command station to MAIN_AUTIO, which is their automatic reversing loop functionality. This functionality is relatively new and isn't mentioned much in their documentation.

Afterwards I configured this, going to the Power screen in the Engine Driver app causes the App to either crash or disconnect from the DCC-EX system. This happens on both of my phones with Engine Driver installed.

Luckily, the Action Bar power button seems to work fine and turns the track power on, so that is a current workaround.

Engine Driver version: v2.39.195

Steps to reproduce: -include SET_TRACK(B,MAIN_AUTO) in the myAutomation.h file when configuring a DCC-EX command station, such as:

AUTOSTART
SET_TRACK(A,MAIN)
SET_TRACK(B,MAIN_AUTO)
DONE

-connect to the DCC-ex command station on the Engine Driver app -using the 3 dot menu on the action bar, click Power to go to the Power screen -The screen will briefly load with the Power button before the app either crashes or kicks me back to the throttle screen (but disconnects me from the DCC-EX system)

and-ampersand-and avatar Aug 19 '25 20:08 and-ampersand-and

Thanks for the report. So, to be clear, if you do NOT include the SET_TRACK(B,MAIN_AUTO) line, you can reach the Power screen without issue? It would be great if you could capture an EngineDriver log file and attach it to this issue. Start the log capture prior to taking the Power menu option. I'd like for you to try the Beta version (which has some new log-sharing features), and see if that also crashes. Also, what version of DCC-EX are you running?

mstevetodd avatar Aug 19 '25 21:08 mstevetodd

@and-ampersand-and I'm able to reproduce the crash following your steps. This is with the Beta version of EngineDriver. @flash62au Are you available to take a look at this? 08-19 19:49:17.242 19568 19568 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {jmri.enginedriver/jmri.enginedriver.power_control}: java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5615) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5648) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:73) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:63) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeLifecycleItem(TransactionExecutor.java:169) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:101) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:80) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2823) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:248) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.os.Looper.loop(Looper.java:338) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:9067) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: Caused by: java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at jmri.enginedriver.power_control.refreshDccexTracksView(power_control.java:171) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at jmri.enginedriver.power_control.onResume(power_control.java:355) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1717) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.Activity.performResume(Activity.java:9315) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5605) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: ... 14 more

mstevetodd avatar Aug 19 '25 23:08 mstevetodd

Will do.

Peter

On Wed, 20 Aug 2025, 9:55 am mstevetodd, @.***> wrote:

mstevetodd left a comment (JMRI/EngineDriver#1249) https://github.com/JMRI/EngineDriver/issues/1249#issuecomment-3203146723

@and-ampersand-and https://github.com/and-ampersand-and I'm able to reproduce the crash following your steps. This is with the Beta version of EngineDriver. @flash62au https://github.com/flash62au Are you available to take a look at this? 08-19 19:49:17.242 19568 19568 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {jmri.enginedriver/jmri.enginedriver.power_control}: java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5615) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5648) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:73) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:63) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeLifecycleItem(TransactionExecutor.java:169) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:101) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:80) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2823) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:248) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.os.Looper.loop(Looper.java:338) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:9067) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: Caused by: java.lang.ArrayIndexOutOfBoundsException: length=5; index=5 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at jmri.enginedriver.power_control.refreshDccexTracksView(power_control.java:171) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at jmri.enginedriver.power_control.onResume(power_control.java:355) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1717) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.Activity.performResume(Activity.java:9315) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5605) 08-19 19:49:17.242 19568 19568 E AndroidRuntime: ... 14 more

— Reply to this email directly, view it on GitHub https://github.com/JMRI/EngineDriver/issues/1249#issuecomment-3203146723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6Y4AZIOZAXLNVDHJYIX733OO2OVAVCNFSM6AAAAACEJNIMFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMBTGE2DMNZSGM . You are receiving this because you were mentioned.Message ID: @.***>

flash62au avatar Aug 19 '25 23:08 flash62au

Note that the DCC-EX screen shows

<= B MAIN A>
<= A MAIN>

in the log area. I'm guessing the format of that first line?

mstevetodd avatar Aug 19 '25 23:08 mstevetodd

PR added with what should be the bug fix. That bug must have been there for some time.

flash62au avatar Aug 20 '25 02:08 flash62au

Wow that was fast, was about to reply to @mstevetodd 's original questions but it looks like everything is figured out.

But for context I'm running EX-CommandStation v5.4.6-Prod. Previously I've had no problems accessing the power screen but I usually use the power button in the Action Bar, so I don't go to the power screen very often. The only reason I noticed it this time was because I was using a different phone than I normally do that didn't have the Action bar power button option turned on.

and-ampersand-and avatar Aug 20 '25 02:08 and-ampersand-and

If you want to try one of my alpha builds email me and I will send you the link and instructions.

akersp62 at gmail.com

flash62au avatar Aug 20 '25 02:08 flash62au