 Hey folks, welcome to another episode of Visual Studio Toolbox. I'm your host Dimitri and I'm here once again with Suze. Hi Suze, welcome to our last episode of our series on Windows IoT. Thanks. I'm a little bit sad. This has been really fun to film. Well, how about we do a bunch more episodes on a bunch of other IoT stuff? That sounds good. Maybe we can ask people what they want to see next. Yeah, that'd be great. So if you want to see something, leave some comments in the show notes and we'll try to make it happen. So what are we here to talk about today specifically? Yeah. So today we're actually going to be talking about things that are a little bit more advanced than what we covered in a practical sense. On how you can add extra things to your IoT smart device to make it a little bit more professional and a little bit more powerful, perhaps maybe a little bit more offline ready as well, and just how to use the data that you're actually getting from the device as well in a practical sense. Okay. That's awesome. So let's jump into it and I think the first thing you wanted to show was that physical aspect of it. Yes. Like you have this device, you can attach a bunch of stuff to it. Not exactly the best thing to even test sometimes because you got to bring it somewhere, put it somewhere and it's like, what's that mess of wires over there? We don't want that kind of from people and be like, what's that device you're testing? So how do you take it from having a board with sensors and everything to a device, and how do you tailor it to the scenarios? I think we have a solution for all that stuff now. Yeah. That was definitely missing from this series because we wanted to show what it looks like when you're just prototyping, right? Yeah. But eventually you're going to get to the point where you're really happy with the functionality, but as you said, it's just a mess of wires and it doesn't look as professional as you would want it to look. Also, it's probably not as waterproof and things like that if you wanted to put it outside. Yeah. So there are actually options out there for you and you don't have to spend a fortune to design enclosures and things like that for your device. So that's usually the quickest thing that you can do to make a device look more professional is to hide all of the wires away, solder everything together instead of using a breadboard, and then somehow source or make your own enclosure for your device. So I have some 3D printed ones here that I printed at home just to show you the quality that you can achieve using a home 3D printer, which is really cool. Yeah. Let's take a look at them. Yeah. So the first one that I have is a Raspberry Pi case, and this is just printed in two different parts. I think it took maybe four hours to print, and the two pieces snap together, and it basically will print on almost any 3D printer that you have at home. Cool. Which is really cool. And so this just protects it, but it also just makes it look, as I said, more professional. And I like printing in black filament because it looks really cool. And so then you just snap the pieces together. It has really nice features such as it has the opening for all of the different plugs and things that you're using, such as the Ethernet that we used, your webcam can plug in on the side, and then you can also plug in your HDMI screen that we had there as well. Then it just snaps together really neatly, and that's already made a huge difference to how your end product looks. Yeah. The next thing we have is we had a screen as part of our device, and this is an example of if you were using a seven inch screen that you can print something just to enclose that and just to hide some of the wires and things. And then what you can do is you can move your Raspberry Pi to be at the back of the enclosure as well. And then that way it's a neat and tidy package. And you can put that on your wall and it actually looks like a real thing that you might have bought off the shelf at Best Buy or something like that. Yeah, that's very cool. And I think the first question anybody watching this would have would be like, okay, great, it's good that you guys have the skills to do that. I know even I wouldn't have the skills to create the 3D model needed for the 3D printer, but there are solutions out there in the community for it. So let's go take a look at those, right? Yeah, that's right. So I do know how to 3D model and I do have CAD skills, but I'll let you in on a secret. I didn't actually model any of these by hand. And so there are online communities that you can hit up to find things that might work for your project. And even if you just find something that's close enough, you can pretty much teach yourself how to just modify something existing to work for your custom use case, which is pretty cool. So one of those websites is called Thingiverse.com. And it has basically a collection of 3D models that the community has uploaded. Oh, these are so cool, look at all the models. I know, I really like them. So some of them are sort of like they look like Nintendo's. There's some really interesting ones like this one here. This is a Raspberry Pi seven inch touchscreen display. So this might be the kind of thing that you're looking for. Yeah, look at that, it's got the pie in the back. It has everything. Nice, so these are like the files, right? This isn't the place that prints for you, but this is the place. If you have a 3D printer or some way to 3D print, you're using these formats. Exactly, so you see these here, these are called STL files, which stands for Stereolithography files, which is like a mouthful. But generally that's the file format that is recognized by your software that can then prepare that file for 3D printing later on. And so this is basically like the source code, I guess, of your physical model. Yeah, excellent sense. I mean, I think most developers at some point have run into some 3D format or some complex format. So we're speaking to a good community, but in terms of like having done this or having access to somebody who's very figured out the dimensions and the model and the format and just you can just print it, that's really awesome. It's really, really nice. Which 3D printer do you have? Is it kind of worth mentioning? Is it one that is a good one for people to think about if they're entering the market or do you just have something by chance? Yeah, so there are different kind of budgets as well to account for. So I got one that was on the sort of more budget friendly side. So I really like the company Printabot, and that's P-R-I-N-T-R-B-O-T. And I have the Printabot Plus metal and it has like two different print heads and it has a heated bed. And so that just means that it's easy to print in a variety of materials. But you can also go up to some of the more upscale, more expensive ones. And they tend to be better quality. So I can definitely recommend the latest Ultimaker 3D printer. That's a really, really cool one. It has lots of features just to help you know if anything's going wrong and it can help prep your prints so that they come out better and things like that. Yeah, I know Scott Hanselman always talks about his various adventures in 3D printing. Yeah. You know, sometimes he thinks, well, this looks printable. He starts printing it, but then the way the layers are going in. Yeah. Like it doesn't quite work out the way he expected it. He's had some funny pictures he showed. It can be really tricky. It seems like a fun game if you can afford it. It's definitely a fun hobby where you learn the most in the first week. And then after that, you're sort of like, OK, I sort of get how this works now. But not everyone sort of has access to a printer or can afford one or has room to have one in their house. So we totally... You just describe me basically. So how do I do this? Yeah, so I've sort of like shoved mine into a corner and it sort of doesn't quite belong there, but I've made it work. But if you don't have a printer and you don't plan on getting one, there are also online services just like how Thingiverse allows you to find models to download. There are services that allow you to find basically a printer to print something for you. And so the one that I've used the most heavily over the last few years, I've been using them since probably 2010, Shapeways. And Shapeways are a startup that are based in New York and they have lots of different really professional grade 3D printers. So much better than the ones that I have at home. And basically you upload your files and you can upload STL files directly to them, which is really cool. You can literally just download from Thingiverse and upload straight to Shapeways. And you can pick your material, pick your color and things like that. And generally like something like a black plastic at the time of this recording takes about five to ten business days to arrive. So it's about the same amount of time for you to order business cards and things like that. But you get like a 3D printed object. That's so amazing. Yeah, which is really, really cool. So 3D printing by demand is definitely something that you should take advantage of. And it's pretty affordable. It's much more affordable than risking a $3,000 machine and then not actually really liking it. That would suck. Yes. And in that case, that would probably give me all that because it has to be practical sometimes. And it's awesome that these services exist. I grew up watching the internet kind of appear as a consumer product around me. But you know, just my time just happened to lap right into that. And I remember the first days like you can print cards yourself. It became a thing and the web you can design. And then it became t-shirts and then it became all this other stuff. And now it's like 3D objects that you send them the 3D model for. So it's like mostly in my mind when I just realize how much we've done. It's amazing what you can do. And you don't just have to settle for plastic, which a lot of the kind of home 3D printers do. This service also offers things like ceramic and also metals and materials like that, which I think are really, really cool. And also there's some that are blends of plastic and metal, which is really cool as well. There's one called Alomide, which is that. So definitely check it out. And you will get probably a much more professional finish anyway than the ones that you print at home. Very cool. Awesome. So the next thing you wanted to talk about was, you know, going to like, like we're today covering the edges of this world. It's made it a good segue. Yeah, that is a good segue. It didn't mean it, but it's a good segue. So I think we talked about like the physical containers. But we also wanted to close out this episode with one topic, which was the edge and how to run things offline and how to, you know, bring more to IoT Core than what it could without IoT Edge runtime, which is kind of cool to tell us about it. Yeah, totally. So IoT Edge is basically a product that we offer that allows you to just add enhanced capability to your device when you're doing things like contacting IoT Hub to send telemetry and things like that. So previously before IoT Edge, your Windows IoT Core device would just have a direct connection to IoT Hub in the cloud, right? And so what happens if that device goes offline and the messages start failing and things like that? Like, you sort of have to handle that case. And you also can't super easily do things like filtering or analysis right on the device itself instead of, you know, because then you would have to rely on running all of that stuff in the cloud. So being able to do stuff at a lower latency or being able to manage your costs by only sending the telemetry up to the cloud that you actually care about, these are all use cases that IoT Edge helps out with, which is really, really cool. Yeah, and it seems like a decent documentation that we have open and we'll make sure the links to this are in the show notes, which is like runs on the Windows IoT Core, runs on the Linux devices that we support, so that's pretty cool. Yeah, it's really cool. And so, again, just to go over that, like, let's say that this device loses access to the Internet and it can't contact the IoT Edge Hub. IoT, sorry, the IoT Hub. IoT Edge, for example, which is running on the machine will buffer all of those messages and then when it gains connectivity again, it will then send them all up. So you don't lose things, but you don't also have to, like, manually handle that in your own code and things like that. That makes a lot of sense, is bringing the service elements down to the device and letting some of that run offline or run in delayed send mode, depending on connectivity, all of that is really awesome. Totally, yeah. There's this really cool system that they have around IoT Edge devices, which allow you to deploy things like modules. And these modules all kind of work together for you to be able to filter and route data between them. And so you can do things like have some kind of threshold for a temperature reading and only send the values that are above that threshold to IoT Hub. And so the Edge device running a filter module like that that you can either write yourself or find the source of online can handle for you. You can also run Azure Stream Analytics on the Edge as well. And that's not in the cloud, which you'll probably use to sync Stream Analytics. You can do that locally as well within a module. And we also have documentation on how to deploy an Azure Stream Analytics module. And the last thing was that I mentioned before was machine learning, which is really cool. So imagine we had our webcam, but we wanted to start doing things like our other scenario that we've joked about the last episode, which was spotting your cat jumping on the kitchen counter. So you can end up creating a custom vision model for spotting cats, and especially spotting cats at certain heights maybe. And then you can essentially run that model locally in a module on Azure IoT Edge. So again, you're sort of doing these things at a lower latency because you're able to process them before you actually go up to the cloud as well. And so that's just sort of like a high-level overview of some of the advanced functionality that you can add to your IoT Core device now that we've connected all the sensors up and we're sort of collecting them and reporting on them, which is pretty cool. Yeah, very cool. This is great. I mean, I think this kind of set of stuff will take it from like, hey, I'm a C-sharp developer and I can write to this device all the way through. I can build something that I can put somewhere that looks professional. I can put offline capabilities on it that I couldn't do before with machine learning or buffering my telemetry has been sent up so that really kind of unifies the picture. And I think that you had one more demo that you want to demonstrate, right? Yeah. IoT Central. Yeah, so we touched on IoT Central really briefly when we introduced Connecting to Azure IoT Hub. But it really is a very powerful platform, so I just wanted to give it a little bit more time in this episode to talk about it. And we do actually have some really cool docs to show you exactly how to do this. So this one here is great. It's like a three-minute read, so it's not like a super long one where you're going through lots and lots of steps. So remind folks what problem is IoT Central solving? Yeah, that's a really good point. So when you're sending telemetry up to IoT Hub, IoT Hub just sort of collects it, but you have to have something at the other side listening for that telemetry to come through, right? To make it meaningful. Yes, exactly. And so you want to gain things like insights and also be able to control devices as well remotely. But having to write all of that yourself from scratch, especially when you're also trying to work on the other end, the actual device itself can be super overwhelming. So Azure IoT Central is a SaaS service that we offer that basically gives you a lot of that functionality out of the box, and it's really, really easy to connect to. Like there's a single connection string that you use, and then your device is already speaking to the dashboard. And so I can show you what it actually looks like because that does a really good job of actually explaining it. So here is one IoT Central application that I've already set up. This is connected to a Windows IoT Core device. And as you can see here, we are measuring humidity, pressure, and temperature. So very similar stuff that we had plugged into our device over this series. And we can have a look at these messages immediately just to verify, oh, these messages are ending up in IoT Hub and they are the sort of values that we're expecting and things like that. So it can be that kind of instant gratification that's like, oh, it's actually the device is online and I'm seeing what I'm expecting. Look at that. It's updating in real time as we talk here. It just brings at us. And that control that generates the view that you have specifically chosen, that's something you chose out of some preset. That's correct. Yep, but we can also add new measurements. So remember how we had the proximity? We can decide to add that as like a new piece of telemetry and then what we end up doing is we can just type in, we can actually type that in and just say that it is supposed to be measuring like how close someone's hand is or something like that. And so I can call that proximity, if I can spell. And we're just going to call it the same thing. And so this field name is sort of, is going to be the property that it'll be looking for from our Azure IoT Hub like telemetry package. So when we send a JSON object, we have things like a property for humidity, pressure, temperature. If we added another one for proximity, if I can spell that. Yes, I can. Then we've got that. And then the units would be, I guess like I think it was millimeters, trying to remember. And then the minimum value would be at zero millimeters away. And then the maximum value that this can read, I think, was I believe 70 millimeters, but I need to check that. Cool, and it's actually simulating what it will look like in IoT Central, it's cool. And you can pick things like color and it actually- Who doesn't love color and look at that, that's amazing. It actually picks harmonious colors too, which I love because I'm really bad at picking colors that look nice together. So I actually really like that. So after I save this, it's going to give me sort of like a simulated variety of it. But if I was having a real device actually reporting this live, that's when it would start showing up, which is really cool. So you can basically customize your dashboard based on what telemetry you actually care about, which I think is really cool. And then from there you can create things like rules, such as if a certain piece of telemetry gets above a threshold. So like maybe I'll call it hot. And then I'm going to save that and add some conditions. So if the temperature, oops, yep. So if the temperature, maybe the average is greater than, and then let's select a threshold. I think we were doing this in Fahrenheit, weren't we? Yes, we were doing it in Fahrenheit. So if it's above 80 degrees Fahrenheit, then maybe we're a little bit stressed out about that room being hot, we can actually do that. And then let's say it's going to just take like a five minute average. So it won't react immediately, but it'll tell us when it's hot. Right, I mean that's a useful kind of set of conditions there makes sense. Totally, so we can save that rule, but then we can actually then add an action based on that rule. So there are going to be a lot more actions coming soon, but I think that some of the most exciting ones are like email and webhook. So if you had something like an Azure function, for example, you could have that Azure function do something. You can have this email. And I just think it's really, really cool that you can get notified. So as you can see, there are a lot of really cool features coming soon. Cool. And given that Azure functions is not here yet, technically you could still maybe get away with the webhook. You can fill in the webhook, it's just, I'm guessing they're going to add deeper, easier integration. I know like a lot of the teams that I'm trying to make very common scenarios come in easy, but give you generic approach. Totally, and so these are the ones that they're sort of getting feedback on now, and then there's going to be more added in the future. So I thought that was really cool. And then you can also set like the notes that appear in the email, and also just like what it actually, what the email action is, and who to send it to, which I think is pretty cool. Yeah, it's very cool. The last thing that you can do is commands is what, well there's a lot of things in IoT Central, but the last thing that I wanted to show today was also commands to remotely manage your device as well. And so they have notes on where to get started with adding the commands, but this is all around your device methods and things like that, that we covered in the last episode. So technically you could run those things without having to use something like the device explorer, like what we used. So as you can see, it's really, really powerful. And when you're running multiple devices, you can set up all of these different dashboards, and you can also set up different roles. So for example, you could have your family under a certain role so they can log in and also monitor your house for you as well, which I think is really, really cool. Very nice. Yeah, I remember looking at IoT Central when I first came out, like literally like the, I don't even know if it was public, like I just got my access to it. And I was like, okay, I can kind of see what this is going, like there wasn't much there, it was like an internal beta, but now it's like, yeah, this is useful. Like I could see myself starting to use this certain experimentation. It's a very cool that we can show this. Yeah, so the product team, I've spoken to a few times and they are just rolling out lots and lots of features. And unfortunately I can't even mention some of them because they're a little bit secret right now, but it's definitely one of our SaaS services to watch because it's getting better and better every day, which is why I'm just really excited to mention it several times during this series because it takes so much work out of having to set all of this up for the first time, like having to find charting libraries and having to like write this stuff from scratch is probably one of the least pleasant things. And I think that other tools out there just don't quite manage this well from a device perspective, even if they manage it from something like, you know, just like a graphing perspective. So yeah, so this kind of has like the whole package. Very cool. So we have some documentation on how to do that. And you can also reference our smart device app that we put on GitHub because all of the code shares how to put in your Windows, sorry, your IoT central connection string and things like that. So that's all covered in there. And the documentation here too is super helpful as well. So it'll walk you through all of that. Great. Well, I think this has been a great series. I feel like we've concluded everything. We said we were going to show us. I'm excited. Give all the hard work. We got there. Yeah, we got there. And you know, hopefully folks enjoyed this episode. And if you out there have an idea of something else that you think, hey, it'd be really great if you guys did a whole episode on topic X or Y. Just put it into the show comments either on Channel 9 or on YouTube where you'll find this episode and let us know and we'll do our best in our crazy busy schedule. But this is something we're very passionate about here and hope you enjoyed the series. If you missed any of the other episodes, they're all available as well. And Sus, thank you again for being on Just City Toolbox. Thanks for having me. All right. See you next time, everybody. Bye-bye. Thanks for watching.