Placeholder Image

字幕列表 影片播放

  • Being the last one on the last day of the presentation in the Side Track.

  • I'm impressed that there are still people here that are not sleeping.

  • It's professionally what we call this slot the twilight zone.

  • And I know that you guys are tired after two days of conferencing and learning and JavaScripting.

  • So, I hope that this talk is going to be a little fun for you.

  • That said, you know, like I've added a few jokes here and there.

  • But my wife tells me that my dad jokes are absolutely terrible.

  • So, we'll see how that works out for you guys.

  • Nobody laughs.

  • That's a good start.

  • Hi.

  • My name is Pier.

  • You might remember me from such amazing projects such as: The Java servlet API.

  • The Java API for XML.

  • Java 2 SE 1.5.

  • And a lot more Java goodness.

  • I'm sure right now you're actually wondering whether I am at the right conference here.

  • Well, I am.

  • You see, like a few years back when I was living in Tokyo, I met this fine gentleman.

  • His name is Jed Schmidt.

  • We were working together.

  • And he's one of the creators of, for example, Brooklyn Jazz.

  • Quite a famous name over there.

  • And thanks to the beatings of these fine gentlemen I kind of like praise the Lord.

  • I saw the light.

  • I abandoned the dark side.

  • And converted to this wonderful world of Node.js.

  • Let me tell you, life since then has been all ponies and rainbows.

  • But I want to point out one thing.

  • I know that I'm gonna anger some of you here.

  • I am not a, you know, like I'm definitely not into Star Wars.

  • I'm more of a Trekkie myself.

  • But enough about me.

  • Let's get into the nitty gritty details of this talk.

  • So, today we're talking about the almighty toilet paper roll.

  • And now I'm sure that you're really wondering, am I at the right conference?

  • How many of you are familiar with this wonderful object?

  • [ Laughter ] I mean, you know, if not this one, we can

  • get the black one.

  • It's so Berlin.

  • You know?

  • Amazing.

  • For your health, I really hope that you had a good use of this today.

  • You know?

  • But what about JavaScript?

  • And toilet paper?

  • Well, let's take a step back.

  • You see, a couple of years back I took a job at a company called Korber, a big giant in

  • industrial manufacturing in Germany.

  • They are one of the largest manufacturers of industrial machines.

  • Including, amongst a thousand other things, tobacco machines, palletizing equipment, we

  • actually do produce machines that produce toilet paper and kitchen rolls.

  • I am embedded with their digital lab.

  • Korber Digital.

  • And we develop digital applications for our customers, right?

  • More specifically, I am in a team that develops this wonderful app.

  • What we're building is called K Edge.

  • K Edge is an app that has been designed to offer shift support in for the operators of

  • toilet paper machines, right?

  • On KEdge, as you can see there, like, you know, operators of operators of these machines

  • can actually see their production stats like how many logs they have produced, the average

  • speed at which the machine is running, downtimes and whatnot.

  • They can see the telemetry from the machine itself.

  • You can see actually the graph over there.

  • We take that graph, we analyze the speed, we create yellow segments or red segments.

  • Yellow segments are reduced productivity so that when we are below that green line you

  • see over there.

  • And the red segments is when the machine is actually stopped.

  • So, what happens, the operator at that point has the ability to create a digital report

  • of their shift, right?

  • So, KEdge is deployed as on a tablet that goes alongside the traditional HMI.

  • The HMI is that big computer you see there that controls actually the machine itself.

  • And the operators use the tablet to create a digital journal of their shift.

  • And, you know, replace their old paperbased trail of stuff.

  • Right?

  • So, let's look a little bit about how KEdge is built.

  • So, this is a quick outline of our architecture.

  • The frontend is a React app.

  • So, lots of JavaScript.

  • It's deployed statically on Amazon S3, served through Cloud front and a login will be handled

  • by incognito really soon.

  • And backup communication goes through Redux to a bunch of JavaScript microservices which

  • have been deployed as Amazon Lambda functions and therefore accessible via the AWS gateway.

  • Interesting, isn't it?

  • No.

  • It's 2019.

  • Nobody cares about another god damned React app.

  • You know, if we were to talk about this, you might just as well go out to the beach and

  • catch some sun while you can.

  • You know, enjoy the heat and so on and so forth.

  • And so, what's actually interesting about what we do?

  • Well, to figure that out, we have to see how toilet paper is actually produced, right?

  • So, thanks to the National Geographic, this is how a modern toilet paper factory looks

  • on the inside.

  • This has been shot at one of the biggest producers of toilet paper here in the European market.

  • And you can actually hear how loud this place is.

  • Right? [it's loud] Giant factories, just to make toilet paper.

  • But easier on the ears, let's look a little bit at how our production line is actually

  • configured.

  • This is a pretty machine, one of ours.

  • Wonderful piece of equipment that runs at around 50 kilometers an hour.

  • And how is toilet paper produced?

  • We start from the top left with some giant jumble rolls, we call them.

  • Those are three tons of paper.

  • Oneply paper.

  • To put that into perspective, one of those rolls is enough for at least three of you

  • to make toilet paper for the rest of your life kind of thing.

  • So, pretty big.

  • We unwind those ones, right?

  • And we unwind them one, two, or three or four of them depending if we want one, two, three

  • or fourply toilet paper.

  • After the winders over here, we have what is called the embosser.

  • It basically takes the splice of toilet paper, pushes them together and embosses this nice

  • pattern over here.

  • And in the process, it injects air into the paper.

  • So, it makes it thicker, it makes it fluffier, softer, gentler on your rear end, maybe.

  • And after the paper is embossed, basically what happens is that the cardboard core here

  • gets produced by the machine that you see in the middle over there.

  • The cardboard core slides in and we actually start rewinding the embossed paper around

  • the cardboard core in giant logs.

  • It's like this, but it's 3 meters wrong.

  • Those go into the thing that look like a cage, it's an accumulator, buffering the unwinding

  • part at the top from the cutting and packaging at the rear end of the line.

  • You see at the very top over there, we have a log saw, which basically take this is log

  • and cuts it and makes these things.

  • And then quickly, the at the left no, sorry, at the right of your screen we see the packager.

  • That basically, you know, takes four, eight, 12 toilet paper rolls, puts them together,

  • wraps them around.

  • Nice package at the supermarket.

  • And at the bottom, the palletizer.

  • And they are stacked up and put in a pact and, boom, ready for shipping.

  • But now you will be asking, is all of this controlled with JavaScript?

  • No.

  • Production a production line even the modern production lines are controlled by something

  • called a PLC or programmable logic controller.

  • I like to call them legacy hardware from the last century.

  • This is a last generation Siemens S7 1500, top of the line.

  • Great PLC.

  • There is one little problem with these beasts that they are still programmed using a thing

  • called lather logic.

  • This is an example of a program.

  • But, you know, like in the PLCs themselves, we don't have variables.

  • In most of the PLCs we address variables are their location in the memory.

  • We don't know exactly what's stored here and there.

  • This is definitely not for the faint of heart.

  • Programming one of those things makes COBOL look so 2019.

  • You know?

  • And if it's not bad enough, we actually don't work on these beautiful brand new machines

  • most of the time.

  • We use them on the machines that have been in the field for like 10, 15 years.

  • This is normally how we find a PLC.

  • This is Inga.

  • It's a machine that I had to connect in order to extract data from in order for our application

  • to work correctly, right?

  • And it's a jungle of wire.

  • And how do we extract data from this medieval piece of kit?

  • Well, we add more wires.

  • We add, you know, like more wires and an industrial PC in there which we call the gateway.

  • And the gateway connected on one side to the PLC with the beautiful' they are Internet

  • table.

  • And thanks to our friends at Twilio, we have a dedicated connection that pumps the data

  • down to the cloud, right?

  • And this, the gateway, is where we run all this JavaScript goodness that we wrote.

  • But before we get into the JavaScript part, like I wanted to show you a little bit the

  • connectivity scenario.

  • So, on the left we have the little factory which is our PLC while in the middle the chip

  • is our gateway, running node.

  • And bridges kind of like the time gap between, you know, like the between the last century

  • and now.

  • And obviously we have the cloud.

  • So, the data flow here is interesting.

  • Because being stuck in the past, that PLC does not know anything about encryption, security,

  • not even a password, right?

  • If I can read from a PLC, I can write to it, I can reprogram it, I can do whatever I want

  • with it.

  • And the only thing that I need to do that is an IP address which I can connect to.

  • Now, this is very insecure.

  • That has been used many times in the past.

  • Probably the most famous case is when all the centrifuges in Iran for processing uranium

  • were disabled by malicious code by disabling the PLC that spun up the centrifuges and boom,

  • it's gone.

  • But when we push the data through the include, we want everything to be safe.

  • So, we started looking at the physical boundaries of security.

  • And so, we install our gateway into the cabinet where the PLC is.

  • We only have one cable.

  • Nothing gets in, nothing gets out.

  • Nobody contacts the PLC from outside of the cabinet of the PLC itself, right?

  • And outside when we want to reach through the cloud, you know, like we have a nice secure

  • modern Linuxbased like VPN on top of an LTE link and yada, yada, yada, right?

  • So, we actually implement we actually define a security perimeter around the PLC so that

  • we can protect it from attacks.

  • And we do this by installing the gateway with a PLC itself, right?

  • The gateway itself also serves another bunch of purposes.

  • We want to consolidate data.

  • Because as much as our friends at Twilio advertise their 4G, in most cases factories are, you

  • know, they're not very well in terms of reception.

  • Most of the times we get 2G, 40 kilo bytes a second.

  • That's not quite enough to actually have a full stream of data coming out.

  • We actually do a lot of the data consolidation on the gateway itself.

  • That's why we need the processing power of JavaScript to do that.

  • And so, we send only, for example, the data that changes in the PLC.

  • And we also do a lot of caching.

  • So, we do we cache everything that we read on to the device itself because, well, it's

  • 2G.

  • When and, you know, whatever connectivity comes and goes and so on and so forth.

  • In case of connectivity failures, and some hiccup occurs, we can quickly, or as quick

  • as we can, reingest all the data that we've read while that link was down and then continue

  • at normal operation, right?

  • So, we started this thing with a wonderful program by IBM Research that was called Node

  • Read.

  • It's a wonderful tool.

  • It has libraries that allows us to connect to the PLC.

  • And you see here a very easy configuration, every 10 seconds we have the speed, and we

  • have the first alarm.

  • Shift it down to the right.

  • Send it over to Amazon, right?

  • This is great.

  • Nice going.

  • Can do things very quickly.

  • It's all based in JavaScript, and it's amazing, but gets really complicated when we start

  • reading like a bunch of variables.

  • This is actually a real configuration file we had in production when we started reading

  • more valuables to the thing.

  • And it really gets a mess.

  • It becomes like a bunch of wires.

  • You never know who is changing what.

  • We cannot manage these files and so on and so forth.

  • So, a year ago roughly it dawned on me, you know what?

  • We have the technology.

  • We're going to rebuild it.

  • And we came up with a thing that is called the PLC reader.

  • PLC reader is a wonderful little Node.js application that we wrote in order to clean up the mess

  • that was Node Read.

  • JavaScript, why?

  • Because it was built in Node.

  • Continue with Node because we had the reliability over there.

  • But we managed to bring some automation into the world of point and click, right?

  • It does a very simple job.

  • It reads values from various sources, which we call drivers.

  • And processes in various ways through a pipeline of what we call processers.

  • Right?

  • On top of that, it's easily deployed as a Debian package.

  • We bought a tool, Debianize.

  • It's not point and click, but it's YAML files.