-->
Showing posts with label dccex. Show all posts
Showing posts with label dccex. Show all posts

Sunday, March 30, 2025

Fixing the test bench for DCC-EX and Roco/Zimo

In various past posts, I mentioned that I could not configure Roco engines with a Zimo decoder through DCC-EX and JMRI - even though it just worked fine for a Piko loco ... Overall, the DCC-EX command station wasn't very stable.

I thought that the wiring on the test bench could be the issue. Because of the rotary switches, it could be that the track 1 and 2 were actually connected to each other, or something like that.

I made one change by disconnecting the rotary switch for track 2; therefore track 2 is now directly connected to the programming track of the DCC-EX command station.

 


 

The green and blue wires come from the DCC-EX command station, whereas the red and black wires come from the rotary switch for track 2.

And it's now working as a charm! I need to find a better solution since now I cannot connect track 2 to the ESU LokProgrammer or the AUX.

 

Sunday, March 23, 2025

Upgrading DCC-EX

I had an issue with DCC-EX and JMRI where the programming track would not be turned on automatically and I struggled configuring decoders for Roco or Piko engines. I decided to take a look and upgrade DCC-EX at the same time.


Upgrading from 5.0.9 to 5.4.6

As usual, I download the zip file from the release page:

https://github.com/DCC-EX/CommandStation-EX/releases

 I then extract the zip file and double click on the "CommandStation-EX.ino" file that opens the Arduino IDE and all the related files.


Customizing DCC-EX code

For the display, I have to adjust some code to display exactly what I want. I also provide here the config files.

CommandStation-EX.ino

CommandStation-EX.ino

CommandDistributor.cpp

WifiInterface.cpp

myAutomation.h

mySetup.h

config.h

 I can then compile and upload the code to the Arduino.


Testing the new release and config

And now, I have the new version and the programming track always on!


Positions of the wires for the Wifi module

Positions of the wires for the display and the 2 sets of tracks

 


Success!

It's now working for Piko engines, and likely for the Roco too:


 

 

 

 

Monday, November 11, 2024

Custom test bench - part 13: another switch for DCC-EX

 I realized a side effect of my recent upgrades on my test bench. When I use the ESU LokProgrammer on Track 1 or 2, the signal goes into the Arduino and starts the DCC-EX command station, and then it is a big mess! So the power switch to the Arduino was not enough.

For a while, I disconnected the track connectors from the Arduino, but it makes it cumbersome to put them back when I want to use JMRI since they are enclosed in a box.

I purchased a 4PDT switch to cut both wires from both tracks; probably an overkill ...


 Then, it's pretty easy wiring.

Before

Wires to the tracks

Wires to the Arduino

Reused an existing hole for the switch

The hole is a bit too big, but it works



Tuesday, June 25, 2024

EX-DCCInspector - part 2

 

Following part 1, I brought my setup to the layout and tried it out:





This is the output I get:

19:50:11.330 -> Bit Count/4 sec=23723 (Zeros=9326, Ones=14397), Glitches=0 19:50:11.367 -> Valid Packets=394, NMRA out of spec=41, Checksum Errors=4, Lost pkts=0, Long pkts=3 19:50:11.367 -> 0 half-bit length (us): 123.2 (96-1200) delta < 1100 19:50:11.367 -> 1 half-bit length (us): 57.7 (36-68) delta < 12 19:50:11.367 -> -- 19:50:11.631 -> Loc 1087 F20-F13 0 11000100 00111111 11011110 00000000 19:50:11.631 -> Loc 7689 L F4-F1 0 11011110 00001001 10000000 19:50:11.631 -> Idle 11111111 00000000 19:50:11.631 -> Loc 7689 Fwd128 Stop 11011110 00001001 00111111 10000000 19:50:11.631 -> Loc 1087 L F4-F1 10000 11000100 00111111 10010000 19:50:11.631 -> Loc 1087 Fwd128 65 11000100 00111111 00111111 11000010 19:50:11.667 -> Loc 7689 F20-F13 0 11011110 00001001 11011110 00000000 19:50:11.667 -> Loc 1087 F28-F21 0 11000100 00111111 11011111 00000000 19:50:11.701 -> Loc 10000 Stop 11100111 00010000 01100000 19:50:11.741 -> Loc 1087 F36-F29 0 11000100 00111111 11011000 00000000 19:50:11.780 -> Loc 7689 F12-F9 0 11011110 00001001 10100000 19:50:12.041 -> Loc 1087 F8-F5 0 11000100 00111111 10110000 19:50:12.105 -> Loc 7689 F8-F5 0 11011110 00001001 10110000 19:50:12.139 -> Loc 1087 F12-F9 0 11000100 00111111 10100000 19:50:12.442 -> Loc 7689 F28-F21 1 11011110 00001001 11011111 00000001 19:50:15.651 -> -


So, we see a lot of things. It seems that there's a memory in what has been transmitted recently - typically everything related to the engine I ran right before - Loc 7689, but nothing about blocks or Railcom related information
 
More investigation required, but looking at DCC-EX Discord, it seems that EX-DCCInspector might not be supporting Railcom just yet.


EX-DCCInspector - part 1

 

Now that my test stand is all set up with the DCC-EX Command Station, I spent a bit of time with another tool from DCC-EX: EX-DCCInspector and its DCC Diagnostic Tools. The goal is to understand if an Arduino could analyze the DCC packets and identify the locomotives running on the layout. More specifically, it would need to identify the engine going into a specific block.

A while back, I ran an experiment with RFID, but the range was still an open issue, as well as the speed off the models.

I purchased the part mentioned by the DCC-EX website: 

https://www.iascaled.com/store/ARD-DCCSHIELD

I followed the instructions and saw it could support a OLED display. It could also do Wifi, but I think I need different parts for that: ESP32, so I'll do that later. On the software side, I had to adjust the Config.h file and comment line 55 that is active by default (which doesn't make sense to me...):

line 55 // #define USETIMER


Eventually everything worked and this is how it looks:


Thanks for the DCC-EX Command Station, I'm able to use JMRI to command the train wirelessly while my laptop is connected via USB to the EX-DCCInspector module 😁





And this is the type of output I got on the Serial Monitor:

20:23:53.279 -> Bit Count/4 sec=24621 (Zeros=10016, Ones=14605), Glitches=0 20:23:53.279 -> Valid Packets=387, NMRA out of spec=30, Checksum Errors=0, Lost pkts=0, Long pkts=0 20:23:53.279 -> 0 half-bit length (us): 116.0 (108-124) delta < 16 20:23:53.312 -> 1 half-bit length (us): 58.0 (48-68) delta < 12 20:23:53.312 -> -- 20:23:53.312 -> Loc 1833 F28-F21 0 11000111 00101001 11011111 00000000 20:23:53.349 -> Loc 1833 Rev128 Stop 11000111 00101001 00111111 00000000 20:23:53.349 -> Loc 1833 L F4-F1 10001 11000111 00101001 10010001


Next step is to go on the layout and try again; this time with the ECoS as the command station where I have block detection via Railcom.



Wednesday, June 19, 2024

Custom test bench - part 12: DCC-EX + WIFI + OLED Display + Volt/Amp


This series of posts about my test stand is reaching its end ... After installing the DCC-EX, I also wanted to have a device measuring the tension and courant going into the main track - for me, track #1.

I installed the DCC Concepts Alpha Meter on the layout, but it would be too big for the test stand. Fortunately, a US manufacturer makes something similar, but smaller. It is the RRampMeter from DCC Specialties:



The setup is very straight forward. The main challenge was to create the opening on the panel so that the LED display would be flush.







So, I'm pretty happy with the end state as it is. The panel is not exactly organized in a logical way, but that will do for now!


Sunday, June 16, 2024

Custom test bench - part 11: DCC-EX + WIFI + OLED Display

 

Today, I focused on replacing the Roco DCC station by my new DCC-EX. First, I reconfigured the Arduino with the DCC-EX motor shield. It was one line in the config file to adjust and it worked immediately.


With the Arduino motor shield, the OLED display was plugged into the Mega board:



Pins 20 and 21 for the clock and the data: 



The DCC-EX motor shield not only simplifies wire management with only one power connection, but it also provides a dedicated header for the OLED, which will make it easy to fix the whole set into the box I purchased.





To mount the OLED display on the panel, I decided to mount the whole board on the panel. I had to bend the connectors, but it was quite easy.



Here's the final result! I added a switch - the round red one - for the DCC-EX unit, so I can choose not to start it if I don't need it. It also makes it easy to reset the Arduino without having to unplug the entire test stand.




Tuesday, June 11, 2024

Custom test bench - part 10: DCC-EX + WIFI + OLED Display

 

I just received the "official" DCC-EX motor shield named "EX-MotorShield8874". I ordered it directly from the DCC-EX web store.



My main reason to replace the Arduino shield with the DCC-EX one, is that this DCC-EX shield makes it easy to have only one power source with all the components: motor shield and Arduino Mega. Space is limited in the test bench ...


I unplugged the Arduino motor shield and positioned the new one. I plugged the power source and it seems to work immediately!



I still need to test it with an actual locomotive, but it would easy to reconfigure the Arduino with the DCC-EX installer or rather the Arduino IDE, since I modified the source code for the display.


Monday, May 27, 2024

Custom test bench - part 9: DCC-EX + WIFI + OLED Display

 

It was pretty easy to adjust the Arduino code to display what I wanted - except for the blank line that became a line of "-".



As mentioned in the DCC-EX documentation - here - I had to change the source code for that release. It is not in a config file, so at the next release, I will lose those changes and will have to do them again:

CommandStation-EX.ino

CommandDistributor.cpp

WifiInterface.cpp


Next step is to thing about how to fix the OLED display on the fascia of the test bench.



Thursday, May 23, 2024

Custom test bench - part 8: DCC-EX + WIFI + OLED Display

 

Now that everything works, I want to improve the display. I need more than 2 lines, and the 4-line LED actually takes up too much room. I therefore went to Micro Center and got a Adafruit OLED:

  • Adafruit Industries Monochrome 0.96" 128x64 OLED Graphic Display



The wiring was almost straight forward:
  • Pin 5V (Vcc) to Vin
  • Pin GND (ground) to Gnd
  • Pin 20 SDA (data) to Data
  • Pin 21 SCL (clock) to Clk

I reconfigured the DCC-EX with its installer and it worked immediately:




Next, I want to customize what is displayed:
  • Line 1: DCC-EX version
  • Line 2: blank
  • Line 3: status on Main
  • Line 4: status on Prog
  • Line 5: blank
  • Line 6: IP:port


Saturday, May 18, 2024

Custom test bench - part 7: DCC-EX + WIFI

 

Following my previous post, I ordered a couple of display with the goal to show the EX‑CommandStation IP address and port. Connecting the display was very easy and by default the IP and port are shown on one of the pages.

I tried to connect to different Wifi: EXT-5G and 5G, but it failed and showed an IP of 192.168.4.1, that is the default one for the Point Access mode, whereas I want the Station Mode that connects to my home wifi.

After discussing on Discord, the Wifi shield only works with 2.4Ghz wifi and it seems that my default Fios was too far for the shield to connect. But, I managed to make it with on the Wifi extender.





On JMRI, the connection is DCC++ Ethernet and I just needed to input the IP adress.