DCC-EX / WebThrottle-EX

WebThrottle-EX is a web based (html,jQuery,JavaScript) Controller/Throttle for DCC-EX EX-CommandStations
https://dcc-ex.com/WebThrottle-EX
GNU General Public License v3.0
21 stars 14 forks source link

TrainLink integration #26

Open matt-vdv opened 3 years ago

matt-vdv commented 3 years ago

@FrightRisk I have created this issue to discuss the use of TrainLink with exWebThrottle.

For reference, the repo can be found here and the documentation here.

FrightRisk commented 3 years ago

I mentioned this in another issue, but let's do discuss it here. The first question is how would it affect (if at all) the whole discussion of how to handle turnouts, accessories, sensors, etc. in the future and fit in with TPL? What issues are there with any affect on the CS in terms of size or consuming Arduino resources?

matt-vdv commented 3 years ago

@FrightRisk I am doing my best to follow the way that is decided for TPL. I have been discussing the implementation of turnouts, to make sure that it is 'future proof'. Once TPL is finalised in CS, I will get to work implementing to the best of my ability with TrainLink. As far as the CS is concerned, as it is run on a server on a raspberry pi or PC at the moment, there is no impact. I am just about to start playing around with an ESP32 to try and get the server running on that.

matt-vdv commented 3 years ago

Forgot to say, it is supposed to be a more easy to use, open and cross-platform version of WiThrottle. WiThrottle is great for mobile devices, TrainLink is for Desktop, Arduino and possibly mobile

I have started playing around with TrainLink in the trainlink branch

ManiAkasapu commented 3 years ago

So is it like now we have multiple comm/ interfaces?

  1. Serial
  2. Wifi

In that we have interfaces like

  1. Direct command
  2. TPL
  3. Withrottle
  4. Trainlink

??

matt-vdv commented 3 years ago

@ManiAkasapu Basically, yes.

FrightRisk commented 3 years ago

I wonder if we can streamline this. In an ideal world we could "fix" WiThrottle. It really could be SO much better. We may be able to drive that on their end and suggest improvements, but they are reluctant to break compatibility with other things that use it. I am trying to find out how may things use it. Can't be that many

matt-vdv commented 3 years ago

@FrightRisk Just to be clear, TrainLink is not a WiThrottle replacement. I never intend to write a TrainLink app for either Android or iOS. The only way I can see coming close to that is with a PWA, I would have no idea how to even start to write a native app for either platforms. Also, I can see some different use cases for WiThrottle and TrainLink. If a user primarily uses JMRI on a laptop connected to the CS, then WiThrottle would make more sense, as they can connect to JMRI and directly to the CS when not using the laptop. However, if a user has a RPi or similar device dedicated to running the layout, then I think TrainLink would be better. They would be able to set up the TrainLink server on boot, then connect their client, whether it be a laptop or Arduino/ESP handheld over Wi-Fi and they are ready to go.

Also, remember that TrainLink is an API/protocol, not an app. It is designed to make it easier for developers to write software that controls a layout over Wi-Fi and provides a universal system across multiple platforms. I am willing to implement anything you feel is required at any point, and as it is a library, new features can be added without others needing to change their code, as long as they keep the library up to date.