DCC++ 2020 Update Project documentation

Keith Ledbetter Mar 5, 2020

  1. Jack Regan

    Jack Regan TrainBoard Member

    22
    12
    2
    I created a turnout table and saved it to a file. But when I turn the power off, the table I created is gone. How do I write that to eeprom
     
  2. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    If the motor board is seated properly on the Mega, and you have a jumper connecting pin 2 to pin 13, then sending a <1> in the serial monitor should light all 4 red leds on an Arduino Motor Shield R3. If not, it could be a bent pin or other connection issue or bad board or a bad GPIO pin (like a fried port) on either board or the wrong motor board selected in the DCC++ config.h file. The default is 0 here, #define MOTOR_SHIELD_TYPE 0, which is the Motor Shield (Arduino, Deek-Robot, etc.).

    DCC-EX has some different features than DCC++. DCC++ can only turn both tracks on and both tracks off. You have control over individual tracks in DCC-EX, but that isn't that important. I don't think JMRI yet supports that feature. In any case, if there is power to the main track, there should be power to the program track. The <s> command should show you that.

    I still have a lot to learn about JMRI myself when it comes to turnouts and other accessories. JMRI has support for the DCC++ "save to EEPROM" feature. So many people just use JMRI rather than save them with serial monitor commands directly in DCC++. JMRI stores all the information in a table and then when you activate or deactivate something, JMRI sends the appropriate command to DCC++. The save feature is the <E> command in DCC++. When you load JMRI, it will look and see if you directly saved any turnouts in DCC++ and load them in each time. 6 of 1 half a dozen of the other. The only real benefit of saving the settings on the base station is if you took your controller to a show or a club or if you weren't using JMRI. DCC++ saves the state of the Turnout every time you switch it if you save them to EEPROM. As long as the layout doesn't change by switching something manually, when you power up again, it remembers how everything was set. You don't need sensors to tell you.

    A little known fact that might be helpful to visualize is that turnouts and accessories are the same thing. We just expose it to you differently with a different command to separate their function so you can handle them differently. So the command you or JMRI would send to enable an accessory is <a ADDRESS SUBADDRESS ACTIVATE>. To turn on an accessory at address 229, you would enter <a 58 0 1> (that is the 2 part address for 229). A turnout command is <T ID THROW>. <T 10 1> would throw the turnout you numbered as 10. A little easier to remember and deal with. DCC++ internally just looks up the address for what you assigned a number to and sends the very same <a> command to control an accessory.
     
    Mani likes this.
  3. Mani

    Mani TrainBoard Member

    76
    15
    4
    You need to load the <turnout>.XML file while JMRI startup.. then you can see all the turnouts..

    Sent from my GM1901 using Tapatalk
     
  4. Mani

    Mani TrainBoard Member

    76
    15
    4
    Initially to check your DCC++ base station functionality and want more fun.. you can try DCC++ commands directly in Arduino serial monitor without JMRI..
    Ex: <t 01 03 20 1> will move loco address 03 forward with speed 20.

    Sent from my GM1901 using Tapatalk
     
  5. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    I have to apologize to all as I have been MIA for month. My work has been crazy busy which I am greatful for. Had to go to Mexico for 3 weeks etc etc. Don't want to sound whiney or boring. Suffice it to say happy to be back home and I'll get back on organizing docuentation etc. Looks like there has been some great work on the basestaion code for sure!
     
  6. Mani

    Mani TrainBoard Member

    76
    15
    4
    We also made some progress on our website. Now it's kind of easy to create documents. All you need is GitHub account and access.
    Here it is: https://dcc-ex.github.io/

    @FlightRisk can you add @Keith?


    Sent from my GM1901 using Tapatalk
     
  7. Jack Regan

    Jack Regan TrainBoard Member

    22
    12
    2
    Don't know if you want this added to the documentation but here's a a diagram of modifying a L298N board to use as a driver board. l298nbackmodify.png l298nfront.png
     
    Guywire, Smith-0, Mani and 1 other person like this.
  8. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    Thanks for all the great work. I am new to DCC++ and it was really easy to setup my system. I am now working on adding NodeMCU ESP8266 board to the Mega so that I can leave my computer on the desk and then JMRI can wirelessly connect to the DCC++ system, however after successfully uploading the sketch to the NodeMCU, it is not connecting to my Wifi network. I cannot find the pinout diagram for connecting NodeMCU to the Arduino, but what I figured was Arduino Mega TX1 -> NodeMCU RX, RX1 -> TX. Any way to debug the system?

    Just an fyi, I was able to use a simple sketch for the NodeMCU to connect to WiFi and it successfully connected and got an IP address, so it is working fine.

    Appreciate any pointers
     
  9. Jack Regan

    Jack Regan TrainBoard Member

    22
    12
    2
    Jeepster, I found this which should help. It is showing connections to a motor shield on top of an Uno but the pins would be for the Uno. Looks like a straight serial connection and power connection. Add some resistors to the nodemcu.
     

    Attached Files:

    Jeepster likes this.
  10. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Did you flash the firmware on the ESP8266?
     
  11. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    I've worked with Mike Dunstin on his work on an ESP32 CS ...... have you explored adding any generic ESP32 CS code to DCC-EX?
     
    Jeepster likes this.
  12. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    I did flash the ESP8266 however I don't see anything in the Serial Monitor. My earlier test code was printing out the status and IP address received from the DHCP server, so in this case have no way to debug if things are indeed working.
    Thanks
     
  13. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    Thanks this is helpful
     
  14. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    Will definitely look into that, thx
     
  15. Ash

    Ash TrainBoard Member

    106
    66
    8
    Since you are using JMRI, check out the use of CMRI for accessories. JMRI provides for simultaneous connection to DCC++ and CMRI.

    Here's a link to some of my notes.
    https://www.trainboard.com/highball...-out-card-for-jmri.116454/page-2#post-1141569
     
    Jeepster likes this.
  16. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    For now I am using Digikeijs DR4018 to control the switches though will check out CMRI as well. I did build an auto-switching reversing loop using Arduino Nano, motor shield, Relay Shield and 2 IR sensors. My Arduino Mega DCC++ system is working well, making it wireless is the icing on the cake I am seeking.

    Today I was able to build the ESP32 DCC++ code by Atani (Kudos and Thanks) and Flash the ESP32 but it is not connecting to WiFi. Will be digging further to figure out the issues. Getting garbage on the Port Monitor, have tried different baud rates, but no luck.
     
  17. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    FYI, there is no such project out there that I maintain... ESP32 CS is not DCC++ though it does offer limited support for the DCC++ communication protocol and is not the recommended way to talk to the CS.
     
  18. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    Ah, good to know thanks.
     

Share This Page