开云体育

Locked Physical button to toggle track power #dcc-ex


 

I have recently setup an EX-CommandStation based on an Arduino Mega and I'm really liking it!
I'm currently running it connected to RPi3b running JMRI and using WiThrottle Lite on my phone. Each time I want to run a train I need to VNC into the RPi3b running JMRI just to turn on the track power, this is quite inconvenient.
?
I was therefore wondering if it could be possible to wire a physical button to one of the Arduino GPIO and use this to toggle the track power. I have tried? to do some online searching for this, but I have not found anything.
?
Can this be implemented via an EX-Rail automation? I.e. the button triggers the automation that sends the <1 MAIN> command? I have not found any reference that Ex-Rail automation can send DCC-EX Native Commands.
?
Alternative could somebody point me to some examples or guide me no how to edit the EX-CommandStation? code to add a physical button to toggle track power?
?
Thank you!
?


 

Hi JSa1987
?
Your questions really relate to the DCC-EX side of the system, so they would be best dealt with on the DCC-EX Discord server, where the development team and experienced users answer questions like this.? They also have a specific area of their Discord Server devoted to questions about EX-RAIL.? This is a link to join their Discord server:
https://discord.gg/y2sB4Fp
?
Having said that, assuming you are using a relatively recent version of DCC-EX (v5.x), then it is possible to send Track Power commands via EX-RAIL, and I believe this could be achieved from a physical button or switch connected to an IO pin on the Mega.? Take a look at the DCC-EX Web Site in the EX-RAIL Command Reference section, specifically this link:
?
I also assume you are aware that the DCC-EX system can be setup to apply track power automatically when it is turned on.
?
Cheers,
Trevor