Hi it’s Mike in this video we’re going to take a look at a sort of simulated telemetry scenario what we’re going to use minecraft to be able to publish events 20 vent up and then we’re going to do some interest and stuff with that afterwards so to begin with I’m going to Head over to my library building and see this is the library and one thing to notice here is in the scenario we’re going to try and pass information about people going in and out of buildings in a sort of Internet of Things style telemetry scenario and that information About people going in and out of buildings is going to be sent up to the cloud we’re going to use 0 event hopes to kind of process that stream of information and then we’re going to look at a business intelligence solution to be able to do something useful with that So let’s have a quick look at this so the first thing is if you notice in the library if we walk up to the door there’s this little panel on the dole now with using minecraft we’re obviously limited in to a degree in some of what We can do and well I mean maybe that’s not a fair statement we can do a lot of stuff I guess the easiest way to simulate a sort of building device is by using this floor panel so when I walk over this planet you can see that this Little thing here called a redstone signal lights up what that does is it sends a signal to this computer and if I click on the computer you can see there’s a as a program here that runs and that’s just telling me that the red stones turned off at the moment and when That computer comes online there’s a startup program which runs that listens for those redstone signals coming in and then sends a message out to the event of every time it happens so see if we walk back out the building as one of the redstone signal gone up and also we’ve Wired up the same technique in the cake shop here let’s see if we look at this nice little big has got a puddle on the floor and if we go in you can see the computer gets a signal to do something so let’s um let’s head back to the Library now and we’ll have a little bit of a look at what happens when that when that computer gets its message so so if I pull in my text file here so in computer craft which is the mod that we use a minecraft to get these computer terminals you basically write computer Programs in lao for these computers i can edit these a notepad by just opening the programs from the file systems this contains the startup program and I’ve got my my little sort of external AP is that our pull in here so I’ve got some Jason functions and some custom Functions that I’ve written in the startup program we kick off with a loop that clears the console and then it listens for redstone signals coming in and then if we get a redstone signal you can see here I’ve got a the URL for my service bus event hub so here’s my Service bus namespace and he is my event hablame I’ve also got a shared access secret that I populate as an HTTP authorization head up when I send my message I’m going to create a simple scrap of Jason that just tells me the building event does the library and then We encode that Jason and we do an HTTP post up to the event tube and then if that’s successful we just come out and wait for the next read Psalm stigma so you can see that the code to be able to do this is really straightforward next We’ve got our Azir service bus namespace so I think the one we were using was the events one so here’s our namespace here and if you go into the event of section and you’ll see we’ve got our building telemetry event hope and just very vanilla setup you can see we’ve got some Messages came in we’ve got just the default consumer groups there’s nothing you know particularly different than a very standard event of scenario here but where it gets interesting when we start looking at how we process those messages so for this I’ve got a stream analytics job set up called Building telemetry and if we have a look at what this does so to begin with we’ve got our input and we receive a data stream from the isère event hub and then going here you can see we you know we’re just using the basic setup for that We’re expect an adjacent message and you know very very simple setup from the stream analytics job here you know it’s very it’s one of the kind of out-of-the-box features to be able to receive from an event hub next we’ve got our query and our query against straightforward query while we’re doing The select star in the minecraft buildings output which is the output i want to show on a second and we select it from minecraft buildings which was the input data source so that job really just lets us push everything through to that output at this stage we’re not Going to aggregate anything or any particularly fancy stuff in stream analytics the the output so I’ve decided that for this case I want to output power bi and that will let me have a nice rich business intelligence dashboard so here I’ve configured a dataset called minecraft buildings table Name called buildings and then I’ve connected it to my to my own power bi setup so basically the stream analytics job gets data off the event hub pushes it through into power bi that’s everything in his ear now so we haven’t written a line of code there we’ve just Configured an event hub and we’ve configured a stream next if we go over to power bi so when we run our job will see this minecraft buildings table or start to appear and the Jason that I’m flowing through the stream Alex jobs is pretty straightforward so that we the Only thing we’ve really got of interest is this this building field here and using this this table of data that’s going to fill it back and create some reports so one of the reports of creative he is just account how many events has been and I’ve got Others like sort of an accelerator speed dial type thing and here I’ve got report which includes kind of how many events have there been by type of building so you can see here there’s been some from the cake shop and some from the library And what i can do is i can choose to add those reports to a dashboard so I’ve created my minecraft building telemetry dashboard here where excuse me waiting see I’ve got a couple of reports I’ve got my simple dashboard there with how many events there’s been an ulcer my my By type building rapport so next if we go back to minecraft now and we start having to look at what happens on the power bi reports because the reports themselves are going to be near real time based on when the stream analytics job runs so if I go through the door There we should see that within a second or so that job should have wrote an all update the update those reporting see the building is just changed 98 and if I go back and forward a few times we’ll start seeing that jump in there 99 and Let’s go over to the cake shop and just show that the other reports updating and near real-time as well so you can see that the cake shop bar starting to move up slightly so hopefully that video demonstrates that with you know just a very small amount of code we’ve been able to stream Telemetry events up to isere and using a zero features that we can easily power them push those events through with the power bi to create at the start of a rich reporting solution now what I think’s quite cool about this is you know the underlying infrastructure there It is ear and power bi is actually something that would scale to an enormous amount of load and we could actually use that for building pretty much a you know production system which will be not a million miles away from what I’ve demonstrated in this proof-of-concept using minecraft really Just allowed us to have a way of demonstrating how you can send the events up to the cloud but you went many of you know who watched my other videos that you know minecraft squier a good thing that I’m using these days with my son to build some demos to help teach Them about i.t but at the same time we use and you know this really robust infrastructure in the background and playing around with something foot in the middle so in this demo here we I think we took about two and a half hours including building the library in the Cake shop and then you know learning I mean I’ve never called event abbreviated this demo so what we were able to do is just have a bit of a Google to find out how to call event herbs over HTTP and then we can plug that into the minecraft Advanced computer called there and then AJ is pretty good at the the old redstone stuff here these signals and known how to wire them together so it was a bit of a team effort but hopefully that looks like quite a good demo for people and you can see some interest and Stuff to play around either with your kids or potentially there’s some useful stuff for being able to demonstrate real projects as well Video Information
This video, titled ‘Minecraft and Event Hub’, was uploaded by Mike Stephenson on 2015-09-13 21:58:38. It has garnered 422 views and 4 likes. The duration of the video is 00:10:14 or 614 seconds.
Simulating an IoT scenario by integrating minecraft with Azure Service Bus Event Hub, Stream Analytics and Power BI