SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
The imitation Game
Model Railways and Open Data
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
What’s the dream?
A completely autonomous model railway, utilising the
Network Rail Open Data feeds to move trains around
the layout in real-time.
“
”
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
What do we need?
Data Feeds
Command and
Control Software
Data Converter
Model Railway
Hardware
Interface
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
What do we need?
Data Feeds
Command and
Control Software
Data Converter
Model Railway
Hardware
Interface
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
Network Rail data feeds and the Open Rail Data community
●
https://wiki.openraildata.com/
●
Amazing source of information on the various data formats that Network Rail make available via their
API’s
●
https://datafeeds.networkrail.co.uk/ ← Sign up here to get access to the data!
●
Be careful, data comes in multiple formats, and not all formats contain all the data…
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
STOMPing around in Python
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
JMRI – The brains of the operation!
●
Java-based
●
Multiple applications depending on what you want to do
●
It uses Jython!
●
Jython is really old…
●
It supports MQTT!
●
MQTT requires yet more “stuff” to be setup
●
It has a TCP-based API called WiThrottle for control via mobile devices!
●
The WiThrottle API is… unique
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
WiThrottle – RL2][RGS 41}|{41}|{L][Test Loco}|{1234}|{L
●
It uses [
[ and ]
] to differentiate between locomotives
●
It uses {
{ and }
} to show the values for settings
●
The settings are always in the same order…
●
… but never as key=value
key=value pairs
●
Commands use three characters in a row to delimit: <;>
<;>
●
All feedback is sent as new lines, but you don’t know when it’s finished sending feedback
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
WiThrottle – Setting a function
M0AS3<;>F110
M0 = Throttle ID
A = Send an “action” to a locomotive
S = Make sure we’re using DCC “short” mode
3 = The DCC channel we need to target
<;> = That weird choice of delimiter
F = Set a Function
1 = Either 0 (Off) or 1 (On)
10 = The function to act against (from 00 to 99)
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
WiThrottle – Moving the loco
M0AS3<;>V50
M0 = Throttle ID
A = Send an “action” to a locomotive
S = Make sure we’re using DCC “short” mode
3 = The DCC channel we need to target
<;> = That weird choice of delimiter
V = Set the speed (v == Velocity?)
50 = A value between 0 and 126
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
WiThrottle – Switching Direction
M0AS3<;>R0
M0 = Throttle ID
A = Send an “action” to a locomotive
S = Make sure we’re using DCC “short” mode
3 = The DCC channel we need to target
<;> = That weird choice of delimiter
R = Set the direction
0 = Either 0 (Reverse) or 1 (Forward)
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
Let’s make this a bit easier…
PyWiThrottle
https://github.com/modelrailwaysascode/pywithrottle
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
Connecting to the track using
●
www.merg.org.uk
●
Numerous circuit boards to connect to model
railways and accessories via all kinds of
protocols and methods
●
Large online community who are incredibly
helpful
●
Cheap to join
●
Kits are not expensive
●
Full computer control of a layout, including block
detection and point control for under £90!
(Commercial equivalents are well over £250 for
a “decent” setup)
Photo © MERG
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
Putting it all together!
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
The output
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
What next?
●
Build a proper layout rather than the test track
– Find a suitable location (St. Ives Branch line?)
– Model it
– Work out the TIPLOC/STANOX codes for each section
– Write the integration based on PyWiThrottle
●
Continue to update PyWiThrottle to add more functionality (Contributors welcome!)
●
Create more fun distractions timewasters projects under the “Model Railways as Code” banner
@proffalken | github.com/modelrailwaysascode | github.com/proffalken
Thank you!
https://github.com/modelrailwaysascode/
https://twitter.com/proffalken

Contenu connexe

Similaire à The imitation Game - EMFCamp 2022.pdf

Xilinx training in mohali
Xilinx training in mohaliXilinx training in mohali
Xilinx training in mohali
Arwinder paul singh
 
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
HostedbyConfluent
 
What is your money doing?
What is your money doing?What is your money doing?
What is your money doing?
Alfonso Fernández
 

Similaire à The imitation Game - EMFCamp 2022.pdf (20)

Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
 
Xilinx training in mohali
Xilinx training in mohaliXilinx training in mohali
Xilinx training in mohali
 
Graph web superpath-2015 - SVG Extension
Graph web superpath-2015 - SVG ExtensionGraph web superpath-2015 - SVG Extension
Graph web superpath-2015 - SVG Extension
 
Combitronic: Multi-axis Control with Animatics SmartMotors
Combitronic: Multi-axis Control with Animatics SmartMotorsCombitronic: Multi-axis Control with Animatics SmartMotors
Combitronic: Multi-axis Control with Animatics SmartMotors
 
Google cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache FlinkGoogle cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache Flink
 
Operationalizing Machine Learning: Serving ML Models
Operationalizing Machine Learning: Serving ML ModelsOperationalizing Machine Learning: Serving ML Models
Operationalizing Machine Learning: Serving ML Models
 
Deep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming LibraryDeep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming Library
 
Angular 2 overview in 60 minutes
Angular 2 overview in 60 minutesAngular 2 overview in 60 minutes
Angular 2 overview in 60 minutes
 
What is Socket Programming in Python | Edureka
What is Socket Programming in Python | EdurekaWhat is Socket Programming in Python | Edureka
What is Socket Programming in Python | Edureka
 
Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache Camel
 
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
Building Kafka Connectors with Kotlin: A Step-by-Step Guide to Creation and D...
 
A Brief Conceptual Introduction to Functional Java 8 and its API
A Brief Conceptual Introduction to Functional Java 8 and its APIA Brief Conceptual Introduction to Functional Java 8 and its API
A Brief Conceptual Introduction to Functional Java 8 and its API
 
The Graphical Web Conferernce 2015 - Superpath SVG Extension
The Graphical Web Conferernce 2015 - Superpath SVG ExtensionThe Graphical Web Conferernce 2015 - Superpath SVG Extension
The Graphical Web Conferernce 2015 - Superpath SVG Extension
 
Python Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkPython Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on Flink
 
Microservices in Clojure
Microservices in ClojureMicroservices in Clojure
Microservices in Clojure
 
Gearpump akka streams
Gearpump akka streamsGearpump akka streams
Gearpump akka streams
 
What is your money doing?
What is your money doing?What is your money doing?
What is your money doing?
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
 
Iot gateway dream team - Eclipse Kura and Apache Camel
Iot gateway dream team - Eclipse Kura and Apache CamelIot gateway dream team - Eclipse Kura and Apache Camel
Iot gateway dream team - Eclipse Kura and Apache Camel
 

Dernier

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Dernier (20)

How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 

The imitation Game - EMFCamp 2022.pdf

  • 1. @proffalken | github.com/modelrailwaysascode | github.com/proffalken The imitation Game Model Railways and Open Data
  • 2. @proffalken | github.com/modelrailwaysascode | github.com/proffalken What’s the dream? A completely autonomous model railway, utilising the Network Rail Open Data feeds to move trains around the layout in real-time. “ ”
  • 3. @proffalken | github.com/modelrailwaysascode | github.com/proffalken What do we need? Data Feeds Command and Control Software Data Converter Model Railway Hardware Interface
  • 4. @proffalken | github.com/modelrailwaysascode | github.com/proffalken What do we need? Data Feeds Command and Control Software Data Converter Model Railway Hardware Interface
  • 5. @proffalken | github.com/modelrailwaysascode | github.com/proffalken Network Rail data feeds and the Open Rail Data community ● https://wiki.openraildata.com/ ● Amazing source of information on the various data formats that Network Rail make available via their API’s ● https://datafeeds.networkrail.co.uk/ ← Sign up here to get access to the data! ● Be careful, data comes in multiple formats, and not all formats contain all the data…
  • 6. @proffalken | github.com/modelrailwaysascode | github.com/proffalken STOMPing around in Python
  • 7. @proffalken | github.com/modelrailwaysascode | github.com/proffalken JMRI – The brains of the operation! ● Java-based ● Multiple applications depending on what you want to do ● It uses Jython! ● Jython is really old… ● It supports MQTT! ● MQTT requires yet more “stuff” to be setup ● It has a TCP-based API called WiThrottle for control via mobile devices! ● The WiThrottle API is… unique
  • 8. @proffalken | github.com/modelrailwaysascode | github.com/proffalken WiThrottle – RL2][RGS 41}|{41}|{L][Test Loco}|{1234}|{L ● It uses [ [ and ] ] to differentiate between locomotives ● It uses { { and } } to show the values for settings ● The settings are always in the same order… ● … but never as key=value key=value pairs ● Commands use three characters in a row to delimit: <;> <;> ● All feedback is sent as new lines, but you don’t know when it’s finished sending feedback
  • 9. @proffalken | github.com/modelrailwaysascode | github.com/proffalken WiThrottle – Setting a function M0AS3<;>F110 M0 = Throttle ID A = Send an “action” to a locomotive S = Make sure we’re using DCC “short” mode 3 = The DCC channel we need to target <;> = That weird choice of delimiter F = Set a Function 1 = Either 0 (Off) or 1 (On) 10 = The function to act against (from 00 to 99)
  • 10. @proffalken | github.com/modelrailwaysascode | github.com/proffalken WiThrottle – Moving the loco M0AS3<;>V50 M0 = Throttle ID A = Send an “action” to a locomotive S = Make sure we’re using DCC “short” mode 3 = The DCC channel we need to target <;> = That weird choice of delimiter V = Set the speed (v == Velocity?) 50 = A value between 0 and 126
  • 11. @proffalken | github.com/modelrailwaysascode | github.com/proffalken WiThrottle – Switching Direction M0AS3<;>R0 M0 = Throttle ID A = Send an “action” to a locomotive S = Make sure we’re using DCC “short” mode 3 = The DCC channel we need to target <;> = That weird choice of delimiter R = Set the direction 0 = Either 0 (Reverse) or 1 (Forward)
  • 12. @proffalken | github.com/modelrailwaysascode | github.com/proffalken Let’s make this a bit easier… PyWiThrottle https://github.com/modelrailwaysascode/pywithrottle
  • 13. @proffalken | github.com/modelrailwaysascode | github.com/proffalken Connecting to the track using ● www.merg.org.uk ● Numerous circuit boards to connect to model railways and accessories via all kinds of protocols and methods ● Large online community who are incredibly helpful ● Cheap to join ● Kits are not expensive ● Full computer control of a layout, including block detection and point control for under £90! (Commercial equivalents are well over £250 for a “decent” setup) Photo © MERG
  • 14. @proffalken | github.com/modelrailwaysascode | github.com/proffalken Putting it all together!
  • 15. @proffalken | github.com/modelrailwaysascode | github.com/proffalken The output
  • 16. @proffalken | github.com/modelrailwaysascode | github.com/proffalken What next? ● Build a proper layout rather than the test track – Find a suitable location (St. Ives Branch line?) – Model it – Work out the TIPLOC/STANOX codes for each section – Write the integration based on PyWiThrottle ● Continue to update PyWiThrottle to add more functionality (Contributors welcome!) ● Create more fun distractions timewasters projects under the “Model Railways as Code” banner
  • 17. @proffalken | github.com/modelrailwaysascode | github.com/proffalken Thank you! https://github.com/modelrailwaysascode/ https://twitter.com/proffalken