DCC++ JMRI Lights

David Conrad Nov 15, 2019

  1. David Conrad

    David Conrad New Member

    8
    2
    2
    I have DCC++ on an Arduino Mega and Motor shield. In the Serial monitor I program a pin as an output I put in <Z 1 24 0 0> and a sensor I put in <S 1 25 1>. In JMRI I set up a light and a sensor. I trigger the sensor and it shows "active" and the light button shows "on" but the light does not go on. any idea what is wrong?
     
  2. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    by my understanding of the code, this should be:
    Code:
    <Z 1 24 0>
    unless something has changed, that i am unaware of, the command needs 3 arguments: Id, Pin, and iFlag.

    ~Travis
     
    David Conrad likes this.
  3. David Conrad

    David Conrad New Member

    8
    2
    2
    Thanks for the fast repy
    When I type in <Z 1 24 0>, Then <Z> to list it comes back as <Y1 24 0 0>
    And still no light
     
  4. David Conrad

    David Conrad New Member

    8
    2
    2
    If i input <Z 1 24 1> the light is always on.
     
  5. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    I am assuming you are using the original code?
    there are slight variations between my code, and the original. allow me to study the original code, and i will see if i am telling you correctly. i think i am, based on the DCC++ Wiki ( https://github.com/DccPlusPlus/BaseStation/wiki/Commands-for-DCCpp-BaseStation ), but the lack of output state change, other than by changing the iflag is confusing. particularly when the iflag can turn it on and off, yet the commands do not.

    Have you tried using the write to EEPROM command: <E>
    then a manual state change of the output: <Z 1 1>
    or: <Z 1 0>

    ~Travis
     
  6. David Conrad

    David Conrad New Member

    8
    2
    2
    When i do that the light goes on with <Z 1 1> and off with <Z 1 0>
     
  7. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    ok, great. so your DCC++ base station is working! i would lean toward suspecting it is something in JMRI then.
    I use JMRI, but all the in's and out's are not my strongest knowledge base. my best guess would be to check the logic you have programmed between the sensor and the light.

    ~Travis
     
  8. David Conrad

    David Conrad New Member

    8
    2
    2
    maybe I'm setting up the light in JMRI wrong?

    TOOLS
    TABLES
    LIGHTS
    ADD
    System Connection DCC++
    Harware Address 1
    Create

    On the Light Table the only thing on the list is
    DL1

    I click the state button and i see an LED on the Arduino Mega labled RX flash when i click the button but the light does not come on
     
  9. David Conrad

    David Conrad New Member

    8
    2
    2
    Thank for getting me this far.
     
    Travis Farmer likes this.
  10. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    i am wondering if the hardware address of your light (1) and your sensor (1) are in conflict. my hardware is quite a bit different, so i can't test locally.

    ~Travis
     
  11. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    I don't know JMRI but to configure an output pin on std DCC++ you need to enter 3 parameters - < Z ID PIN IFLAG >

    IFLAG can be 0 - 7 and the three bits configure for example if you want the pin active high or active low and how you want the pin set after a controller reboot.

    My understanding is that the ID must be unique for that setting so can't be also used for a sensor etc.

    for example

    <Z 100 25 0> then store it in EEPROM using <E>

    then to change the state of that pin (pin25 in this case) you send <Z 100 1> or <Z 100 0>

    Its explained more detail on this page:

    https://github.com/DccPlusPlus/BaseStation/wiki/Commands-for-DCCpp-BaseStation
     
  12. David Conrad

    David Conrad New Member

    8
    2
    2
    Thanks Again I will play with it tomorrow and let you know how it works
     
    Travis Farmer likes this.
  13. David Conrad

    David Conrad New Member

    8
    2
    2
    Played with it for a few hours and still no light. I know it's in the JMRI and will get more time next weekend.
     

Share This Page