Skip to main content

I've been working on ways to control my MTH trains from my PC for many years. About 8 years ago, I released the first version of my Remote Train Control (RTC) program for the PC. The very first version was for a TIU tethered between the Remote jack on the TIU to a serial port on the PC (or a USB serial port). Next came a radio which enables RTC communicate to over a wireless radio connection to a TIU. After that came the ability for RTC to communicate over WiFi with both the WIU/TIU and the WTIU.

I've written several utility sketches to help me learn and understand how the trains are controlled. For example:

  • An Infiduino sketch to monitor the radio signal between the Remote and the TIU. It decodes the commands and produces a trace. (RTCSnoop)
  • An Infiduino sketch that emulates a TIU. This sketch can be controlled by either a Remote or the RTC program. (RTCEngine)
  • An Infiduino sketch with radio hardware that lets RTC communicate directly to a TIU. (RTCModem)
  • An Infiduino sketch that uses RFID technology so that the RTC program can locate engines and cars on my layout. (RTCNFCIRQ)

With a lot of effort, I was able to understand almost all of the communications between the Remote and TIU. I am now able to create packets to control the engines. The packets are complete with correct addressing, command syntax and CRC.

I figured this out by examination of the packets that I could sniff using Mike Hewett's original RS-232 interface design and the port settings that he found. Without Mike's insights into the RS-232 data stream, I don't think that I would have been able to get a foothold into this protocol.

So again, I figured this out just by looking at the RS-232 stream over the tether cable. No code disassembly, no logic analyzers, no opening up of Remotes or TIU's.

The sketches originally used USB based serial communications to the RTC program using the Infiduino. Then they moved to the ESP8266 using WiFi commications with the RTC program.

  • An ESP8266 sketch that emulates a WTIU. This sketch can be controlled by either the App or the RTC program (RTCWTIU)
  • An ESP8266 sketch that uses RFID technology so that the RTC program can locate engines and cars on my layout. (RTCNFCWiFi)

Now I've written an ESP8266 sketch that acts as a bridge between a Remote and the WTIU. (RTCAdapter)

ESP8266 and CC1101 Wireless Transceiver E07-900M10S by Darrell Lamm - top

This requires that a CC1101E radio (such as the one from Elechouse, Darrell Lamm or eByte be wired to the ESP8266).

Details on this web page.


This is a new sketch that I've just started to develop so it is not complete yet. It is meant to act as bridge between the Remote and the WTIU. The Remote only communicates via a radio and the WTIU only communicates via WiFi. This sketch, which requires a CC1101E radio, listens for commands over the radio from a Remote, translates them to what the WTIU requires and sends via WiFi to the WTIU. Then it takes responses from the WTIU over WiFi, converts them to what the Remote requires and sends them over the radio to the Remote.

The sketch named "RTCAdapter.ino" compiles into one runtime module which can be uploaded into the ESP8266. At the bottom of the web page are instructions for loading a precompiled binary into an ESP8266 and instructions for compiling the source code yourself.

Communications :

  • Command : RTC or Remote > via CC1101E radio > ESP8266 sketch which translates command format --> via WiFi --> WTIU
  • Response :  WTIU --> via WiFi --> sketch which translates response format --> via CC1101E radio --> Remote or RTC

There is some debug output that the sketch sends out the USB port. You can use a terminal emulator (I like 'Termite") set at 115200 baud to watch this debug output.

What works and what doesn't

I only have one WTIU so I can't test Super TIU mode and the code for that mode is not complete.
The Remote never indicates when TIU are in Super TIU Mode. So whenever you select that mode, RTC Adapter assumes that all TIU are in  Super TIU Mode.
I have tested all of the "normal" running commands (startup, shutdown, speed, whistle, horn, lights, couplers, smoke, etc.) for single engines, lashups and All Engine mode.
I've tested all of the accessory and switch control functions (so routes and scenes should work).
I've tested most of the hot keys.
I've not tested any of the really esoteric things like Protocast, ProtoDispatch, Speed mode, Track and Trolley modes.
I've not tested TMCC mode as I don't have any TMCC hardware.

Attachments

Images (1)
  • ESP8266 and CC1101 Wireless Transceiver E07-900M10S by Darrell Lamm - top
Last edited by SanDiegoMark
Original Post

Replies sorted oldest to newest

This is COOL!!! Bench testing the wireless module CC1101E from darrelllamm0 and using NodeMCU ESP8266 ESP-12 WiFi Development Board Module ESP 8266 ESP8266MOD US SHIP from iSellParts2U

Tested with the WTIU on my home network and using a PS2 3V engine as a test connected to the TIU Fixed1 channel.



IMG_5217

I'm even powering the module via the USB port and a cable on the WTIU. Just need to make a 3D printed enclosure and this will be slicker than slick.

Attachments

Images (1)
  • IMG_5217

Well, that scratches my previous project. I think this will work out much better than waiting for the Tethered adapter from MTH.

My original tether box ran into issues with translating the TIU ID to the proper device. I eventually had to program all of the receiver boxes to recognize TIU ID 1 and then set the remotes to speed mode to ignore return messages. This solved most of the problems but I digress, what has been developed by Mark is what MTH should have done from the get go.

It's as easy as:

  • Buy the suggested modules
  • Connect the 8 wires
  • Flash the firmware following the instructions
  • Configure it to your wifi, let it reboot and show it is connected

I know that is simplification, but really, that's more or less the instructions.

Special thanks to Mark for making this such a nice integration. Code that "just works"- remote acts like it's on the original TIU- it's magic for the WTIU that didn't natively support the remote. This is fundamentally game changing.

@GGG posted:

So do you need one for each WTIU or can one be connected to multiple WTIUs?  G

I am going to test this but it's intent right now is one per network (as I understand it).

In other words, one RTC adapter (RF 915MHZ remote bridge to WIFI) per your WIFI network SSID, and then your WTIU(s) connected to that "home" network.

The idea is, this module kind of makes the remote act as if it's the app on the network. Because app on the network is documented to work with multiple WTIUs in Super mode- in theory, that's the path to allow remotes to work with multiple WTIUs on big layout. -Yet to test.

Attachments

Images (1)
  • mceclip0
Last edited by Vernon Barry

What works and what doesn't (My answers in bold- Vernon)

I only have one WTIU so I can't test Super TIU mode and the code for that mode is not complete. -I'm borrowing a second WTIU for testing later this week
The Remote never indicates when TIU are in Super TIU Mode. So whenever you select that mode, RTC Adapter assumes that all TIU are in  Super TIU Mode.
I have tested all of the "normal" running commands (startup, shutdown, speed, whistle, horn, lights, couplers, smoke, etc.) for single engines, lashups and All Engine mode. So far my testing confirms all features  tried works- but will continue testing.
I've tested all of the accessory and switch control functions (so routes and scenes should work). I'm not using an AIU so no testing this.
I've tested most of the hot keys. Will test with various engines
I've not tested any of the really esoteric things like Protocast, ProtoDispatch, Speed mode, Track and Trolley modes. I will test these, I have a wide and varied fleet of PS2 and PS3 engines, trolleys, etc.
I've not tested TMCC mode as I don't have any TMCC hardware. Unsure how to test since we are still needing the serial port adapter cable for WTIU.

So far, everything thrown at it works.

Also- need to test lashups.

Edit- also, intend to test multiple WTIUs and multiple remotes at the same time (club or large layout testing).

Last edited by Vernon Barry

One fun thing I discovered- make sure your remote is on the latest firmware. This is not something I intend to do a ton of testing on but did see a glitch or two from using a remote with firmware 4.1 (old remote I forgot to update). When I did engine reset to factory defaults from this old firmware remote- the WTIU toggled the output power (reminded me of the momentary intentional power cut during programming chain files on an engine). When I first tried a PFA I got no sounds but it clearly was in PFA mode and timed waits and pressing of direction it came back out of PFA mode. Everything else seemed to work- but again highly suspect this could be old remote firmware version related.

So again, my personal recommendation- use the latest 6.1 firmware on your remote. Catch22- if all you have is a WTIU- you have no way of updating a DCS remote.............

Keep your TIUs if you do advanced things like programming chain files, engine files, and updating remotes.

What works and what doesn't.

Protocast and ProtoDispatch will probably lock up the Adapter and will require a reboot. I'm going to say that those modes are not supported.

The architecture of the MTH Remote/TIU system has one basic limitation. The communications over the radio uses one frequency to send commands to the TIU. This channel runs at 9600 baud (roughly bits/sec). When you use multiple Remotes, they have to share this bandwidth. When you get "enough" communications traffic from many Remotes, commands start to get dropped. Retries are attempted and that uses up yet more bandwidth.

Was trying to search and find possible 3D printed enclosures that we could "repurpose".

Case for NodeMCU V3.2 Arduino ESP8266  by Feroc on Thingiverse: https://www.thingiverse.com/thing:3223179

I had to use a pair of side cutters to remove one post for the radio module. Someone with better 3D modeling CAD skills might be able to make a better adaptation?

IMG_5219IMG_5221IMG_5223

Waiting on shorter wires to arrive but shoehorned it into the housing.

IMG_5224IMG_5225IMG_5226

Attachments

Images (6)
  • IMG_5219
  • IMG_5221
  • IMG_5223
  • IMG_5224
  • IMG_5225
  • IMG_5226
Last edited by Vernon Barry

FWIW, I had not previously used TIUs in super mode (not even 2 TIUs with different IDs).

I read up this topic and noted some of the issues others saw https://ogrforum.com/topic/sup...u-mode-with-new-wtiu

As such, I decided to try both WTIUs in home network mode- both attached to my home network set to super mode.

The DCS app on a phone works and talks to both WTIUs and was able to add 2 engines on both WTIUs and swap back and forth physically what engine on what track/WTIU and all worked.

Problem- this did not work for me with the RTC module and the remote. Basically it could talk to one WTIU but not both. Working with Mark to figure this out.

The good- I did get the RTC module to work with 2 WTIUs set to 2 different IDs 1 and 2 and that works- just cannot swap engines because they are associated with 2 different TIU IDs.

So more testing, but again this is very good and maybe even mistakes on my part. I am just not as experienced with super mode and IDs, and I'm even straying from MTH directions on how to set up super mode from MTH slightly on the network side. But I must stress- the app on a phone worked- so this at least partially makes me think my network config is working.

This is all great info and excellent to see progress being made here. Now, I'd like to hear from the elephant in the room.

@MTH RD, you can see here that a small group of forum members using their skills from the industries they specialize in, has been able to develop a much better product than a wired tether for the existing DCS remote.  Why would you spend time on a product that most people have constantly expressed displeasure about due to its lack of wireless capability?  What is being developed here is what your customers want, it's built with off-the-shelf parts and for a reasonable price point.  You have a fan base that wants to see your success with the WTIU but I think you'll have a hard time selling a tether add-on device when the general public is beating you to market with the wireless solution for the DCS Remote we wanted from the get-go.

Last edited by H1000

FWIW- Mark knocked it out of the park again- just tested an updated firmware version supporting Super mode- more than one WTIU but in super mode. Still more testing but I have seen it work!!!

One RTC module (ESP8266 + CC1101E radio), 2 WTIUs, set ID1 and ID2, both super mode, both in home network mode- all 3 devices on home router network.

Setup remote, add second TIU in TIU Setup, ensure both are set to super mode.

Also- tried combinations of MTH app on a phone and DCS remote- one starting up the engine- other sending another command like blowing the horn. Swapped engines from one WTIU to the other to ensure super mode and no address conflicts.

Nothing like some late night testing (yes, I'm East Coast- Mark is West Coast) - making it happen!!!

Last edited by Vernon Barry

"but I think you'll have a hard time selling a tether add-on device when the general public is beating you to market with the wireless solution for the DCS Remote we"

IF (or maybe when) my 2 TIU and 2 remotes fail, and I have to use a WTIU, I would NOT want a remote tethered to the unit. Way back when was it 2000 or so?) when DCS and the unit/remote came out, it was the ability to run a train WITHOUT tether wires and use a remote, that was 90% the attraction of the DCS system. Maybe I am alone in that thought! Maybe....MANY people feel that way.

More power to the people in this thread attacking this. I hope MTH pays attention.

Thank you to all involved. Greg (like Arnold said, my brain is mush, but my hopes are up!)

Mark is clearly the star in this show, the RTC Adapter is outstanding!  I have the pieces, I just have to find someone local with a WTIU and I'll join the testing. Since I have plenty of TIU boxes, I'm just not willing to park $400 or so in the WTIU at this point.

I'm thinking of a small PCB and 3D printed enclosure to make this a nice bundle.

Just yank the 900Mhz receiver out of your TIU and test it with the WIU. I agree, no sense in spending $400 to test it out when you already have the needed hardware in house.

@Craftech posted:

I anyone working on making a DIY remote for those of us who don't have one?  That would be great.

John

I had built one almost 10 years ago. It was designed to connect to an original TIU by radio. This was meant to be a very simple remote that you could give to a kid instead of your $1000 cellphone. The remote was hard coded to control a particular engine on a particular TIU. I had suggested that it be built with robust buttons, switches and joystick - something kid-proof if such a thing were possible.

You can see a demo at: http://www.silogic.com/trains/...pport.html#RetroXFMR

If we redesigned this, we could use an ESP8266 and connect via WiFi directly to the WTIU.

20150921_123021 Retro Transformer

Attachments

Images (1)
  • 20150921_123021 Retro Transformer: Retro Transformer
@Craftech posted:

I anyone working on making a DIY remote for those of us who don't have one?  That would be great.

John

Why re-invent the wheel? Can we not just reprogram a WiThrottle to work with the WTIU? Just asking since I'm not a programmer, but I think it should be possible to replace the DCC commands with the needed DCS ones?

Was looking at something like this project WiTcontroller.

Last edited by Darrell

You saying that does not answer the question or help in any way those poor souls who do not have a DCS controller. I never thought or said it would be easy, I know the RTC program runs on windows, but could it be ported ( the parts that send the DCS packets anyway ) to an ESP32 board? If that can be done then would not a DIY DCS remote be feasible? At least for the WTIU/WIU equipped layouts? Like I said, I'm not a programmer so I don't know if it could done or not, but it seems to me that using a DCC Wifi DIY controller as a base starting point might be better than trying to do one from scratch?

If I'm way off base here and nobody wants a new remote than I won't mention it again.

I've been converting my loco's to DCC anyway so I have many options for wireless controllers already, but I would be willing to help in someway any effort to make a new remote for DCS happen if at all possible.

@Darrell posted:

You saying that does not answer the question or help in any way those poor souls who do not have a DCS controller. I never thought or said it would be easy, I know the RTC program runs on windows, but could it be ported ( the parts that send the DCS packets anyway ) to an ESP32 board? If that can be done then would not a DIY DCS remote be feasible? At least for the WTIU/WIU equipped layouts? Like I said, I'm not a programmer so I don't know if it could done or not, but it seems to me that using a DCC Wifi DIY controller as a base starting point might be better than trying to do one from scratch?

If I'm way off base here and nobody wants a new remote than I won't mention it again.

I've been converting my loco's to DCC anyway so I have many options for wireless controllers already, but I would be willing to help in someway any effort to make a new remote for DCS happen if at all possible.

Mark's 900mhz <-> WiFi adapter doesn't have to be ported to Windows as it runs on the ESP32 board.  It's a stand-alone box, which is pretty keen!

Yes that is a great thing!

@Craftech posted:

I anyone working on making a DIY remote for those of us who don't have one?  That would be great.

John

This was the post I was responding to though. The RTCAdapter is a great development for those that already have a DCS remote and they want to use it with the WTIU, but if you are just starting out with DCS you can not get a remote to use with it, you are stuck using your phone or tablet until MTH releases their adapter that will allow you to plug in a DCS remote - but again you need to already have the remote! Since the DCS remote not only sends the command packets but also generates them as needed that is what a DIY remote would also have to do. Unless I'm mistaken, the RTCAdapter just takes the command in from the radio and then resends them out on wifi, it doesn't generates the commands. The RTC windows program that Mark developed does generate the commands and can now even send them to the WTIU through the PC's wifi. Any DIY remote would have to do this as well, which is why I was asking if RTC could be ported from windows to a ESP32. There are already designs out there for wifi controllers, I was just thinking it would be great if we could adapt Mark's great work into one of these designs and make our own WiFi DCS remote!

Since I am not a programmer I asked here if it was feasible, but haven't heard if it is or not yet.

I think my first post was too short and not very clear, sorry for the confusion.

@Darrell posted:

Yes that is a great thing!

This was the post I was responding to though. The RTCAdapter is a great development for those that already have a DCS remote and they want to use it with the WTIU, but if you are just starting out with DCS you can not get a remote to use with it, you are stuck using your phone or tablet until MTH releases their adapter that will allow you to plug in a DCS remote - but again you need to already have the remote!

OK, I got confused since this thread is about the RTCA adapter.  When multiple topics get discussed in a single thread, things get confusing.

Add Reply

Post
The DCS Forum is sponsored by
×
×
×
×
Link copied to your clipboard.
×
×