JMRI, DCC++ and a handheld throttle

Erik84750 Feb 12, 2022

  1. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Is it possible in DCC++, with an Arduino base station (containing the DCC++ software), to use a handheld connected to the base station to control a loco, and to simultaneously control the layout from JMRI (ie use Panel Pro) to command switches, and even drive a loco?

    Meaning: does DCC++ allow JMRI to control certain aspects of its domain while allowing a connected handheld to control a loco speed/direction/..?
     
  2. BigJake

    BigJake TrainBoard Member

    3,307
    6,371
    70
    I don't know about DCC++ being able to do both (listen to a both a handheld throttle and JMRI at the same time), but JMRI can serve one or more WiFi throttles (or throttle apps on smart phones) while running Panel Pro, with any supported DCC system, including DCC++.
     
  3. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Yes I know: this is done by adding several conections in the JMRI setup.

    My question relates to one single connection being able or not to be used by both JMRI and (in this case) a DCC++ connection.
     
  4. Mark Ricci

    Mark Ricci TrainBoard Member

    481
    652
    13
    About a year ago or so and while experimenting, believed at one point had a JMRI throttle on PC, another PC browser hitting the JMRI web server and the SCRP throttle on iPhone wirelessly connected to DCC ++ EX running on Mega, motor shield and esp wireless shield controlling same loco simultaneously. However, the IOS SCRP throttle can communicate natively with DCC ++EX. Not all wi-throttles support DCC ++ EX natively. Didn't delve further since wanted JMRI withrottle server and web server to service all wireless clients.
     
  5. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    To clarify my initial question: this is about an handheld (cab) controller that is connected wired to the Arduino command station (loaded with DCCpp_Uno.ino), hence the Arduino RX input pin, and with a motor shield attached.
    A basic setup.

    No wifi, networking, etc.. all this muddies the issue in question.
     
  6. mikethi

    mikethi TrainBoard Member

    15
    17
    9
    Hi , if I got your question right , you could send the necessary comands (https://dcc-ex.com/reference/software/command-reference.html) using one unused of four serial ports of the Mega ( you should have to modify the code then ) or sending them via the usb connection as the DCC++ Controller / or an simple terminal program as your PC does / could do it .
    greetings Mike

    *PS here something similar http://trainelectronics.com/DCC_Arduino/DCC++/Throttle/
     
    Last edited: Feb 13, 2022
    Sumner likes this.
  7. Sumner

    Sumner TrainBoard Member

    2,841
    5,987
    63
    Some have built Dave Bodnar's handheld wired and wireless throttles (see Mike's link above) that use the serial port on the Arduino. The same serial port that JMRI is using if you have a computer connected also to the Arduino Command Station. They have reported no issues but the two devices (throttle and Computer) are sending commands to the Arduino via the same serial port so one would think there could be conflicts.

    I was looking into putting a serial to wifi converter into one of Dave's wireless throttles and then use either DCC++EX's wifi connection or JMRI's WiThrottle for the connection between the throttle and Arduino. Then found out that I could add....

    [​IMG]

    ... a physical direction/speed knob to a phone running EngineDriver and that has taken care of my needs and EngineDriver has so many neat features that I'm not going to build the other throttle.

    More on the phone/throttle option ( HERE ).

    Sumner
     
    Erik84750 likes this.
  8. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Fantastic!! Thanks for sharing Sumner. I will research into your link.

    Grts,
    Erik

    EDIT: PS: and indeed these are the same serial port. RX/TX is shared with the USB on Arduino Uno.
     
  9. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Where is this volume know found? I could not find the link in my haste to read your site :)
     
  10. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    One disadvantage on your idea: contrary to a rotary encoder you cannot change direction with the press of a button (as you can with a rotary encoder).
     
  11. Sumner

    Sumner TrainBoard Member

    2,841
    5,987
    63
    Mark Ricci likes this.
  12. Sumner

    Sumner TrainBoard Member

    2,841
    5,987
    63
    True but it controls the speed steps one at a time if you turn slowly and of course faster if you turn faster. It turns the speed down to zero and then as you keep turning changes speed in the other direction up.

    Also you can still use the speed/direction/emergency stop buttons on the phone at any time. It doesn't cancel them out.

    Not perfect but overall with all the options that EngineDriver gives you as good or better than the $200+ throttle I used at a club layout once.

    With EngineDriver, depending on screen size, you can select multiple throttles at a time on the screen and operate them. I haven't seen what happens when using multiple throttles and the knob vs. the screen sliders. Not sure it would know which one it is operating. I'm not at home to try that so if someone has I'd like to know what the results are and I'll try when we are home and I have time.

    Sumner
     
  13. Sumner

    Sumner TrainBoard Member

    2,841
    5,987
    63
    I'll answer my question....well Steve Todd will as I asked him since I'm not at home where I could test it.

    Steve's answer.....

    "Touch the Speed indicator to move the little "v". That indicates which slider is controlled by the volume."

    So yes the physical speed/direction knob will still work when you are running multiple throttles on your phone or tablet. It is amazing how many options Steve has built into EngineDriver.

    https://enginedriver.mstevetodd.com/

    Sumner
     
    BigJake likes this.
  14. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Back to my original question:

    Is it possible in DCC++, with an Arduino base station (containing the DCC++ software), to use a handheld connected to the base station to control a loco, and to simultaneously control the layout from JMRI (ie use Panel Pro) to command switches, and even drive a loco?

    Some extra info:
    1. JMRI is connected to DCC++ command station over usb
    2. a handheld cab (throttle, ..) is connected to the DCC++ command station over its RX pin.
     
  15. Sumner

    Sumner TrainBoard Member

    2,841
    5,987
    63
    Maybe this will give you more to mull over. The discussion includes IronMan's comments where he was/is running the original DCC++ and then the DCC++ Classic (where DCC++ was cleaned up by Fred and the guys now working on DCC++EX). He ran JMRI and the hand throttle though the same serial port at the same time if I'm understanding it correctly.

    Also Fred's (Flightrisk) comments about DCC++EX running DCC++EX with the code at the time of the post. Not sure if there are newer changes to the code that would effect the question or not.

    https://www.trainboard.com/highball/index.php?threads/automatic-lok-trottle-with-dcc-ex.136945/

    Sumner
     
    Erik84750 and Mark Ricci like this.
  16. IronMan1963

    IronMan1963 TrainBoard Member

    161
    173
    9
    Sumner is correct. I built and run the Dave Bodnar Throttle with encoder and wireless option. I also run JMRI and have run trains with both at the same time. Fred (Flightrisk) told me that it should not work because they are both communicating on the same pins. I have not had an issue. YMMV.
    Later Richard
     
    Erik84750 likes this.
  17. Sumner

    Sumner TrainBoard Member

    2,841
    5,987
    63
    Which DCC version are you running? One of the original ones or a version of DCC++EX?

    Thanks,

    Sumner
     
  18. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Good to know, thank you for that update.
    I also have a question for Richard, besides Sumner:

    I David Bodnar's original code for the HC-12 throttle with encoder is there no error regarding arrays?
    An array address starts at 0, so if there are 4 loco's then their array addresses must be 0 through 3. Did you find no issue re array addressing?

    Did you find no further bugs?

    Thanks a lot for your answers Richard!
    Erik
     
  19. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    And another question for you Richard: what battery do you use with this wireless throttle?
    Grts!
    Erik
     
  20. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    After reading this following great input from FlightRisk I consider my question answered:
    https://www.trainboard.com/highball/index.php?threads/a-couple-dcc-ex-questions.133244/
    posts #1, 9 and 10.
    Conclusion: no it is not possible to run a JMRI throttle while JMRI is connected to the command station and at the same time run a throttle connected over the RX pin of the command station.
     
    BigJake likes this.

Share This Page