DCC++ Update Project 2020

FlightRisk Feb 16, 2020

  1. Dex

    Dex TrainBoard Member

    55
    30
    5
    So we have a new release this time i have fixed the various issues one of them was caused by the renaming of the Git Repo for classic so when it was attempting to clone it would crash since the repo didnt exist. This is all fixed now with some additional error handling along with proper logging for when it is uploading to arduino. You can now also select your motor shield those options are now enabled and working you can switch quickly between the 2 with little to no down time by one click. All i can say is test and let me know.

    https://github.com/DCC-EX/BaseStation-Installer/releases/tag/v1.1
     
  2. Karl Masoner

    Karl Masoner New Member

    4
    2
    5
    I’m not very far into DCC++, but I can say that in the many other projects I’ve done I’ve found that with the exception of form factor the Uno clones all use same microcontroller chip as the original. Some use the DIP form factor, some use the SMD form factor. There is a greater chance for incompatibility with the USB chip. Many are using CH340 chips which require different drivers, but work just fine once the drivers are downloaded. Some have upgraded to the faster AT16U2 chip. Again, if the appropriate drivers have been included so the IDE can communicate with the Arduino there should be no issues.
    I haven’t run across any clones which deviate from the Arduino pinout. I would have to research that. I have a dozen or so Arduinos, but most are Nanos which I am using to create a more compact package. I’ll let you know if I find an answer to the pinout issue.


    Sent from my iPad using Tapatalk
     
  3. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Major, major props! It works. I haven't fully tested yet by program decoder, etc but it worked great and could run a train and the DCC++ monitor looks correct! For reference I did a Mega, original shield, classic setup. This is really huge in making this super simple!

    One thing that's bugged me I'll go ahead and bring up is that once you press functions (even on and off) the basestation keeps sending packets of function off even when you release that loco from a throttle, etc. It just seems that it is putting unnecessary traffic onto the bus but I have no idea if its a real issue or just annoying. I've attached a snap out of JMRI DCC++ log. This is from 2 locos, both released and even after toggling track power
     

    Attached Files:

  4. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    Yep great news. I didn't have the same luck at first. I extracted the files to a folder that was 6 directories/folders (I'm an old DOS guy) under C:/ and it wouldn't compile/build right.

    Finally made a folder C:/test and extracted to there and it worked perfect. I'll put the motor shield on tomorrow and test it on a test track.

    Thanks Dex I think you might of just brought DCC++ to potentially hundreds or probably more new users,

    Sumner
     
  5. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    Update: Connected the arduino/shield that I used Dex's installer to put Base Station Classic sketch on to a test track. Using JMRI on the Pi it ran as it should. Great work Dex it was sure easier to do than following the 19 steps I had to follow last year to do the same thing.

    Using the installer at this point one has a choice between 'Base Station' and 'Base Station Classic'. Am I right that 'Base Station Classic' is Gregg's version with some recent fixes?

    What is the 'Base Station' version?

    Sumner
     
  6. Dex

    Dex TrainBoard Member

    55
    30
    5
    So yes Base Station Classic is Greggs version with a few fixes. As for Base Station that is currently based on @Atani latest changes in his github where he added support for LCD screen some fixes and the ability to also use an ESP8266 wifi module for communication just like an ethernet shield on a mega. That is where most of the work for DCC-EX will be taking place.
     
    Sumner likes this.
  7. Roger Beschizza

    Roger Beschizza TrainBoard Member

    58
    8
    3
    Will definitely give this a go. Can I just check that it is simply a matter of plugging USBA-B cable into UNO and laptop ensure COM port is discovered correctly and click on the download option that your link points to? Oh, and I don’t need to attach the motor shield necessarily? Apologies if I sound so inept but this is a leap into the unknown for me. R-
     
  8. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    You don't need the motor shield attached and correct on the cable between the two.

    Sumner
    ..
     
  9. Dex

    Dex TrainBoard Member

    55
    30
    5
    This is super simple download the zip file, extract to its own folder. Then run BaseStationInstaller.exe. Select BaseStation Classic from first option. Select board, shield and comport. Press compile and upload wait until it says successful the run. Motor shield can be connected or not it runs independently from Arduino and just gets commands from ardunio so once we get new DCC++ Ex BaseStation done u can switch between them easily with this system.

    Sent from my Pixel 4 using Tapatalk
     
    Sumner and Roger Beschizza like this.
  10. Roger Beschizza

    Roger Beschizza TrainBoard Member

    58
    8
    3
    Thanks Dex. For some obscure reason I’ve been awarded a trophy. Amazing what ineptitude can achieve. :LOL: R-
     
    Last edited: Mar 15, 2020
  11. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    I just put up a page that goes through the steps for anyone that has never done something like this at all. Hopefully it helps and I'd welcome feedback on any changes that might need to take place.

    http://1fatgmc.com/RailRoad/DCC/page-4.html

    Dex has made this super easy but I still remember the time that some of this seemed intimidating,

    Sumner
     
  12. Mani

    Mani TrainBoard Member

    76
    15
    4
    @Dex When I try to install, Norton AV blocked it. This will be a problem for users with Antivirus installed. (I know I can disabled AV temporarily). Is there any other way to avoid that?

    SCREENSHOT 2020-03-16 13_56_46-.png
     
  13. Roger Beschizza

    Roger Beschizza TrainBoard Member

    58
    8
    3
    Brilliant! Thank you. R-
     
  14. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    I use McAfee and have no problems with that but after extracting the files when I run BaseStationInstaller Windows Defender comes up with a warning but there is an option to 'run anyway' and using that it goes on and works fine.

    Sumner
     
  15. Dex

    Dex TrainBoard Member

    55
    30
    5
    I hate to say this but I'm going to @Mani I would stop using Norton as it is trash for AV on a consumer level. @Sumner same with McAfee. As a PC tech I have dealt with AV for years best protection for you is safe browsing. If you must have AV then use windows defender or Malwarebytes. Without a code signing certificate for the project I cannot keep this from happening and with it being open source I'm not sure how code signing would work. There is nothing malicious in my code you can read that for yourself. A lot of AV will put up false positives anyways here is virustotal for it.

    https://www.virustotal.com/gui/file...e57de9c6ad96ad33ace2c3447c5e187a8b3/relations
     
  16. Mani

    Mani TrainBoard Member

    76
    15
    4
    Thanks Dex. I believe you on that the code is not malicious. . I do not know where/how they (AV) get information. But just a finding from my testing...
    Beware not only 2 but more crappy AV out there.

    Sent from my GM1901 using Tapatalk
     
  17. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    @Dex, It looks like you used C# 2017 or 2019 for this project? Or are you using VSCode? I don't think it will be possible to open the project in my version of Visual Studio. The entire corelib changed in 2017 and it isn't backwards compatible. I believe to get it to work in VSCode/PlatformIO, I would have to install a new .NET Core 3.1 SDK AND the runtime and the C# Extension. I might try that, but I'm familiar with Visual Studio and using PlatformIO for just the Arduino stuff, so not sure I can tackle this. If anyone is using this in VSCode and thinks it won't screw up my Visual Studio 2012 or PlatformIO for Arduino, please PM me.

    Also, maybe you should put the .suo file in .gitignore? Or do you figure a coder knows to delete that to open the project? Some folks will get an error that the project unloaded and not know they have to delete that to get it to recreate with the settings on *their* computer.

    And do you want to edit the README.MD file I added to the repo with some instructions? You can see I started an empty template to fill in. Perhaps more info can go in a Wiki, but for now, instructions on using the program and ones on how to run it in Visual Studio and VS Code may be helpful. In anyone else can edit that file, that would be great too.
     
    Last edited: Mar 16, 2020
  18. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    @Dex, et. al. I also merged the latest changes into EX. I (or someone) needs to put those into classic as well. Look at the Projects int he main repo. I have a todo list for each project we can track things in.

    Also, I am going to rename things soon. So we have BaseStation-Classic. Should the regular BaseStation be BaseStation-EX? This is just the repo name. And I am also going to rename the folders and files and everything that is DCCpp_Uno, to just DCCpp or DCC-EX or something. We can talk about it. But I don't want to do it until we are ready since it will break the installer. So @Dex, your input will be key here.
     
  19. Dex

    Dex TrainBoard Member

    55
    30
    5
    So i am using .Net Framework 4.8 not .Net Core. I prefer proper access to Windows API if i switch it would be to Mono.Net. 4.8 requires VS 2019 as that is what i am using to compile and code in. I am not using visual studio code for this project at this time. I do use it for all my other projects. The issue i am having is with python and trying to execute obtaining Python and installing pip and platformio. I think i may have to make an installer that will make python installer a prereq and after it finishes and python is in the path then i can execute the code to get pip and then platformio. This is the issue i am having and since i am trying to use the embedded version of python it fails to work. As for the .gitignore this is basically the one from microsoft directly so it removes all files associated with my local instance of it. Once you upgrade to VS2019 you should be able to open and compile with no issues. I have cloned it on another machine that never used it and it worked just fine.


    If you rename it just make sure i know what you rename it to so i can change it in the installer as that is what caused the force close before XD. Although now i do have some handling for it.
     
  20. RoadRailer

    RoadRailer TrainBoard Member

    41
    11
    4
    System.IO.Ports is available as a .NET Standard 2.0 library, so that would not pose an obstacle to using .NET Core. However, the upstream ArduinoUploader NuGet package (which Installer uses) does not yet support .NET Standard. Unfortunately, that project hasn't been updated in 2 years.

    ArduinoUploader does itself have a dependency on IntelHexFormatReader, but that does already support .NET Standard, so that sub-dependency should not be a blocker.

    Thus, in short, it appears it would be possible to create an Installer version targeting .NET Core, but we would probably end up needing to either get involved with the upstream projects or fork them in order to implement the updates needed to bring things up to .NET Core. At least for now, there is an "off-the-shelf" workable option using with the .NET Framework. An earlier version of .NET could possibly be targeted, if support for earlier versions of Visual Studio is needed. The .NET Framework 4.6.1 had a fairly large distribution base, to the point that Microsoft used it in certain baselines instead of even 4.6.2.

    Correct, and it appears that *.suo is currently in the .gitignore file; however, if Git started tracking any files before they were added to .gitignore, those files must be actively removed from Git tracking; otherwise, Git will continue to track those files. (In other words, adding something to .gitignore won't make Git ignore something that is already in its version control.)
     
    Last edited: Mar 16, 2020

Share This Page