Jmri and dcc++ with Arduino shield configuration.

Christopher Warren Jun 11, 2018

  1. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    I am in the process of installing dcc++ with Jmri and an Arduino mega with a standard , clone, motor shield.

    I reached the point whereby the Jmri software talks to the mega and shield as in Jmri' s window the correct messages shown in green that the bits and bytes between them are actually flowing.
    However, I cannot control the on and off power switch. The LEDs on The shield remain lit and power of 16 v appears on the main track . With the engine running at full speed in reverse. Moreover the voltage is dc not ac. With no control of the engine.
    In Decoder pro mode it attempts to read the manufacturer cv but does not find the model and gives a generic model number and says it is not on the list.

    What can you recommend I do to manage the situation?

    Regards
    Chrid
     
  2. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Check your pin connections: Mega pin 2 to 13. Have you cut the required traces on the motor shield: V-in and brake. (or bend the pins away) In JMRI are your defaults set to DCC++?
     
  3. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    Pieter,
    First of all thank you for your ansering me.

    Yes I did cut all the links including the brake links. I am bridging pin 13 to pin 2. I also tried other positions.
    In am not 100 percent sure if I put dcc++ in all default fields.

    To test the system I downloaded a sketch from Arduino that just tests if the motors are functioning with the shield and the Mega. The result was positive on two dc motors I have .

    Where can I go from here?

    Chris
     
  4. RCMan

    RCMan TrainBoard Member

    271
    132
    12
    What motor shield are you using? Name and number.
     
  5. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    The shield is called ICSTATION L298P.
    It supposed to be a clone of the Arduino shield.

    Thanks and regards

    Chris
     
  6. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Maybe reprogram the Mega and check that you have picked the right options (power & lan) for your setup in the sketch. Only pin 2 to 13. For HO around 14 to 18 V DC on the shield power input (why you have to cut the v-in on shield). If your shield looks like the one in the pin mappings (pictures 2 & 3 ) then it should work. In an older post someone had a similar problem and it turned out he had somehow got an earlier version, but after he got the latest programmed one it worked. I found a few months ago mine didn't worked 100% and it turned out some of the pins on the shields I'm using, didn't make proper contact in the their sockets.

    In JMRI set the all the radio buttons in the default screen to DCC++. If they all change to DCC++ and stay so after a restart then you know your DCC++ settings is correct.

    Hopefully it isn't a stuffed shield.
     
  7. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    I hope so too. However is dcc++ more exigent as I did get the shield to work with an Arduino test programme.
    When I bought it on eBay I checked the photos and matched the layout of the components right up to the servo motor pin connections in the middle.

    Definitely I will reinstall and start again.

    Thank you for your prompt reply

    Chris
     
  8. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    From your 1st description it sounds like your shield is working, just have a bug somewhere else. Work through the notes at the beginning of the sketch and you can also have a look at the link that is in today's 'Arduino motor shield?' post.
     
  9. Curn

    Curn TrainBoard Member

    752
    500
    32
    Go to Edit>Preferences and select the Defaults section. Make sure DCC++ is selected for all the key software functions. These sometimes default to "Internal" and then JMRI wont send any commands to the DCC++ base station. See attached image for how I have mine set up.

    JMRIDef.png
     
  10. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    I reloaded the sketch and this time I ensured that the . h library defined in the sketch were copied to the arduino library folder.
    However nothing changed.

    I got a feeling I am not downloading the dccpp sketch incorrectly or I need to download a library which I am not aware of. As you can notice I an new to the game and only learning by trial and error . Can you guide me to a turorial on the installation of the dccpp?

    Looking forward to you input.
    Chris
     
  11. kbriffa

    kbriffa New Member

    1
    0
    1
    Hi Chris,
    Which sketch are you using? From the replies of other members it seems they are inferring that it's a software problem and not a hardware problem?
    Kenneth

     
  12. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    Hi Kenneth,
    I am downloading the sketch as found in the dccpp website. Together with the dccpp.ino file a number of library .h files are downloaded. The way I understand Arduino the library file in the Arduino folder has to contain each .h file. Furthermore there is a particular way the file is saving in a similar named folder .
    Perhaps we can use teamviewer and you can check what i am doing.
    Regards

    Chris
     
  13. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    I am doing some progress.

    I first ensured that dccpp was selected for all the parameters of Jmri. The result was that I can now switch on and off the power. But still not dcc.
    I then decided to use an Uno, with the following results
    1. The power can be switched on and off.
    2. I get 15 v on my dcc voltage (ac)
    3. The software can read from the decoder and distinguish the decoder type
    However, I have no control on the engine.
    The bridging on the uno are 13 to 5 and 12 to 11. So the mega may need some other bridging i have not tried .
    Unfortunately I am not familiar with Jmri as I never used it before. I use Rocrail but I cannot get the controller to sync with the hardware.
    Any ideas of what i can do next?
     
  14. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    At least some progress. Rocrail should work if you pick the dccpp controller (can delete the standard one that comes up first time) select serial - if you don't use Ethernet - and the coms port you Arduino is connected to. On the shield your input should be 14 to 18v DC -for HO. As a vanilla install you can only do programming on the programming track - see the notes in the sketch. In Decoderpro, have a look at the right bottom corner of the main page. There should be 3 options you can pick on how to program. Should be the first one.
     
  15. Christopher Warren

    Christopher Warren TrainBoard Member

    12
    0
    2
    Thank you Pieter. My difficulty with Rocrail is when you are setting it up, from the menu Rocrail properties and controller, there is the section I/O. Here I cannot retain the information. It goes away as soon as you choose the file again. Similarly with the final fields where one has the options of choosing the I/o 28 to 33 and the invert fields. I cannot get them to remain saved. There is a note though that these fields are temporarily saved to the Arduino.
    If you are familiar to Rocrail perhaps you can tell what i should expect.
    I read the wiki and made the settings as shown in the wiki...
    My present controller is a Lenz. However in the controller menu I click on dcc++ and click default but I have no way in knowing if it is actually chosen.
    Have a nice day.
    Chris
     

Share This Page