-
Notifications
You must be signed in to change notification settings - Fork 8
Station Controller API
This is a MQTT interface, to use MoDeS3 resources.
Status info about a segment if it is enabled or disabled.
Segment State changed messages are sent automatically by StationControllerAPI.
"state" has the current state.
Topic: segment/state
{"segmentID":1,"state":0} //disabled
{"segmentID":1,"state":1} //enabled
In addition, to extend basic functionality, you can request manually to get Segment State current state.
Just send:
Topic: segment/state
{"segmentID":1,"getstate":"one"} //for one segment
{"getstate":"every"} //for every segments
Status info about a turnout’s reference state, if it is straight or divergent.
Turnout State changed messages are sent automatically by StationControllerAPI.
"state" has the current state.
Topic: turnout/state
{"turnoutID":1,"state":"straight"}
{"turnoutID":1,"state":"divergent"}
In addition, to extend basic functionality, you can request manually to get Turnout State current state.
Just send:
Topic: turnout/state
{"turnoutID":1,"getstate":"one"} //for one state
{"getstate":"every"} //for every states
Status info about which segment has train on it.
Segment Occupancy messages are sent automatically by StationControllerAPI.
"state" has the current state.
Topic: segment/occupancy
{"segmentID":1,"occupancy":"occupied"}
{"segmentID":1,"occupancy":"free"}
In addition, to extend basic functionality, you can request manually to get Occupancy.
Just send:
Topic: segment/occupancy
{"segmentID":1,"getoccupancy":"one"} //for one segment
{"getoccupancy":"every"} //for every segment
Change Segment State to enabled or disabled.
Topic: command/segment
{"segmentID":1,"state":0} //disabled
{"segmentID":1,"state":1} //enabled
Change every Segment State to enabled or disabled.
Topic: command/segment
{"stateAll":0} //disabled
{"stateAll":1} //enabled
Set Segment Occupancy.
Topic: command/occupancy
{"segmentID":1,"occupancy":"occupied"}
{"segmentID":1,"occupancy":"free"}
Change Turnout State to straight or divergent.
Topic: command/turnout
{"turnoutID":1,"state":"straight"}
{"turnoutID":1,"state":"divergent"}
Set Train speed and direction
Topic: command/train
{"trainID":"taurus","speed":0, "direction":"forward"}
{"trainID":"piros","speed":126, "direction":"backward"} //max 126
{"trainID":"sncf","speed":64, "direction":"backward"}