DCC++ Update Project 2020

FlightRisk Feb 16, 2020

  1. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    That is very odd, I use this same shield with great success. Are you able to read CVs and confirm that the DCC++ monitor in JMRI displays the responses from DCC++ when it sends the <s> command?
     
  2. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    As for organizing the project, GitHub offers "Projects" as part of the repository and you can shift tasks around and assign them to people. I've done some experimentation with it for ESP32 CS
     
  3. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    To me that link has done a very good job but still for a lot of users all of the steps involved in getting the Arduino up software wise are daunting and hard to explain in simple terms if they aren't very computer literate. Give them an Arduino with the sketch pre-loaded and it would then just be simple hardware connections,

    Sumner
     
  4. Roger Beschizza

    Roger Beschizza TrainBoard Member

    58
    8
    3
    Great idea - but another ball game [as I believe you might say] :unsure: That would entail someone setting up a business I'd have thought.

    I'd be all for it, but there is a lot to do to get up and running after the software and the hardware have married up.
    1. Drawing your track plan [JMRI -or- the DCC++ onboard version]
    2. Wiring in and setting up servos
    3. Wiring in and setting up sensors
    4. Setting up the engine control function keys
    To highlight just a few.

    R-
     
  5. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Fully agree lets drop the providing hardware or pi images or providing anything else discussion in this thread if there is interest let's start another thread. We dont need to complicate this further.

    I also vote that until we build out the basics and avoid getting outside the box until it's done. I think agreed setup of uno + original motorshield + serial connection to windows PC and getting JMRI setup for dcc.

    To me Pi is great ( I run it actually on my test layout) but i certainly wouldn't consider that the most likely or easiest scenario and honestly we need links to how to do it to others but not every scenario needs to be done by us. We dont need to teach folks linux or about a Pi or really even how to code an Arduino for instance. They can research that on their own. The best projects are used as tools in a bigger picture that let's you pick and choose how to implement. It's the beauty of open source and indeed DCC++ itself.

    Right now there is no accurate quick start. Gregg's original is the starting point but the jumpers aren't even right. Let's get that done as Phase 1.

    Then we can work all the wonderful branches!

    The more I look the more I think github with the associated Wiki is the right spot to actually house the repository. I think a forum like this is fine for the sausage making ;)

    So as another start does anyone have a genuine Uno and a genuine motor shield? The reason I ask is that I think if we call that the base then we need pictures with that setup. I personally have nothing genuine it's all clones.

    A task in my mind is to essentially recreate Gregg's last couple videos and documentation with the latest proper wiring and links to proper github.
     
  6. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Mani, can you tell me how to load that track power menu? Do you have a screenshot? All I can find is this, but it just says on or off; no voltage or even a zero.

    PowerControlWithIdleButton.png

    There is a current monitor that for DCC++ is hard coded in JMRI to give the percentage of current used. It looks at the pin reading, ex: 500, and knows that the 10bit registers for the Uno holds 1024 bits, so says that is 49% of the maximum reading. Of course the default in DCC++ for that motor board is 300 which is only about 880mA (((5v/1024bits)/1.65Volts per Amp)*300), so it would trip before it ever got to 500 ;). I'm talking to the JMRI folks about sending more information that would allow reading in actual current in milliamps and track what we have the trigger cutoff set to. In my test version of DCC++ I have MAX_CURRENT, TRIGGER_CURRENT, and CURRENT. So for the Arduino/Deek-Robot shields, max is 2000mA, Trigger is whatever you want, 880 or 1400, and actual current is a close approximation of actual current. In any case, it is relative. So if you set the trigger current to 1400mA, then 880mA would be 63%. So you have 37% to go before it trips. I like the idea of having both displays or even get fancy and have a thermometer bar or something that shows the current reading as it changes graphically.
     
  7. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    I may not know what I'm doing, but I don't get anything I can see from the code would give me power status from just sending an <s> command. Do I need to have a particular configuration or a window open or a loco setup and a train on the track? I thought it was just reading a pin in the arduino to get voltage and send it as a message. an <s> returns <X><X> at the end of my string which means there were no output sensors. I can verify this with the <Z> command, there are no defined output pins. (I loaded up the original DCC++ BaseStation 1.2.1+. If it is reading a pin somewhere, what pin? What code is doing that?
     
  8. vasilis

    vasilis TrainBoard Member

    110
    39
    10
    IMHO to keep things simple the DCC++ CS has to be only a CS connected to JMRI or to a throttle and the track. No sensors or accessory decoders through the CS. The railcom cut out it is a nice feature to be added. The possible connections to jmri and to the track through the motorboards are so many and have to be well documented.
    I would to say some things for the boosters, because is an issue when someone has a little bigger layout or/and loops and other kind sections where reversers are needed. The dcc++ cs needs to have its own "philosophy" and solution about the powering. The dcc++ is a neat dcc command station, but has to make friends. To make friends you have to show that you can control the layout. The JMRI and an open source, low price, powering system are the allies.
    For the case of multiple power districts the JMRI power monitor is not useful, except if i'm missing something. With motorboards of low prices we can build boosters for each power district and avoid the scheme booster- multi circuit breakers. A booster can have a simple current limiter before the motorboard and a relay to the track district. With an arduino nano to control it we can cut the power to the track, reverse the polarity and connect them to a separate dedicated control application. The booster in a case of a short cutting the power to the district, but continues transmit the signal to the chained booster.
    Hopefully i post a scheme about the concept of the booster soon.
    I uploaded the scheme that has to be, IMHO, well documented. It is based to what I would to know about dcc++ and the questions that make people about the dcc++.
    You took a difficult path, but the purpose is very noble. I hope your enthusiasm doesn't go away. DCC++ is capable and can help many people to enter to the hobby.
     

    Attached Files:

    FlightRisk likes this.
  9. John W Zerbe

    John W Zerbe TrainBoard Member

    96
    59
    7
    I would add to your list of recommended hardware to get started a small list of recommended power supplies as well. This seemed to be a minor stumbling block for me in getting started with my dcc++ project. My first iteration used my n scale bachmann dc power supply just cranked all the way up to full throttle. I suspect that most first timers will do the same moving from DC to dcc++.

    BTW I would also like to participate in this endeavor. I have 30+ yrs in programming experience and have some ideas for enhancements to the current codebase.
     
    Sumner, FlightRisk, vasilis and 2 others like this.
  10. Roger Beschizza

    Roger Beschizza TrainBoard Member

    58
    8
    3
    Thanks, Vasilis - and to all the other contributors to the project. I find myself starting to not understand what folk are talking about with technical language and the Github etc. That is not their fault - it rests with me being a non-techie. I had really hoped that the start of this project would be simple to grasp and I fully appreciated that it would eventually get away from me. I did not, however, appreciate that that point would be reached so soon. I hope in some small way I have prompted a discussion and that out of it there will come a process that will enable folk to utilise the DCC++ system for layout control. It is, from the first impressions anyway, a fantastic system. I will keep a watching brief in the hope that I can pick up some of what is going on and, who knows, perhaps one day use it. The Google Sheet will stay in place for the time being so folk can access anything that already resides there. R-
     
    vasilis likes this.
  11. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12

    Great suggestion on power supply. Also great to have another coder willing to help!

    Here is my million dollar question. Who do we think has a working DCC++ version that is the best pure play to use as our base code? One that works well with the original setup we are talking about. Can have all the extras it wants but needs to work both ops and programming with UNO/original motor shield/serial setup. Some of the coders woudl be my recommendation and I'm hoping someone will volunteer here. In my opinion that is who should own the Github and then we can start posting the documentation, etc. for now I will make my JMRI documentation in a word file with pictures but getting that base code up with documentation is the first step.
     
  12. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    @Roger Beschizza, don't sweat it. You are the guy with energy. You can be a cheerleader and organizer for the group. The coding isn't necessary. What you are already doing with regard to finding missing pieces, putting our ideas together, etc. is great. If we use GIT, it is something pretty easy to learn how to use. We can teach you. Otherwise, you supply the changes and one of us pushes the changes to the server. Can you get us a list somewhere that has todo lists for "coding", "documentation" and "misc"?

    @John W Zerbe, excellent! I have the contact info for a couple of the people who are also coders and have contributed to the code and/or tried to issue pull requests for changes they made, but are not in the code. We need to list the features that were added, decide if they should go in the "master" version or not, and prioritize them. What I have started is to take Atani's version, fork it into my repo where I am adding things to current tracking. Atani (Mike) added quite a bit, including code for using and ESP9266 for networking. My suggestion is to go through the pull requests on Gregg's original GitHub and see what needs to go on the coding todo list. @Keith Ledbetter, that would mean start here: https://github.com/FrightRisk/BaseStation. Note that here I am FlightRisk, but there I am FrightRisk. I am big into Halloween. Lots of Arduino's, Teensies, etc. in my setup ;)

    I have NOT pushed my changes yet because I am trying to learn more about organizing on Github and I don't want to break JMRI. I found that JMRI puts code in a timer to issue a "<c>" command to get current for it's current monitor applet. It expects just the raw AnalogRead from the current sense pin. I may just pass that "as is" even though I am using milliamps internally now. This is fine since that value is only used to give a percentage of current flowing. I am talking with the JMRI folks about options to issue a pull to them or have them make the changes to have JMRI report the pin reading and the actual current and put more information into their current monitor display. They would have a check for DCC++ version number and if greater than the last version, use the added information.

    Everyone: We need to decide what the "base" configuration is. We have decided it is an Arduino Uno, Arduino Motor Shield, and a power supply. We need control. My opinion is that a computer running something that sends commands to the Base Station is the best option. You could use a CAB or build one from many of the tutorials out there, but that's too complicated. We can use JMRI, or course, but it itself is fairly complicated. It still may be the best option, but Gregg's original solution, which no one talks about, is his Controller software: https://github.com/DccPlusPlus/Controller. I would encourage you to try it and see what you think. No JMRI, just this app and a base station. The only thing I don't like about it is that it requires yet another installed environment to run. To use graphics, Gregg wrote it using the "processing" IDE from processing.org. You have to install that and run it. It is a lot like having a different version of the Arduino IDE that you can run the code inside of. Geoff Bunza made a stripped down version of a controller based on it here: https://model-railroad-hobbyist.com/node/27318#comment-252818. Not sure how I feel about it. It is another thing to have to install like having to have Java to run Java apps and Flash to run animated graphics. In an ideal world, we would have an app that looks like the JMRI throttle that runs on Windows or Linux. Sorry for the long post. That should keep us busy ;)
     
  13. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63


    I still put in a vote that a Pi with JMRI is the easiest and most versatile means of 'control' for a first time user and cheapest. It is basically plug and play using the image you can easily download from Steve Todd's site...

    https://mstevetodd.com/jmri-raspberrypi-access-point

    Download it and put it on a micro SD card and plug it into the Pi and turn it on and the PI boots and JMRI comes up on the screen. What can be easier than that for someone new to this. They don't have to know anything about a Raspberry Pi.

    [​IMG]
    http://1fatgmc.com/RailRoad/DCC/page-1.html

    They buy the $35 Pi, connect a keyboard and mouse to the USB ports, connect a monitor to it and put USB power to the Pi and it works. Download Steve's image and they have taken care of the Pi's operating system and JMRI without having to figure any of that out. Connect the Pi to the Arduino, connect a power supply to the Arduino and run the wires from it to the programming track and the main and you have a complete system. All the cables are easily found cables along with whatever voltage power supply you decide to run

    They are going to need to program loco's...now they have that with JMRI. They want to control a train. Easy to do directly with the JMRI throttle or by using a phone as a wireless throttle, again it is all there.

    I returned last fall after being absent 40+ years and went this route and it was pretty painless and it works for me. I can program and run trains and it is cheap and pretty easy to learn if you want to take it further with all the youtubes that are available. Some of which show how to setup the Arduino and shield. Never having worked with an Arduino the hardest part I found was getting the sketch on and that wasn't that hard following this...

    https://github.com/DccPlusPlus/BaseStation/wiki/Getting-Started-With-DCC---Hardware

    Setting the actual Arduino and shield was pretty straight forward following some of the youtubes like this one...



    Sumner
     
    Last edited: Feb 21, 2020
    John W Zerbe likes this.
  14. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    @Sumner, I agree with you, I have used a Pi and I have a test setup with a Pi Zero sitting on my bench right now. My thoughts are that it is an added piece. So on one hand, it is a turnkey system, but on the other, it requires ordering something people might not have. Also, creating the image on an Micro SDCard is not that easy for a first-timer. Installing a program on a laptop is something people do almost every day. That said, I think having a separate "Quick Start" for the Pi solution makes perfect sense. The issue is how we handle the User Manual that will have everything in it. If only we could have update privileges for Gregg's web page and Github repository. We can change the documents on Gitub, but can't approve pull requests or manage the rest. And a website is more user friendly with links to a "download page" where you just get the correct zip file.
     
    John W Zerbe likes this.
  15. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    I wouldn't think that the $35 for the Pi would be a big deterrent considering they would have a dedicated computer then and wouldn't have to use another more expensive one but agree that getting the image off the internet in the form of a zip file adds more steps someone might not be familiar with. It has to be un-zipped which isn't hard but still a step some might not be familiar with. Using Win32DiskImager to put the image on a SD card is of course another step but not too hard to show how to do with a couple screen shots.

    I've considered another option. I bought four 8 gig micro SD cards yesterday as an experiment. I put the Steve's PI/JMRI image on them from my computer. It takes about 25 minutes for the download but I don't have to be there for that. I'm wondering if I offered these at $10 for the card and shipping if that would be an option. I don't mind making them up and wouldn't be making anything off of them except for maybe a couple bucks and would donate that to TrainBoard and/or Steve if he was interested and ok with this approach. This would give a new DCC++ person a card that only had to be inserted into the PI. Connect a couple cables and they are up and running.

    This still leaves documentation for getting the sketch on the Arduino as something that needs to be done but you can find that out there in fairly easy steps.

    I mentioned before a DCC++ ready Arduino with the sketch on it. I didn't have the thought that this should be in the scope of this groups endeavors but still can't believe someone hasn't pursued this as at least a partial business opportunity.

    Above you mentioned "a website is more user friendly with links to a "download page" where you just get the correct zip file.". If it would be of use my web site is available for that if you are looking for one.

    Sumner
     
  16. Mani

    Mani TrainBoard Member

    76
    15
    4
    Thanks for your explanation. I referring the same "Track Current" widget. But your explanation provided me better insight into how that works.
    Thanks again.

    Sent from my GM1901 using Tapatalk
     
  17. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    @Mani That still makes me wonder why the Deek-Robot board wasn't giving you a current reading as a percentage as it should. Was the track under load? I have a 50ohm, 5 Watt resistor I can put across the piece of test track so I can get a known value for current. I've also used a 12V fan in a pinch ;) For MOTOR_SHIELD_TYPE 0 (Arduino/Deek-Robot), the Current monitor pin for main is A0 and for the program track it is A1. I would make sure there is nothing wrong with those pins on the motor board. When you open the Current Monitor widget on JMRI, it starts sending a <c> command on a timer to DCC++ and that's how you get the current reading.

    If you want to see all the important settings, you can ground pin A5, then apply power to the arduino with the serial monitor open. The Arduino will ignore whatever you have set for interface type and dump a log to the serial monitor. This comes from a routine called "ShowConfiguration()" in DCCpp_Uno.ino if you want to spoil the surprise and look at the code ;) Unplug the Arduino, remove the jumper to A5 and power up again to get back to normal run operation.
     
  18. Mani

    Mani TrainBoard Member

    76
    15
    4
    Thanks. 'Track underload' could be the possible reason. But today I found something interesting.
    I have BLI Paragon 3 loco, earlier I used 'Deek Robot' to program it. Later I bought 'Genuine Shield' and replaced. Then running & programming my Paragon 3 became problematic (308 error). I thought it is typical BLI problem, started searching for solution. Neither worked.
    Today I switched back to 'Deek Robot' and everything working fine.
    I concluded that 'DR shield' indeed a good one for DCC++.
    But I still did not know why original shield is failed to program BLI P3 Loco. May it is limiting the current ?
    Interesting thing to research.


    Sent from my GM1901 using Tapatalk
     
  19. Roger Beschizza

    Roger Beschizza TrainBoard Member

    58
    8
    3
    I started a Trello board for DCC++ here. It looks to be fairly user-friendly and there is much more to it than at first seems obvious. There is a Trello project template here that shows most if not all of what is available - not sure we need all of it though.

    The DCC++ Trello board shows four basic configurations and as many others are suggesting I also support the idea of starting with one and adding the others [both here and to be determined] later.


    It does seem like a lost opportunity - and could so easily have been captured by Gregg at the outset. However, we don't know the reasons why he dropped the project so best leave that there but the whole business of business - marketing, resources [financial and human], development, support [financial and human] - was probably sufficiently daunting for him to call a halt.

    Good that you think I can help. I am more than willing to undertake whatever turns out to be within my skill set. I have a genuine UNO but no motor shield. If no-one else is able to assist I would be happy to purchase one and be the guinea pig - if you can all stand helping me through it! :)

    R-
     
    Last edited: Feb 21, 2020
  20. Mani

    Mani TrainBoard Member

    76
    15
    4
    Gents, I am designer my self. So if any need on that front I am happy to help.. I believe base station is more backend thing.. If any interface/design related tasks needed do not hesitate to reach out to me.
    I am always think JMRI interface great but lack of neat user experience makes it less desirable.

    Sent from my GM1901 using Tapatalk
     

Share This Page