JMRI / JMRI

JMRI model railroad digital command & control software
https://www.jmri.org
Other
241 stars 332 forks source link

DecoderPro: Tams interface connection support broken #7645

Closed optonix closed 3 years ago

optonix commented 4 years ago

Hello JMRI group,

I have following problem: Starting point is a working JMRI 4.10 installation. Everything is fine there, no problems.

Now I tried to update to a newer version of JMRI (4.16, 4.17) and found out that the Tams interface connection is (at least partly) broken in DecoderPro. The connection is partly working in terms of that it is possible to switch Power on and off via Power button in DecoderPro. That shows me that the physical connection is basically up and running.

When I now try to readout CVs, the system console shows immediately "INFO - programmer already in use".

I don´t know exactly from which JMRI version on the connection was broken, but I tried several of them and the 4.10 is the last one working for me. In best case I just did some stupid things wrong and it´s very easy for you pointing me to my mistake.

Thanks for your support in advance!

Regards Martin

System console output: 2019-11-10 10:28:49,165 util.Log4JUtil INFO - ** JMRI log *** [main] 2019-11-10 10:28:49,175 util.Log4JUtil INFO - This log is appended to file: C:\Users\User\JMRI\log\messages.log [main] 2019-11-10 10:28:49,176 util.Log4JUtil INFO - This log is stored in file: C:\Users\User\JMRI\log\session.log [main] 2019-11-10 10:28:49,181 apps.AppsBase INFO - DecoderPro version 4.17.5+Rdf73700 starts under Java 1.8.0_231 on Windows 10 x86 v10.0 at Sun Nov 10 10:28:49 CET 2019 [main] 2019-11-10 10:28:49,365 gui3.Apps3 INFO - Starting with profile Test.3ddf8366 [main] 2019-11-10 10:28:49,533 node.NodeIdentity INFO - Using d1c1b099-9a07-4ffe-b2aa-89d0649c2f8e as the JMRI storage identity for profile id 3ddf8366 [AWT-EventQueue-0] 2019-11-10 10:28:49,625 xml.AbstractSerialConnectionConfigXml INFO - Starting to connect for "Tams" [main] 2019-11-10 10:28:49,809 serialdriver.SerialDriverAdapter INFO - COM5 port opened at 57600 baud, sees DTR: true RTS: true DSR: false CTS: true CD: false [main] 2019-11-10 10:28:49,809 serialdriver.SerialDriverAdapter INFO - TAMS COM5 port opened at 57600 baud [main] 2019-11-10 10:28:50,009 util.FileUtilSupport INFO - File path program: is C:\Program Files (x86)\JMRI_test\ [main] 2019-11-10 10:28:50,010 util.FileUtilSupport INFO - File path preference: is C:\Users\User\JMRI\Test.jmri\ [main] 2019-11-10 10:28:50,010 util.FileUtilSupport INFO - File path profile: is C:\Users\User\JMRI\Test.jmri\ [main] 2019-11-10 10:28:50,011 util.FileUtilSupport INFO - File path settings: is C:\Users\User\JMRI\ [main] 2019-11-10 10:28:50,011 util.FileUtilSupport INFO - File path home: is C:\Users\User\ [main] 2019-11-10 10:28:50,012 util.FileUtilSupport INFO - File path scripts: is C:\Program Files (x86)\JMRI_test\jython\ [main] 2019-11-10 10:29:26,001 symbolicprog.CvValue WARN - Exception during CV read: java.lang.NullPointerException [AWT-EventQueue-0] 2019-11-10 10:29:26,002 tams.TamsProgrammer INFO - programmer already in use by CvValue _num=29 _cvName= [AWT-EventQueue-0] 2019-11-10 10:29:26,002 symbolicprog.CvValue WARN - Exception during CV read: jmri.ProgrammerException: programmer in use [AWT-EventQueue-0] 2019-11-10 10:29:26,002 tams.TamsProgrammer INFO - programmer already in use by CvValue _num=29 _cvName= [AWT-EventQueue-0] 2019-11-10 10:29:26,003 symbolicprog.CvValue WARN - Exception during CV read: jmri.ProgrammerException: programmer in use [AWT-EventQueue-0]

optonix commented 4 years ago

Hello JMRI Team,

I did some debugging regarding this problem and I found out, that with newer releases a race condition happens which creates the trouble. Please excuse my improper descriptions, my java coding abilities are not very high.

It can be easily reproduced even without Tams hardware by following steps:

Reason:

Quick and dirty fix: I created a waiting loop to ensure the proper execution order by changing this function: TamsSystemConnectionMemo.java: .... public TamsProgrammerManager getProgrammerManager() { if (programmerManager == null) { try { Thread.sleep(200); programmerManager = new TamsProgrammerManager(new TamsProgrammer(getTrafficController()), this); } catch (InterruptedException ex) { Logger.getLogger(TamsSystemConnectionMemo.class.getName()).log(Level.SEVERE, null, ex); } } return programmerManager; } ....

Not nice, I know, but it works.

I would be very glad to get some feedback from you and probably find a fix which suits your quality expectations.

Regards Martin

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. JMRI is governed by a small group of maintainers which means not all opened issues may receive direct feedback.

stale[bot] commented 3 years ago

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the maintainers may elect to reopen this issue at a later date if deemed necessary.