DCC++ Software - JMRI

TwinDad Jan 25, 2016

  1. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    JMRI supports DCC++ as of JMRI version 4.3.1. I recommend using the latest release of DCC++, whatever that is.

    Please post your questions, bug reports, or support issues in this thread!
     
    Scott Eric Catalano and HVT like this.
  2. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    TwinDad,
    Did you get a chance to look into the issue I found with not being able to connect over Ethernet using JMRI 4.3.2 and DCC++ 1.2.1+ (last post)?
    Thanks,
    Mike
     
    Scott Eric Catalano likes this.
  3. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    I'm still investigating. For future reference, can you copy/reproduce the "bug report" info here?

    Thanks,

    Mark
     
    Scott Eric Catalano likes this.
  4. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    For reference, the messages in the "Introducing DCC++" thread for this are: 719, 721, 726, 729, 731, 734, 735.
    The distilled version: Using JMRI 4.3.2 and Base Station 1.2.1+. I added a W5100 Ethernet shield to my Base Station stack. JMRI appears to connect to it (PanelPro opens up without error) but doesn't seem to interact with it (it cannot determine track power status, etc.). With JMRI shut down I connected via telnet and was able to issue commands to turn track power on and off, verifying the functionality of the Base Station stack. The same Base Station stack works fine with JMRI if I have it connected via USB.
     
    Scott Eric Catalano likes this.
  5. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    mikegillow...

    First: You have it configured to use the "DCC++ Ethernet" connection, not the "DCC++ Server", right?

    Second, double and triple check your IP address/hostname and port settings, just to be sure... they are in the Preferences window... you'll have to click the "Additional Connection Settings" checkbox... it defaults to port 2560.

    Third, open the DCC++ Traffic Monitor window and check the "Show Raw Data" checkbox... try a few things and tell me if you see properly formatted DCC++ commands (the opening and closing brackets will *probably* not be there). If not, tell me what you see.

    The Ethernet and Serial interfaces use the same packetizer to format the command packets, so the data heading over to the Base Station *should* be identical... just flowing over a different data pipe. I'm assuming (but will check) that the Base Station expects the data to be identical, irrespective of the pipe (E-net vs. serial).

    Finally, I don't suppose you have a TCP packet sniffer and know how to use it? If you do, a packet trace on the port while trying a few things may be helpful in debugging.

    Unfortunately, I'm *still* having hardware problems with my Ethernet shield, so I'm unable to directly debug at the moment.
     
    Scott Eric Catalano likes this.
  6. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Mark,
    I've used Wireshark before so I will see what info I can collect tonight.
    Mike
     
    Scott Eric Catalano likes this.
  7. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    Excellent! That will go a long way towards seeing whether JMRI is handling the interface properly. Thank you!
     
    Scott Eric Catalano likes this.
  8. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    JMRI 4.3.2, DCC++ Ethernet, IP and port confirmed via telnet test and double-checked in JMRI Connection definition.

    In Wireshark I only see three packets (the SYN, SYN-ACK, ACK handshake) when JMRI starts up and nothing more after that. The DCC++ Traffic Monitor (set for raw data) shows a periodic "[packet: s] Status Cmd" entry. I also saw [packet: 1] and [packet: 0] when I tried to send power on/off. But no traffic picked up by Wireshark going out to the Base Station. I also never see a FIN packet set when I shut down JMRI.

    If I capture a telnet session I see plenty of traffic in Wireshark. I can follow the single byte keystrokes I typed in the telnet window and see the multi-byte packet response from the Base Station.

    It appears that the JMRI commands are not being output to the Ethernet interface at all when set for DCC++ Ethernet.

    Hope this info helps!
     
    Scott Eric Catalano likes this.
  9. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    Yes, that helps very much! I'll dig right into that...
     
    Scott Eric Catalano likes this.
  10. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Trying to connect stack (Mega, Ethernet shield, Motor shield) wireless to JMRI
    JMRI 4.3.2, DCC++ Ethernet selected, IP and port confirmed
    Quick question: Where in Base Station code do you enter Network SSID and Wep encryption?
    I keep getting a connection time out.
    Thanks
    Steve
     
    Scott Eric Catalano likes this.
  11. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Code for wifi is not yet built into Base Station, just wired Ethernet. We would need to add code for SSID, password, and a few other housekeeping things.

    Which wifi shield do you have?
     
    Scott Eric Catalano likes this.
  12. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Using Arduino Wiznet W5100 Ethernet Shield
     
    Scott Eric Catalano likes this.
  13. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    It might be better to move the WiFi question over to the WiFi/Ethernet thread... more folks watching that thread might be able to help.

    Perfectly fine to keep it here, though.... just sayin'...

    JMRI doesn't really know or care what physical pipe the network connection is made over. It just creates a TCP link with the given IP and port. You could connect to the Base Station via carrier pidgeon, for all JMRI cares...
     
    Scott Eric Catalano likes this.
  14. Ken VanPelt

    Ken VanPelt New Member

    9
    16
    1
    I also have been unable to get ethernet running - Mega, Arduin.cc clone ethernet, JMRI 4.3.2. I get the following in the JMRI log. It reoeats every time I try a command.
    2016-01-27 12:35:04,945 jmrix.AbstractMRTrafficController WARN - sendMessage: Exception: port warn java.lang.ClassCastException: jmri.jmrix.dccpp.network.DCCppEthernetAdapter cannot be cast to jmri.jmrix.dccpp.DCCppPortController [Transmit]

    Maybe this will help in solving the issue.
     
    Scott Eric Catalano likes this.
  15. oleoj

    oleoj New Member

    3
    4
    2
    This is a basic programming error. I am new to DCC++ and I am waiting for the motor shield. I am planning to use JMRI.
    The reason for this error is that in some of the code paths they are casting from one type to another that is not compatible. This code path can't have been tested yet.
    Do you have the call stack in the log file that might give a hint on where the exception is thrown. I can't help you to test/fix it, but perhaps I can help in investigating the reason if I find the JMRI DCC++ code.
     
    Scott Eric Catalano likes this.
  16. oleoj

    oleoj New Member

    3
    4
    2
    I have found some of the code and I am sorry I can't help you at the moment, I have checked the class inheritance and they have one common class.
    The code in AbstractMRTTrafficController.sendMessage seems to be common to many implementations. I found some traces in code of configuration(xml). Perhaps it is a configuration problem. You must keep in mind that I have just checked the code for JMRI for some minutes but I really want to learn JRMI and DCC++.
     
    Scott Eric Catalano likes this.
  17. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    Yep. That's pretty much a smoking gun. I should be able to figure it out pretty quickly this evening, when I get time to look into it.
     
    Scott Eric Catalano and esfeld like this.
  18. Ken VanPelt

    Ken VanPelt New Member

    9
    16
    1
    No rush for me. I am using USB connected to a RaspberryPI right now. I just wanted to add some diagnostic info to the thread. I want to use ethernet eventually so the computer is not tethered to the Arduino.
     
    Scott Eric Catalano and esfeld like this.
  19. ISCOLD

    ISCOLD TrainBoard Member

    36
    38
    3
    Could someone please explain me how to setup and control turnouts with DCC++ and JMRI?
    In the past I was using a decoder accessory from ESU named SwitchPilot Servo. I has used this together with Dinamis system.
    I have no idea how to migrate from this primer system to DCC++.
    I will be glad if someone could help me.
    Thanks.
     
    Scott Eric Catalano likes this.
  20. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    I think I've found the problem. DCCppNetworkAdapter (the parent class of DCCppEthernetAdapter) is supposed to implement the DCCppPortController interface, but it doesn't. I've got the code fixed, and am working on testing it.

    I'll let you know when there is a build available to try out. If you want to build it yourself, you can pick up the source from the "fixbugs" branch of JMRI on my personal GitHub ... https://github.com/msunderwd/JMRI/tree/fixbugs

    There is apparently an unrelated problem in the PanelPro code, so... don't try that.
     
    Scott Eric Catalano likes this.

Share This Page