Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional accessory definition commands (Turnouts) #115

Open
Asbelos opened this issue Jan 7, 2021 · 12 comments
Open

Additional accessory definition commands (Turnouts) #115

Asbelos opened this issue Jan 7, 2021 · 12 comments

Comments

@Asbelos
Copy link
Contributor

Asbelos commented Jan 7, 2021

By defining turnout wiring to the command station, rather than an external (JMRI, RocRail etc) we give the following user advantages:

  1. Turnout commands issued directly to the CommandStation by throttles such as EXWebThrottle, EngineDriver can be understood and actioned. This is not possible if JMRI for example directly jiggles pins or sends opaque DCC messages.

  2. A wider range of hardware connection methods can be supported (at least at the logic level), including remote nodes.

  3. Use of EEPROM can be reduced if these commands are automatically issued at startup (with another feature already proposed)

  4. RMFT automation can operate on turnouts etc without JMRI present.

  5. JMRI could be simplified so that ALL turnout activate/deactivate commands that go through the command station just use the
    < T id activate> command.

Suggested commands:
< T id DCC dccaddr dccsubaddr> DCC connected to main track (= existing DCC++ type)
< T id PROGDCC dccaddr dccsubaddr> DCC connected to prog track channel of waveform
< T id PIN pin HIGH/LOW> HIGH/LOW determines what to set pin to for "Activated"
< T id I2CPIN pin HIGH/LOW>
< T id PULSE pin1 pin2 duration>
< T id I2CPULSE pin1 pin2 duration> as PULSE but over I2C expander
< T id SERVO angle1 angle2 duration>
< T id I2CSERVO angle1 angle2 duration>
< T id LCN node> //passes request to an external node (node hardware configured elsewhere)

Each of the above commands would create a Turnout object (or a subclass thereof) so that turnout activate/deactivate and enumeration can be common.

@matt-vdv
Copy link
Member

matt-vdv commented Jan 7, 2021

@Asbelos sounds like an excellent idea!
Should we wait until this is sorted before implementing turnouts on Webthrottle-EX?

@grbba
Copy link
Contributor

grbba commented Jan 7, 2021

One question where do i define the id and how is the id build ? Would that be stored in the eeprom afterwards ?

@Asbelos
Copy link
Contributor Author

Asbelos commented Jan 7, 2021

No need to wait to do webthrottle because webthrottle will never need to know about the turnout technology... it will only need to know the list of ids and how to issue the existing turnout throw command < T id 1|0 >

@Asbelos
Copy link
Contributor Author

Asbelos commented Jan 7, 2021

id is a positive integer, chosen by the user to uniquely identify a turnout... so when something wants to throw, it only needs the id

Eeprom saving is similar to the existing system but IMHO completely unnecessary

@grbba
Copy link
Contributor

grbba commented Jan 7, 2021 via email

@matt-vdv
Copy link
Member

matt-vdv commented Jan 7, 2021

So how would a user set up a new turnout? Would this be done when the code is compiled or later using commands?

@Asbelos
Copy link
Contributor Author

Asbelos commented Jan 7, 2021

My understanding is that the Lcn master would know where to send the message. If not, we could add the node to the command.

@Asbelos
Copy link
Contributor Author

Asbelos commented Jan 7, 2021

These commands, like all the others, can be injected at any time, by hand, by jmri or (with the benefit of a separate auto-startup feature) from the sketch.

@matt-vdv
Copy link
Member

matt-vdv commented Jan 7, 2021

Ok thanks!

@FrightRisk
Copy link
Member

What does this mean for the accessories command? Anything?

@FrightRisk
Copy link
Member

So if I am following, we define all the different types inside the CS. It is refreshed at startup. Then we need to know what kind of device is on each turnout ID and the front end software sends the same command it always has and things behind the scenes (us or LCN, etc.) just says "go" and that's a servo spins or a switch flips?

@Asbelos
Copy link
Contributor Author

Asbelos commented Jan 14, 2021

Thats one way.... otherwise the jmri/rocrail has to understand all the combinations.
The easier way, Imho, is to pretend to jmri and rocrail that we ONLY support dcc turnouts (and we dont keep a list) and have the cs able to intercept accessory packets and jiggle pins or servos instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants