Dirk Jahnke 97be2b6791 | ||
---|---|---|
include | ||
lib | ||
src | ||
test | ||
.gitignore | ||
.travis.yml | ||
README.md | ||
platformio.ini |
README.md
Model Railroad Fastclock Master/Controller
This is a controller for a model railroad fastclock. That clock looks like a normal clock, but runs at a higher speed than usual. This is used to compensate the fact, that distances on the model railroad are not properly to scale, as that would need much huger locations and setup than possible.
The tasks of the master clock / controller is:
- set the correct time
- set the speed of the clock
- start/stop the clock
- inform client clocks about the current time to be displayed
- support multiple clock systems, as we have multiple arrangements of model railroads at the same location having their own times
Principals
- all messages are sent as broadcast messages without acknowledge on device level
- all devices listen to all messages and filter out those messages addressed to them
- all messages begin with a message type, to-address, from-address
- addresses are a number in the range of 0..255
- address 0 is reserved for master/controller
- address 255 is reserved for a broadcast to all devices
- if acknowledges are necessary/wanted, then separate messages needs to be applied
- after receiving a message that needs an acknowledge, no device is allowed to send a message for a TBD. period of time except the requested device, which may send an acknowledge
- after sending a message, the same device must wait a TBD. period of time before sending another message
Protocol
Message structure
Type | To | From | Message |
---|---|---|---|
P,p,A,U,a,C,T,H,E | 0..255 | 0..255 | msg type dependent |
Message definitions
Nachricht | msgType | Attribute | Status |
---|---|---|---|
PairingOffering | P | FastclockName (8), ClockChannel | Implemented |
PairingRequest | p | ClientName(10) | Implemented |
PairingAck | A | FastclockName (8), ClientName (10), Network-Address | Implemented |
UnpairRequest | U | tbd. | --- |
UnpairAck | a | tbd. | --- |
FastClock | C | FastclockName (8), Hour, Minute, Second, ClockSpeed, Weekday | Implemented |
TextMessage | T | FastclockName (8), Message | Implemented |
Hello | H | tbd. | --- |
HelloEcho | E | RSSI, canRouteToMaster, FastclockName(8) | --- |
Links / References
- Digitrax Loconet PE: http://www.digitrax.com/static/apps/cms/media/documents/loconet/loconetpersonaledition.pdf
- we do not support loconet yet, but it is an option to be added later
- see page 14 ff. about FAST Clock definitions
- Rocrail with a description of the loconet interface (German): https://wiki.rocrail.net/doku.php?id=loconet:ln-pe-de
- List of loconet interfaces: http://loconetovertcp.sourceforge.net/Client/index.html, and here especially the fast clock: http://loconetovertcp.cvs.sourceforge.net/loconetovertcp/tcp/client/Clock/
- FREMO had some discussions about fast clocks, see the forum (available to members only)