SlideShare uma empresa Scribd logo
1 de 29
RASPBERRY PI CAR
BOGDAN CRACIUN
SIVECO ROMANIA
Build, Code, Deploy and Run
Agenda
 Introduction
 Requirements
 Hardware platform
 Software platform & Application code
 Q&A
 Running Mode Demo
About me
 Software Architect @ SIVECO Romania from 2003
 Oracle Certified Master, Java EE Enterprise Architect
 Founding member of Oracle Architects Club – Romania chapter
Requirements
 Wireless control - no wires
 Wi-Fi based
 Smartphone and Car only setup
 No external Wi-Fi access point needed
 No additional administration system
 Automatic startup of services on power on
 Queue base control
 Automatic impact detection and reaction
 Front lights control
 Status lights for Impact Mode and Commands
Main actor
Secondary roles
Prop
Victim
Result
v1 v2
Running environment
Development environment
Operating system setup
 Operating system
 Rasbian “Wheezy” – Debian based Raspberry Pi distribution
 Access point
 Hostapd
 EW-7811Un with custom drivers to support AP mode
 DNS & DHCP
 Dnsmasq
 Remove serial console support from standard Raspbian distribution
Service integration
 Java Application
 Java Service Wrapper
 Node Application
 Nodejitsu Forever
 Linux native program
 Scripting
JeeNode integration
 Using serial communication
 RXTX Java library with native support
Car engine
 Java SE Application
 Spring Framework
 IoC container
 Spring Integration
 Redis Channel Adapter
 Custom Serial Channel Adapter
 Using RXTX Serial library
Control component - Client
 Client
 JQuery Mobile
 User interface and
interactions
 Socket.io
 Client <> Server
communication
 Virtualjoystick.js
 Dual virtual joystick
support
Control component - Server
 Server
 Node.js Server
 Server components (request
handlers and queue
management)
 Redis Server
 Node <> Java integration
using Redis Pub/Sub
 Queue persistence using
Redis sorted sets
Image streaming
 mjpg-streamer
 With Raspberry Pi Camera support – 11 fps @ 640x480
Software challenges
 No AP mode support in EW-7811Un
 Action: Custom hostapd compatible RTL8188CUS was installed
 Reading HC-SR04 sensor data using Java
 Works fine if it is the only process on Raspberry Pi
 Bad choice to use the sensor with a non real-time SO
 Action: Added a Jeenode (Arduino Uno clone) to run the reading
loop and push data to a serial Raspberry Pi port
Software challenges – cont.
 Compiling the following on Raspberry Pi:
 redis server
 node.js
 RXTX native library
 mjpg-streamer – custom module to support image streaming
 Image streaming speed optimization
Hardware challenges
 Differences between Raspberry Pi and HC-SR04
Ultrasonic Sensor - 3.3v vs 5v
 Action: Used a basic voltage divider between the
Echo port and the GPIO pin of the Raspberry Pi
 Reuse the dual H-bridge from the toy car PCB
(Printed Circuit Board) or integrate the L298N board
 v1 reuse car PCB
 v2 is connected to motors using L298N board
High level Architecture
Detailed Diagram
Detailed Diagram
Lessons learned
 Automate as much as possible
 Build automation
 Test automation
 Use mocks for development and testing
 Development without the real car
 Design a component based system for easy refactoring
 Switch between implementations easy
 Prototype before develop
 It is harder to change something already developed and fully
integrated
 Switch log levels to error/fatal/off
 Use versioning and release management for code and hardware
designs
 Don’t use / break children toys !
Final thoughts
 Be a problem solver, not just a programmer.
 Use the best tool for the job
 Does the language really matter?
 Keep your mind open.
Testing Team
Next projects
 Raspberry Pi assisted
quad-copter
 Raspberry Pi controlled
Tank
Q&A
 Demo car connection data:
 SID: orange
 Password: 12345678

Mais conteúdo relacionado

Semelhante a Raspberry Pi Car with Java

eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
Labview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLLabview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLMohammad Sabouri
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Intel® Software
 
API Virtualization: Mocking on Steroids
API Virtualization: Mocking on SteroidsAPI Virtualization: Mocking on Steroids
API Virtualization: Mocking on SteroidsSmartBear
 
Snug2007 Presentation
Snug2007 PresentationSnug2007 Presentation
Snug2007 Presentationclkalyan
 
Surekha_haoop_exp
Surekha_haoop_expSurekha_haoop_exp
Surekha_haoop_expsurekhakadi
 
REMOTE TRIGGERED SOFTWARE DEFINED RADIO
REMOTE TRIGGERED SOFTWARE DEFINED RADIOREMOTE TRIGGERED SOFTWARE DEFINED RADIO
REMOTE TRIGGERED SOFTWARE DEFINED RADIOKunal Bidkar
 
Azure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNETAzure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNETLorenzo Barbieri
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...mfrancis
 
Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors Qualcomm Developer Network
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...Mark West
 
Virtual Platforms
Virtual PlatformsVirtual Platforms
Virtual Platformsclkalyan
 
Real Time Network Monitoring System
Real  Time  Network  Monitoring  SystemReal  Time  Network  Monitoring  System
Real Time Network Monitoring SystemGirish Naik
 
How to double .net code value
How to double .net code valueHow to double .net code value
How to double .net code valuejavOnet
 

Semelhante a Raspberry Pi Car with Java (20)

_SOMANATH_
_SOMANATH__SOMANATH_
_SOMANATH_
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Labview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLLabview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRL
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
 
API Virtualization: Mocking on Steroids
API Virtualization: Mocking on SteroidsAPI Virtualization: Mocking on Steroids
API Virtualization: Mocking on Steroids
 
Snug2007 Presentation
Snug2007 PresentationSnug2007 Presentation
Snug2007 Presentation
 
Surekha_haoop_exp
Surekha_haoop_expSurekha_haoop_exp
Surekha_haoop_exp
 
Provisioning the IoT
Provisioning the IoTProvisioning the IoT
Provisioning the IoT
 
REMOTE TRIGGERED SOFTWARE DEFINED RADIO
REMOTE TRIGGERED SOFTWARE DEFINED RADIOREMOTE TRIGGERED SOFTWARE DEFINED RADIO
REMOTE TRIGGERED SOFTWARE DEFINED RADIO
 
Azure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNETAzure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNET
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
 
Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors Android Tools for Qualcomm Snapdragon Processors
Android Tools for Qualcomm Snapdragon Processors
 
Aleksandar_Popadic_CV
Aleksandar_Popadic_CVAleksandar_Popadic_CV
Aleksandar_Popadic_CV
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
 
Virtual Platforms
Virtual PlatformsVirtual Platforms
Virtual Platforms
 
Real Time Network Monitoring System
Real  Time  Network  Monitoring  SystemReal  Time  Network  Monitoring  System
Real Time Network Monitoring System
 
Resume
ResumeResume
Resume
 
Prabhat Ravi Resume
Prabhat Ravi ResumePrabhat Ravi Resume
Prabhat Ravi Resume
 
How to double .net code value
How to double .net code valueHow to double .net code value
How to double .net code value
 

Último

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Último (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Raspberry Pi Car with Java

  • 1. RASPBERRY PI CAR BOGDAN CRACIUN SIVECO ROMANIA Build, Code, Deploy and Run
  • 2. Agenda  Introduction  Requirements  Hardware platform  Software platform & Application code  Q&A  Running Mode Demo
  • 3. About me  Software Architect @ SIVECO Romania from 2003  Oracle Certified Master, Java EE Enterprise Architect  Founding member of Oracle Architects Club – Romania chapter
  • 4. Requirements  Wireless control - no wires  Wi-Fi based  Smartphone and Car only setup  No external Wi-Fi access point needed  No additional administration system  Automatic startup of services on power on  Queue base control  Automatic impact detection and reaction  Front lights control  Status lights for Impact Mode and Commands
  • 12. Operating system setup  Operating system  Rasbian “Wheezy” – Debian based Raspberry Pi distribution  Access point  Hostapd  EW-7811Un with custom drivers to support AP mode  DNS & DHCP  Dnsmasq  Remove serial console support from standard Raspbian distribution
  • 13. Service integration  Java Application  Java Service Wrapper  Node Application  Nodejitsu Forever  Linux native program  Scripting
  • 14. JeeNode integration  Using serial communication  RXTX Java library with native support
  • 15. Car engine  Java SE Application  Spring Framework  IoC container  Spring Integration  Redis Channel Adapter  Custom Serial Channel Adapter  Using RXTX Serial library
  • 16. Control component - Client  Client  JQuery Mobile  User interface and interactions  Socket.io  Client <> Server communication  Virtualjoystick.js  Dual virtual joystick support
  • 17. Control component - Server  Server  Node.js Server  Server components (request handlers and queue management)  Redis Server  Node <> Java integration using Redis Pub/Sub  Queue persistence using Redis sorted sets
  • 18. Image streaming  mjpg-streamer  With Raspberry Pi Camera support – 11 fps @ 640x480
  • 19. Software challenges  No AP mode support in EW-7811Un  Action: Custom hostapd compatible RTL8188CUS was installed  Reading HC-SR04 sensor data using Java  Works fine if it is the only process on Raspberry Pi  Bad choice to use the sensor with a non real-time SO  Action: Added a Jeenode (Arduino Uno clone) to run the reading loop and push data to a serial Raspberry Pi port
  • 20. Software challenges – cont.  Compiling the following on Raspberry Pi:  redis server  node.js  RXTX native library  mjpg-streamer – custom module to support image streaming  Image streaming speed optimization
  • 21. Hardware challenges  Differences between Raspberry Pi and HC-SR04 Ultrasonic Sensor - 3.3v vs 5v  Action: Used a basic voltage divider between the Echo port and the GPIO pin of the Raspberry Pi  Reuse the dual H-bridge from the toy car PCB (Printed Circuit Board) or integrate the L298N board  v1 reuse car PCB  v2 is connected to motors using L298N board
  • 25. Lessons learned  Automate as much as possible  Build automation  Test automation  Use mocks for development and testing  Development without the real car  Design a component based system for easy refactoring  Switch between implementations easy  Prototype before develop  It is harder to change something already developed and fully integrated  Switch log levels to error/fatal/off  Use versioning and release management for code and hardware designs  Don’t use / break children toys !
  • 26. Final thoughts  Be a problem solver, not just a programmer.  Use the best tool for the job  Does the language really matter?  Keep your mind open.
  • 28. Next projects  Raspberry Pi assisted quad-copter  Raspberry Pi controlled Tank
  • 29. Q&A  Demo car connection data:  SID: orange  Password: 12345678