Date   
Re: JMRI and NCE

Kenneth Skopp
 

Hello,

 

I have been doing some experimenting. I now have active JMRI 4.12 on my computer. I tried installing JMRI 4.16 without erasing 4.12. That did not work. I unstalled everything and tried JMRI 4.14. That did not work. I reinstalled 4.12 and now JMRI works with my NCE. Why?

 

Ken Skopp

 

From: jmriusers@groups.io <jmriusers@groups.io> On Behalf Of Jan Carr
Sent: Tuesday, July 23, 2019 1:13 PM
To: jmriusers@groups.io
Subject: Re: [jmriusers] JMRI and NCE

 

the message changes to offline.

Ken S: Do you have JMRI 4.16 installed as suggested earlier in this thread? Automatically defaulting to offline simulator mode when a connection problem occurred was a feature of older JMRI versions.

Jan


Re: DP feature request

Spuds McCat
 

I'd like to second this. I change the long number (to avoid conflicts with other club members) than I change the CV19 addresses. and it's really confusing when set cv19 in DecoderPro, then pull up a throttle, and it goes to the long address


On Tue, Jul 23, 2019 at 8:07 PM thomasmclae <thomas_applink@...> wrote:
DP generally only has data from the last decoder read, CV19 is no exception. SO showing the last known value is still good.
Opening the throttle with CV19 value (if set) would also make things go faster when speed matching. (Configurable?)

90% of my loks are in consists, managed by DP. So this would be a good update feature for me.
Thomas
DeSoto, TX

Re: Build Pickup Problems

Dan Boudreau
 

Jerry,

Use the text editor option for viewing the build report.  And for one of the cars that isn't being picked up, copy only the text for that car so we can see what is going on.

21 pages, wow!

Dan

Re: Cantons / Stop trains in block with red signal

Dave Heap
 

fcot2002,


On 24 Jul 2019, at 1:29 AM, fcot2002@... wrote:

Thank's for your explain, but the question only for DecoderPro as you said :
"Decoder Pro might give you the answer also if it has the feature for you to activate."
 
Can you explain to me how to check with DecoderPro, in which tab ?

For ESU decoders, it's on the Advanced tab.

For other decoders, it may differ...

Dave in Australia

Re: Servos, Ardunios, and JMRI #arduino

Sam Simons
 

Bob, 

Here you go - the 'P' script first, then the 'S' script.

Also, this is happening on current production 4.16.

Sam

# Transfer "TurnOut" Data from to an Arduino via Serial Transmission
# Author: Geoff Bunza 2018 based in part on a script by
# Bob Jacobsen as part of the JMRI distribution
# Version 1.1
# Connects JMRI Turnout "Watcher" to an Arduino Output Channel
# Note that JMRI must be set up to have a valid
# turnout table; if you're not using some other DCC connection,
# configure JMRI to use LocoNet Simulator
import jarray
import jmri
import java
import purejavacomm
# find the port info and open the port
global extportinP
portname = "COM5"
portID = purejavacomm.CommPortIdentifier.getPortIdentifier(portname)
try:
    port = portID.open("JMRI", 50)
except purejavacomm.PortInUseException:
    port = extportinP
extportinP = port
# set options on port
baudrate = 19200
port.setSerialPortParams(baudrate,
    purejavacomm.SerialPort.DATABITS_8,
    purejavacomm.SerialPort.STOPBITS_1,
    purejavacomm.SerialPort.PARITY_NONE)
# get I/O connections for later
inputStream = port.getInputStream()
outputStream = port.getOutputStream()
# define a turnout listener that will
class Datatransfer(java.beans.PropertyChangeListener):
  # initialization
  # registers to receive events
  def __init__(self, id, value) :
        self.name = "PT"+str(id)
        self.closed = value     # write this value to close
        self.thrown = value    # write this value to throw
        turnout = turnouts.provideTurnout(self.name)
        turnout.addPropertyChangeListener(self)
        turnout.setCommandedState(CLOSED)
        return
 
  # on a property change event, first see if
  # right type, and then write appropriate
  # value to port based on new state
  def propertyChange(self, event):
    #print "change",event.propertyName
    #print "from", event.oldValue, "to", event.newValue
    #print "source systemName", event.source.systemName
    if (event.propertyName == "CommandedState") :
      if (event.newValue == CLOSED and event.oldValue != CLOSED) :
        print "set CLOSED for", event.source.userName
        outputStream.write(event.source.userName)
        outputStream.write(",0")
      if (event.newValue == THROWN and event.oldValue != THROWN) :
        print "set THROWN for", event.source.userName
        outputStream.write(event.source.userName)
        outputStream.write(",1")  
    return
# The following will set up 5 listeners for Turnouts PT1 though PT6 (by username)
for x in range(1,6) :
    Datatransfer(x,x+100)

# Transfer "TurnOut" Data from to an Arduino via Serial Transmission
# Author: Geoff Bunza 2018 based in part on a script by
# Bob Jacobsen as part of the JMRI distribution
# Version 1.1
# Connects JMRI Turnout "Watcher" to an Arduino Output Channel
# Note that JMRI must be set up to have a valid
# turnout table; if you're not using some other DCC connection,
# configure JMRI to use LocoNet Simulator
import jarray
import jmri
import java
import purejavacomm
# find the port info and open the port
global extportinS
portname = "COM4"
portID = purejavacomm.CommPortIdentifier.getPortIdentifier(portname)
try:
    port = portID.open("JMRI", 50)
except purejavacomm.PortInUseException:
    port = extportinS
extportinS = port
# set options on port
baudrate = 19200
port.setSerialPortParams(baudrate,
    purejavacomm.SerialPort.DATABITS_8,
    purejavacomm.SerialPort.STOPBITS_1,
    purejavacomm.SerialPort.PARITY_NONE)
# get I/O connections for later
inputStream = port.getInputStream()
outputStream = port.getOutputStream()
# define a turnout listener that will
class Datatransfer(java.beans.PropertyChangeListener):
  # initialization
  # registers to receive events
  def __init__(self, id, value) :
        self.name = "ST"+str(id)
        self.closed = value     # write this value to close
        self.thrown = value    # write this value to throw
        turnout = turnouts.provideTurnout(self.name)
        turnout.addPropertyChangeListener(self)
        turnout.setCommandedState(CLOSED)
        return
 
  # on a property change event, first see if
  # right type, and then write appropriate
  # value to port based on new state
  def propertyChange(self, event):
    #print "change",event.propertyName
    #print "from", event.oldValue, "to", event.newValue
    #print "source systemName", event.source.systemName
    if (event.propertyName == "CommandedState") :
      if (event.newValue == CLOSED and event.oldValue != CLOSED) :
        print "set CLOSED for", event.source.userName
        outputStream.write(event.source.userName)
        outputStream.write(",0")
      if (event.newValue == THROWN and event.oldValue != THROWN) :
        print "set THROWN for", event.source.userName
        outputStream.write(event.source.userName)
        outputStream.write(",1")  
    return
# The following will set up 5 listeners for Turnouts ST1 though ST6 (by username)
for x in range(1,6) :
    Datatransfer(x,x+100)
 

Re: Servos, Ardunios, and JMRI #arduino

Bob Jacobsen
 

Could you post your scripts so we can see the details?

I suspect they’re defining objects with the same names.

Bob

On Jul 23, 2019, at 2:58 PM, Sam Simons <samusi01@...> wrote:

I've been working on getting my staging turnouts powered by servos and controlled by JMRI through Arduinos using Geoff Bunza's direct JMRI to Arduino scripts. The ends of the staging yards are far enough apart that I've ended up positioning one Arduino at each end of the yard, controlling five servos each. One Arduino is on COM4 and the other on COM5. I've got a pair of the "TurnoutDataTransfer.py" scripts created, one of which I'll refer to as P, the other S. On the one, I've renamed the global extportin to extportinP and the other script has extportinS. Com ports correspond to the Arduino ports. I've created a panel that has a basic diagram of the staging yard and can control the turnouts. This is where I am running into problems. I had JMRI automatically load the panel and run both scripts (P first, then S). The S turnouts worked normally but the P turnouts did not. I stopped the scripts from running automatically and have managed to test my way to the following:

1. If I load the P script (automatically or manually, doesn't make a difference), all the P turnouts work normally.
2. If I then load the S script, all the S turnouts work normally but the P turnouts stop responding, although the script output and panel act like they are working.
3. It doesn't matter which script is loaded first; the second script will stop the first script's turnouts.

Any thoughts on why this may be happening?

Thanks,

Sam
--
Bob Jacobsen
@BobJacobsen

Re: Controlling Servos directly connected to Arduino with DCC++ Base Station #arduino

Ken Moordigian
 

I had a similar problem with an Arduino based servo for turnouts; the servo was only getting a shot of current instead of a significant length of current to move the servo.  You might check how long the current is applied to the servo.

Ken Moordigian
Jackson Livery
818-522-4292




On Tuesday, July 23, 2019 rsauerbrun <jmriusers@groups.io> wrote:

Thanks Paul,

I started this effort by reading the following section on the JMRI site … http://jmri.org/help/en/html/hardware/dccpp/Turnouts.shtml

If I understand correctly, I should be able to run one servo directly connected to the Arduino's 5V, GND and one digital port (mine is connected to port 7). Of the three methods available with the DCC++ sketch, only the third method using the base station "Output" approach should work. This is what I have done, and everything looks great in JMRI, but the servo never moves.

But I get your concern about the PWM. As I watch the DCC++ traffic monitor I see only a "Low" then "High" state for the JMRI turnout. And when I hold the servo next to my ear, I hear a "click" when I send the command in JMRI to go "closed" or "thrown".

Is there any way I can overcome this in the DCC++ sketch?

Richard

Servos, Ardunios, and JMRI #arduino

Sam Simons
 

I've been working on getting my staging turnouts powered by servos and controlled by JMRI through Arduinos using Geoff Bunza's direct JMRI to Arduino scripts. The ends of the staging yards are far enough apart that I've ended up positioning one Arduino at each end of the yard, controlling five servos each. One Arduino is on COM4 and the other on COM5. I've got a pair of the "TurnoutDataTransfer.py" scripts created, one of which I'll refer to as P, the other S. On the one, I've renamed the global extportin to extportinP and the other script has extportinS. Com ports correspond to the Arduino ports. I've created a panel that has a basic diagram of the staging yard and can control the turnouts. This is where I am running into problems. I had JMRI automatically load the panel and run both scripts (P first, then S). The S turnouts worked normally but the P turnouts did not. I stopped the scripts from running automatically and have managed to test my way to the following:

1. If I load the P script (automatically or manually, doesn't make a difference), all the P turnouts work normally. 
2. If I then load the S script, all the S turnouts work normally but the P turnouts stop responding, although the script output and panel act like they are working.
3. It doesn't matter which script is loaded first; the second script will stop the first script's turnouts. 

Any thoughts on why this may be happening?

Thanks,

Sam

Re: Cantons / Stop trains in block with red signal

Kevin
 

The give away for whether a chip supports ABC is usually whether you can set cv27



Re: DP feature request

thomasmclae
 

DP generally only has data from the last decoder read, CV19 is no exception. SO showing the last known value is still good.
Opening the throttle with CV19 value (if set) would also make things go faster when speed matching. (Configurable?)

90% of my loks are in consists, managed by DP. So this would be a good update feature for me.
Thomas
DeSoto, TX

Re: Cantons / Stop trains in block with red signal

Dennis Cherry
 

I believe I did explain one way to see the option for the Asymmetric feature, it might be different for another brand of decoders.

It depends on who added the decoder information into Decoder Pro.

The other way is check the specification of the decoder you want to use and see if they document that feature with the CV values.

Dennis

Re: Build Pickup Problems

gerardh1031@...
 

Dan

The build report says the following for the 3 locations not being picked up

2 were ignored
1 was Cant Send

I compared the Car roster with the layout locations and all cars were located per the list
The build report is 21 pages long
The route shows all locations  set for Pick up and set out

Jerry

Re: Controlling Servos directly connected to Arduino with DCC++ Base Station #arduino

paul@...
 

Hi Richard,

I've not used the DCC++ base station, although I've experimented with using the JMRI interface in conjunction with my own sketch.  If there's a specialist forum for DCC++ you may get a better informed response there.  Having said that I downloaded the base station sketch some time ago, which I assume you must have done in order to load it on to your mega.  The code in Outputs.ccp appears to do a digital write to the output pin - line 85 but this may not be the latest version.  If so it won't drive an RC servo.  I've also used the standard Arduino servo library to successfully drive a servo, but on a non model railway related project.  It may be possible to add the servo library to DCC++.  It partly depends on your confidence level.  Also I suspect both the DCC++ code and servo code do 'clever things' with the Arduino timers.  There's potential for conflict if they are both trying to use the same timer.

Paul

Re: JMRI and NCE

Jan Carr
 

the message changes to offline.
Ken S: Do you have JMRI 4.16 installed as suggested earlier in this thread? Automatically defaulting to offline simulator mode when a connection problem occurred was a feature of older JMRI versions.

Jan

Re: Exception and other errors? Blocks Signals

Dave Sand
 

Steve,

I have never needed to change signalspeeds.xml.  I tweak speed assignments for turnouts and blocks to get the signal mast logic to work in special cases.  For layouts I work with, I set the default diverging turnout speed to medium.

Ken describes the logic process in the other response.

I want to expand on that a bit.  The basic signal mast logic concept is:  The signal mast is Stop/Danger unless a route to a destination mast can be selected.   Based on the “path" speed and the indication on the next mast, an aspect is selected from the aspects.xml and appearance xml files.  A key factor for the aspect determination is whether the route is normal or diverging.  A route is normal if “ALL” turnouts are normal.  It is diverging if “ANY” turnout is diverging.

Dave Sand


On Jul 23, 2019, at 6:04 AM, bluetobits <steve.lomax@...> wrote:

Hi again Dave, Ken and all

Dave: I have tried your suggestion and this really helps to have a better understanding of signal mast logic. The strange routing behaviour issue at cuewait siding is still causing signal  problems, as is a similar the issue at slippery slope. This may be because I have not fully blocked the mine section and set up block occupancy sensors and signal masts for that section. I was hoping this would not be necessary. I have reverted to a earlier save of my layout which uses single head masts at the xovers and the aspects seem to function more predictably. I don't need double heads as I don't want to automatic trains to use the mining section in any event, but do need to stop auto trains from entering turning loops that are currently being used for manual mine traffic. I was using the double aspect signals to try to understand why the main line locos were reducing speed to 15 over the xover section despite green signals.  I'm not sure I have fully grasped the process behind the SML or built my layout to be compatible or at least "comfortable" with it but with help and advice from yourself and others, I'm on the way to gaining a basic understanding.

Ken: I hadn't realised this. This is great and could be the root of my issues. I can set speeds for through and diverging turnouts as you suggest and set speeds for blocks.   If I understand correctly, JMRI uses some formula of these two  along with pre-set speeds for signal aspects  in the file "signalspeeds.xml" to determine some speed value displayed when editing logic in  signal mast  pairs. Presumably I can edit and copy this file and change it's location to user preferences.  I'm not sure how warrants and dispatcher integrate or share speed data and tables. I haven't got as far as Warrants yet. Perhaps this will make things clearer but I haven't created a control panel yet. Do I need to do this first?  I can also, of course, set speeds in the decoder chip CVs. Does this overrule or work in conjunction with JMRI speeds (How do I make the decoder programmers work from within PanelPro?) Are there any further methods of setting auto train speed? 

Thanks for reading 
I'll keep trying. Please anyone chip in with other suggestions.


StevLomax

Steve 009 in UK

Re: JMRI and NCE

Ken Cameron
 

What should happen is it shows green thinking there is a connection. Within
10 seconds, it probes the interface to see if it replies right. If that
fails, the connection turns red. You should do a cut/paste of the console
log again so we can see that the port opened ok. Typical issue at this point
(assuming the open worked) is the baud rate doesn't match.

Now my next question is to confirm which make of interface and command
station you are using. That will help clue me as to the next things to try
to explain. The current console log will tell me what you are trying, but
that might not be the right match for the hardware you have.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.com
www.syracusemodelrr.org

Re: JMRI and NCE

Kenneth Skopp
 

Hello Ken C.,

I double checked in Device Manager USB Interface using COMM4. When I start
JMRI the Decoder Screen at bottom has NCE connected in green message. When I
select a loco to program, the message changes to offline. How can I check
that the USB Interface hardware connections are ok?

Ken S.

-----Original Message-----
From: jmriusers@groups.io <jmriusers@groups.io> On Behalf Of Ken Cameron
Sent: Tuesday, July 23, 2019 11:37 AM
To: jmriusers@groups.io
Subject: Re: [jmriusers] JMRI and NCE

Ken S,

The cut/paste of the console log you sent shows JMRI asking for COM4, but
the system saying COM4 not found. Insure everything is connected and powered
up before starting JMRI. Also follow what I said before about using Windows
Device Manager to confirm the hardware is really loading up at COM4 and no
errors with drivers. We've found that Win10 updates sometimes disables
drivers and they need to be loaded again.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.com
www.syracusemodelrr.org

Re: JMRI and NCE

Ken Cameron
 

Ken S,

The cut/paste of the console log you sent shows JMRI asking for COM4, but
the system saying COM4 not found. Insure everything is connected and powered
up before starting JMRI. Also follow what I said before about using Windows
Device Manager to confirm the hardware is really loading up at COM4 and no
errors with drivers. We've found that Win10 updates sometimes disables
drivers and they need to be loaded again.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.com
www.syracusemodelrr.org

Re: JMRI and NCE

Kenneth Skopp
 

Hello Marc,

Here is screen I get.

 

Ken

 

From: jmriusers@groups.io <jmriusers@groups.io> On Behalf Of forfoum@...
Sent: Tuesday, July 23, 2019 11:11 AM
To: jmriusers@groups.io
Subject: Re: [jmriusers] JMRI and NCE

 

Ken, attachements are not permitted and will not come thru. 

Either cut and paste  it's  content into this thread or upload it to the file section.

Marc

Re: Controlling Servos directly connected to Arduino with DCC++ Base Station #arduino

rsauerbrun
 

Thanks Paul,

I started this effort by reading the following section on the JMRI site … http://jmri.org/help/en/html/hardware/dccpp/Turnouts.shtml

If I understand correctly, I should be able to run one servo directly connected to the Arduino's 5V, GND and one digital port (mine is connected to port 7). Of the three methods available with the DCC++ sketch, only the third method using the base station "Output" approach should work. This is what I have done, and everything looks great in JMRI, but the servo never moves.

But I get your concern about the PWM. As I watch the DCC++ traffic monitor I see only a "Low" then "High" state for the JMRI turnout. And when I hold the servo next to my ear, I hear a "click" when I send the command in JMRI to go "closed" or "thrown".

Is there any way I can overcome this in the DCC++ sketch?

Richard