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
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
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.