Pimping up Industry Devices with Rasperry Pi, Vert.x und ... · PDF fileba sel bern brugg...

Preview:

Citation preview

BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA

HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH

Pimping up Industry Devices with

Rasperry Pi, Vert.x und Java 8

@atsticks

Anatole Tresch – Principal Consultant

Anatole Tresch

Open Source Enthusiast

Apache PPMC Member

Consultant, Trainer, Software Architect for Java and Container Technologies

Oracle Star Spec Lead

More than 25 years of software development experience

Contact: anatole.tresch@trivadis.com

Blog: http://maketechsimple.wordpress.com

Slideshare: http://www.slideshare.net/anatoletresch

Twitter: atsticks

Agenda

3

1. Once upon a time…

2. The Requirements

3. Insights

Connection Endpoints

The Protocol Data

Event Handling

Pandora’s Box

4. Business Value and Future

Houston, we

have a

problem…

How it all started…

• A phone call

• A kick-off meeting

• Agile Setup

• An offer

• A prototype

• A successful demo

• …

What ?

Give me some

context…

The Machines

http://www.belimed.com

The Management System

• Windows Application

• Can be connected to multiple machines

• Used for

• Monitoring

• Auditing & History

• Machine Configuration

Deployment View

Network Issues

- Failures

- Process failures

- Outages

- IP Config Lost or invalid

- IP Setup Changes- Software Updates

- Outages

Cabling, Connector

Issues

10

What the Customer wanted

(aka Requirements)

The Requirements for the Retrofit-Box (RFBox)

• Ensure Audit can be done in case of

• Network Failures

• Printer Failures

• The Box hereby

• should be transparent to the management system

• can be attached to different machines and interfaces

• runs with no outages

• is transparent to the machine

Solution

The system context

14

Insights

Connection Endpoints

Serial Communication RS485

• STX (Start of TXT)

• RS 485: 0x02 in payload need tobe masked by 0x00

• IP: no 0x02 masking

• 5 <= LEN <= 255

• 3 <= CMD <= 255

• 0 <= DATA <= 250

• CHK:• CHK = 0x00

• Repeat for all bytes:• CHK << 1

• CHK += Carry

• For IP: always 0x00

The Binary Protocol - Structure

The Binary Protocol - Datatypes

The Binary Protocol – Example (Status Response)

Detailed Example: Status Request

Machine Response - Examples

STXLENNODECMDPAYLOADCHK

Silence:

02380470000000010000000000000020002000200020002000200020002000200020002000200020002000200020

00200020002000200076

STXLENNODECMDPAYLOADCHK

Process start:02800472050000011e00000001000049004300530020005400650073007400200020002000200020002000200020002000200

02000200020002000200020002000200020002000200020002000200020002000200020002000200020002000330031002e00

310032002e003200300031003500560034002e0030003000200010

Process data (1/second, cycle duration: 10-40 minutes)022e040f01000001000000000000011e0000000100000b00007d010000000000000000000000004f000000000083

022e040f01000001000000000000001e0000000100000b00007b010000000000000000000000004f000000000033

022e040f01000001000000000000001e0000000100000b00007a010000000000000000000000004f00000000002b

022e040f01000001000000000000001e0000000100000b000078010000000000000000000000004f00000000001b

022e040f01000001000000000000001e0000000100000b000077010000000000000000000000004e0000000000f2

022e040f01000001000000000000001e0000000100000b000076010000000000000000000000004e0000000000ea

022e040f01000001000000000000001e0000000100000b000074010000000000000000000000004e0000000000da

022e040f01000001000000000000001e0000000100000b000073010000000000000000000000004e0000000000d2

022e040f01000001000000000000001e0000000100000b000072010000000000000000000000004e0000000000ca

022e040f01000001000000000000001e0000000100000b000071010000000000000000000000004e0000000000c2

022e040f01000001000000000000001e0000000100000b00006f010000000000000000000000004d000000000092

022e040f01000001000000000000001e0000000100000b00006e010000000000000000000000004d00000000008a

022e040f01000001000000000000001e0000000100000b00006d010000000000000000000000004d000000000082

Process end:02190410400000011e0000000000000072010000000000005

RFBox Event Handling

22

All Communications are handled

also internally asynchronousl via

the Vertx event bus.

23

Opening the

Pandora’s Box…

RFBox Internal Components

24

RFBox Internal Components – Level 1

25

Mini UPS, LEDs, Boxing

• Protection

• Coverage from Humidity and Heat

• Simple User Interface

(Controllable LED Button)

• Unit of Shipment

• Connectivity to Power, RS 485

Buses, IP, Printer

RFBox Control Scripts

• LED Blinking

• Voltage Monitoring, Controlled Shutdown, Prevent Startup

• Button Action Handling

• Respawning of failed processes

RFBox Symbian Linux

• Read-Only System FS

• Automatic Application Process Startup

• SSH Server

• TCP/IP Stack

RFBox Configurator

• Authentication

• Configuration file import

• 18n file import

• RFBOX main process jar updates and restarts

• Based on

• Java 8

• Will probably be replaced with rpm packaging/apt

RFBox Main Application

• Main RFBOX application

• Based on

• Java 8

• Vertx.io

RFBox Application Components

Business Value & Future

Imagine…

We have an installation base of thousands of

machines world wide…

Customers expect very fast reaction times…

Customers expect quality services…

So if you would know always…

…when machines failed,

…when machines show deviations

(=they will make troubles in the future),

…how much the machines have been used

and

…whatever else the collected data may

show…

…that would be nice, wouldn’t it?

BUT…

…the best thing is…

…you know it before your customer does!

The IOT Gateway Project

Global

IOT

Gateway

Summary

Summary

• All Started with a small fast prototype

• Building Industry Devices is hard and interdisciplinary

• Building Medical Devices is even harder

• Low Level programming with Java is fun

• If you have to deal with asynchronous events use a good library from scratch

• Vertx and Java 8 are awesome

@atsticks maketechsimple.wordpress.com

anatole.tresch@trivadis.com

Anatole Tresch

Principal Consultant

Recommended