The Internet of (Lego)Trains
Johan Janssen, Info Support
@johanjanssen42
johan.janssen@infosupport.com
Ingmar van der Steen, Info Support
ingmar.van.der.steen@infosupport.com
Disclaimer:
No Lego was harmed beyond
repair during the project.
CONTENT
Why?
Ingredients
Architecture
Hardware
Application
Challenges
Scala and Akka
Future
Conclusion
Questions
Why?
MINIMAL INGREDIENTS FOR 1TRAIN
ABOUT € 50
Raspberry Pi A+
Wifi dongle
EDUP Ultra-Mini Nano USB 2.0 802.11n
USB battery pack
Anker® 2. Gen Astro Mini 3200mAh
Infrared transmitter
Keyes 38KHz IR InfraredTransmitter Module for
Arduino
Javantura v3 - The Internet of (Lego) Trains – Johan Janssen, Ingmar van der Steen
Architecture
LTCC
(Angular)
LTCC
(Java)
DeviceControl
(Java)
Infrared
(C and LIRC)
RFID
(C)
SwitchControl
(Java)
Servo
(Python)
Leds with Photon
(C)
RPi-Cam-Web-
Interface
(C)
LTCC (Laptop)SwitchControl (Pi) Camera (Pi)
Device
Control
(Pi)
Original
controls
Infrared
CALLINGTHE APPLICATION
 http://ipaddress/cgi-bin/test/?ch=0&out=1&cmd=1&spd=3
 ch: channel (there are 8)
 out: output
 cmd: command
 0 Break
 1 Forward
 2 Backward
 spd: speed (not necesarry with command ‘Break’)
@Path("train")
public class TrainService {
@GET
@Path("{channelParam}/forward/{speedParam}")
public void forward(@PathParam("channelParam") String channel,
@PathParam("speedParam") String speed) {
String command = "1";
callURL(channel, command, speed);
}
private void callURL(String channel, String command, String speed) {
StringBuilder result = new StringBuilder();
result.append("http://127.0.0.1/cgi-bin/test/?ch=");
result.append(channel);
result.append("&out=1&cmd=");
result.append(command);
if (speed != null) {
result.append("&spd=");
result.append(speed);
}
URL url = new URL(result.toString());
InputStream is = url.openStream();
}
}
Sound
RFID
3.3V, GPIO25, GND, -, GPIO9, GPIO 10, GPIO11, GPIO 8
Javantura v3 - The Internet of (Lego) Trains – Johan Janssen, Ingmar van der Steen
Camera
Javantura v3 - The Internet of (Lego) Trains – Johan Janssen, Ingmar van der Steen
Overview
camera
Switches
Javantura v3 - The Internet of (Lego) Trains – Johan Janssen, Ingmar van der Steen
LTCC APPLICATION
AUTOPILOT APPLICATION
Challenges
SCALA AND AKKA
HTTP VS REMOTE ACTOR
ADVANTAGES REMOTE ACTORS
 No converting to JSON/SOAP
 More natural programming
 Faster than Akka HTTP ?
ADVANTAGES HTTP
 Indepedent of technology
 Loosely coupled
LTCC
(Angular)
LTCC
(Scala/Akka)
DeviceControl
(Scala/Akka)
Infrared
(C and LIRC)
RFID
(C)
SwitchControl
(Scala/Akka)
Servo
(Python)
Leds with Photon
(C)
RPi-Cam-Web-
Interface
(C)
class Coordinator extends Actor {
def receive = {
case mymessage =>
println(mymessage)
}
}
implicit val system = ActorSystem("ExampleActorSystem")
val coordinatorActorRef = system.actorOf(Props[Coordinator])
coordinatorActorRef ! "Hello Javantura"
val coordinatorActorRef =
system.actorOf(Props[Coordinator])
coordinatorActorRef ! "Hello Javantura "
val coordinatorActorRef =
context.actorSelection("akka.tcp://
ExampleActorSystem@127.0.0.1:9005
/user/coordinatorActor")
coordinatorActorRef ! "Hello Javantura "
akka {
actor {
provider =
"akka.remote.RemoteActorRefProvider"
}
remote {
enabled-transports =
["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 9002
Javantura v3 - The Internet of (Lego) Trains – Johan Janssen, Ingmar van der Steen
CONCLUSION
The best part!!
QUESTIONS?
Johan Janssen, Info Support
@johanjanssen42
johan.janssen@infosupport.com
Ingmar van der Steen, Info Support
ingmar.van.der.steen@infosupport.com

More Related Content

PDF
Introduction to AIoT & TinyML - with Arduino
PDF
A prototyping hardware for the real Internet of Things
PDF
IT Solution through IoT Development
PDF
Internet of Things - Technicals
PPTX
Arduino1.0 RC
PPT
Physical Computing with the Arduino platform and Ruby
PDF
Boards for the IoT-Prototyping
PDF
FIRSTFare 2013 overview of electronics-2014
Introduction to AIoT & TinyML - with Arduino
A prototyping hardware for the real Internet of Things
IT Solution through IoT Development
Internet of Things - Technicals
Arduino1.0 RC
Physical Computing with the Arduino platform and Ruby
Boards for the IoT-Prototyping
FIRSTFare 2013 overview of electronics-2014

What's hot (20)

PPTX
Anam rajkumar sarvesh k10779,k10626
PPTX
Anam rajkumar sarvesh
PDF
Esp32 cam arduino-123
PDF
Sunspot
PPTX
Smart oven 智慧烤箱
PPTX
Arduino Uno Board - Robomart
PPTX
Particle Core
PDF
PyCon_India_2017_MicroPython_Ayan
ODP
Sun SPOT, Wireless Sensors Networks
PPTX
Netloab toolkit 1112
PPTX
Brain controlled robot
PPTX
Nio100 product guide 20150520
PDF
Webinar embarcados - Simplificando seus projetos de Internet das coisas com o...
PPTX
Make Your Home Smarter
PDF
Track 1 session 4 - st dev con 2016 - mems piezo actuators
PDF
Introducing the Sun SPOTs
PDF
Microcontrollers (Rex St. John)
PPTX
Arduino i rremote 1112
DOC
OV7670 Camera interfacing-with-arduino-microcontroller
PPT
Anam rajkumar sarvesh k10779,k10626
Anam rajkumar sarvesh
Esp32 cam arduino-123
Sunspot
Smart oven 智慧烤箱
Arduino Uno Board - Robomart
Particle Core
PyCon_India_2017_MicroPython_Ayan
Sun SPOT, Wireless Sensors Networks
Netloab toolkit 1112
Brain controlled robot
Nio100 product guide 20150520
Webinar embarcados - Simplificando seus projetos de Internet das coisas com o...
Make Your Home Smarter
Track 1 session 4 - st dev con 2016 - mems piezo actuators
Introducing the Sun SPOTs
Microcontrollers (Rex St. John)
Arduino i rremote 1112
OV7670 Camera interfacing-with-arduino-microcontroller
Ad

Viewers also liked (20)

ODP
Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...
PPTX
Javantura v3 - Just say it – using language to communicate with the computer ...
PPTX
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
PPTX
Javantura v3 - Spring Boot under the hood– Nicolas Fränkel
PDF
Javantura v4 - Security architecture of the Java platform - Martin Toshev
PDF
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
PDF
Javantura v4 - DMN – supplement your BPMN - Željko Šmaguc
PDF
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
PDF
Javantura v4 - JVM++ The GraalVM - Martin Toshev
PDF
Javantura v4 - Let me tell you a story why Scrum is not for you - Roko Roić
PDF
Javantura v4 - The power of cloud in professional services company - Ivan Krn...
PDF
Javantura v4 - Test-driven documentation with Spring REST Docs - Danijel Mitar
PDF
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
PDF
Javantura v4 - What’s NOT new in modular Java - Milen Dyankov
PDF
Javantura v4 - Java and lambdas and streams - are they better than for loops ...
PDF
Javantura v4 - (Spring)Boot your application on Red Hat middleware stack - Al...
PDF
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
PDF
Javantura v4 - Android App Development in 2017 - Matej Vidaković
PDF
Javantura v4 - Keycloak – instant login for your app - Marko Štrukelj
PDF
Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...
Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...
Javantura v3 - Just say it – using language to communicate with the computer ...
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - Spring Boot under the hood– Nicolas Fränkel
Javantura v4 - Security architecture of the Java platform - Martin Toshev
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
Javantura v4 - DMN – supplement your BPMN - Željko Šmaguc
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
Javantura v4 - JVM++ The GraalVM - Martin Toshev
Javantura v4 - Let me tell you a story why Scrum is not for you - Roko Roić
Javantura v4 - The power of cloud in professional services company - Ivan Krn...
Javantura v4 - Test-driven documentation with Spring REST Docs - Danijel Mitar
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - What’s NOT new in modular Java - Milen Dyankov
Javantura v4 - Java and lambdas and streams - are they better than for loops ...
Javantura v4 - (Spring)Boot your application on Red Hat middleware stack - Al...
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
Javantura v4 - Android App Development in 2017 - Matej Vidaković
Javantura v4 - Keycloak – instant login for your app - Marko Štrukelj
Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...
Ad

Similar to Javantura v3 - The Internet of (Lego) Trains – Johan Janssen, Ingmar van der Steen (11)

PDF
The internet of (lego) trains
PDF
How to build an effective IoT demo with OSGi - Derek Baum & Walt Bowers
PDF
LEGO IR Controller
PPTX
EuregJUG: Using actors for the internet of (lego) trains
PPTX
Internet of things the salesforce lego machine cloud
PPTX
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
PPTX
JavaOne: Using NetBeans RCP to control your Lego [con1702]
PPTX
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
PDF
Internet of Things
PPTX
Parallel Rendering of Webpages
PPTX
Building the Internet of Things with Thingsquare and Contiki - day 1, part 2
The internet of (lego) trains
How to build an effective IoT demo with OSGi - Derek Baum & Walt Bowers
LEGO IR Controller
EuregJUG: Using actors for the internet of (lego) trains
Internet of things the salesforce lego machine cloud
JavaOne: Using actors for the iInternet of (Lego) Trains [con1709]
JavaOne: Using NetBeans RCP to control your Lego [con1702]
Rest no more - Using actors for the internet of (Lego) trains & Raspberry Pi's
Internet of Things
Parallel Rendering of Webpages
Building the Internet of Things with Thingsquare and Contiki - day 1, part 2

More from HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association (20)

PDF
Java cro'21 the best tools for java developers in 2021 - hujak
PDF
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
PDF
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
PPTX
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
PPTX
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
PDF
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
PDF
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
PDF
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
PPTX
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
PDF
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
PDF
Javantura v6 - When remote work really works - the secrets behind successful ...
PDF
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
PDF
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
PDF
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
PPTX
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
PDF
Javantura v6 - How can you improve the quality of your application - Ioannis ...
PDF
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
PDF
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
PDF
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
PDF
Javantura v6 - JDK 11 & JDK 12 - Dalibor Topic
Java cro'21 the best tools for java developers in 2021 - hujak
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
Javantura v6 - When remote work really works - the secrets behind successful ...
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
Javantura v6 - How can you improve the quality of your application - Ioannis ...
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
Javantura v6 - JDK 11 & JDK 12 - Dalibor Topic

Recently uploaded (20)

PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PDF
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
SaaS reusability assessment using machine learning techniques
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PPTX
Microsoft User Copilot Training Slide Deck
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
SGT Report The Beast Plan and Cyberphysical Systems of Control
SaaS reusability assessment using machine learning techniques
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
Lung cancer patients survival prediction using outlier detection and optimize...
EIS-Webinar-Regulated-Industries-2025-08.pdf
LMS bot: enhanced learning management systems for improved student learning e...
Rapid Prototyping: A lecture on prototyping techniques for interface design
Advancing precision in air quality forecasting through machine learning integ...
Early detection and classification of bone marrow changes in lumbar vertebrae...
Microsoft User Copilot Training Slide Deck
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
MuleSoft-Compete-Deck for midddleware integrations
giants, standing on the shoulders of - by Daniel Stenberg
A symptom-driven medical diagnosis support model based on machine learning te...

Javantura v3 - The Internet of (Lego) Trains – Johan Janssen, Ingmar van der Steen

Editor's Notes

  • #5: - Ervaring opdoen met IoT - Kijken of de software die we dagelijks gebruiken geschikt is voor IoT - Kinderen leren programmeren/interesseren - Zichtbaar/tastbaar, makkelijk om concepten uit te leggen Een excuus hebben voor mijn vrouw om met Lego te mogen spelen HR and recruitment love it as a tool to draw in new developers!
  • #7: You can also make it a bit bigger with camera, RFID, speaker
  • #25: We burned some, Magic smoke was lost Raspberry and transmitter … Usually Pi’s are tough and simple, but also small… Raspberry burned out through poweradapter for switch servos. (whoops) Infrared transmitters where harmed in this project.
  • #26: Trying new tech. We try Akka! Popular with customers. Try out project. Akka in shorts: Actor based, message based system for scalable distributed apps. … We introduced actors to our trains… Akka apparently is a mountain range. Popular in Sweden? As akka in Sweden right. So we started using akka in some customer projects and said: Lets try akkafy the trains!
  • #30: Java and REST -> Scala and remote actors Can be faster, But, also more coupling … Lets show some akka… We switched from REST services to AKKA actor based system. More tightly coupled than just REST - Can be faster (mostly, ask us about the details!)
  • #31: These are akka basics Extend Actor, implement receive. Use caseclasses for different messages. Actors call eachother with messages This is for creating a local actor. Akka is easy to convert to distributed. …Remote actors are almost as simple… Above is code for a supersimple actor that will print any message it gets.
  • #32: Top same as previous Changes to make when using remote actors. Not exactly the same, one is creating an actor, the lower one is calling a pre-existing remote actor. This is not the talk for advanced akka stuff, but this illustrates how simple it is to use remote actors in akka.
  • #33: Configuration needed for remote actors with akka. Application.conf Use 0 for random port, and good luck with finding it . Enough about akka. … So of course we have tons of ideas and stuff we want to add…
  • #34: Charging with induction Collision detection by graduation student Raspberry Pi zero only for the white train as the blue train uses the Raspberry Pi camera and the zero has no connection for that camera Reactive Pi to control the Raspberry Pi directly from Scala/Akka instead of using C/Python
  • #35: Sum up Play with lego;s like kids Show and tells for grownups Testdrive akka, experience Come to Jfokus in beaty stockholm … That’s not even the best part. The best part is … Ervaring opgedaan met hardware/IoT Java en Scala/Akka werken blijkbaar prima - Marketing stands op conferenties Scala/Akka ervaring REST vs Remote Actors Ons hier gebracht
  • #36: The best part: You get to play with lego’s that bring you beer. … If there is time questions…