 Okay, I'm just gonna get started here. People are gonna be wandering in, that's totally okay, but this is bringing JavaScript to the IoT edge. Let's get started. First of all, I just wanna kinda wet your palette a little bit. Get you a little excited about the topic. So why does this matter? Why are we learning about IoT? Why are you here? You've probably seen this graph before, but IoT is growing and will continue to grow. I do wanna put a little asterisk here. I think that IoT's probably been a little hyped. I don't think it's gonna be, it's like we're not seeing the growth quite that way, but I think that IoT is still massive and I think it's still, we're still in the wild west days, trying to figure out what the hell it is. We're early, this is early. We're early on on it too. And JavaScript is a massive part of the IoT ecosystem. So the more you know, great. So my name's Joe Carlson. I work for MongoDB and I'm a developer advocate. Those are my socials. Best way to get a hold of me is actually on Twitter. So feel free to go there. Otherwise, all my social stuff is on my website. Opinions are my own. If I say something or swear something, it's not my company, it's me. And lastly, I'm gonna be posting this link a lot, but all the resources I post in here, including the slides, all the other links, additional resources, links for this recorded session, link to the code, link to videos, they'll all be on that page. So feel free to check that out. I'm just gonna wait here for a second so people can take photos of that. People are taking photos. Is that too small to take QR photos of? Is that, it got it? Cool, awesome. Even the back of the room got it, that's good. Though I'll be posting this more. Yeah. Okay. A little bit more about me too. I see people still taking photos too. Cool. I will be posting this link or this QR code again too. So a little bit more about me. I love IoT and most of my projects that I do on my own are hardware related in some way. This is a magic mirror I put together. It's a smart mirror. You can see it does weather. I'm currently playing on Spotify, some positive affirmations, New York Times headlines, calendar updates, weather, whatever. It's actually, I didn't make it. It's part of Magic Mirror Mirror squared project. You can find more about that down there. We choose this electron. I did make this recently. It's called Mood Light. Those are 3D printed panels and LEDs in the corner and I have a little web app or a little web server built into those little triangles. Anyone here heard of Nanoleafs before? They're big, they're super expensive. You've probably seen if you ever Googled it. I decided I didn't want to pay $300 for nine of them. So I just made my own. But you can control the lights from that web server running from those panels. And you can learn more about that down there. Okay, so before we get started and get into nuts and bolts of this, I want to first just thank you y'all for coming. I sincerely appreciate it. I don't know, I have a cool job where I get to make cool shit and travel around and talk to people. And it's because of you guys coming to these talks. So I just really appreciate it. Thank you for being here. And who's this talk for? This is gonna be for people who are new to JavaScript. Or have some JavaScript experience. Maybe be new to IoT. This is more of a 101 introductory stuff. We're not gonna be getting it to nitty gritty about security, we have 30 minutes. So we're gonna kind of book it through here. But most importantly, even if you're like IoT expert, great, or none of the above, if you don't do JavaScript, you'll still be fine. This talk is still for you. I'm hoping you'll still get something new out of it too. But, great. I wanna get a quick poll and just click, get a quick poll on where y'all are at. So who here has IoT experience? Like done a little bit, maybe messed around with a Raspberry Pi before. Cool, cool, cool, cool. Got it like quarter, half-ish. And then JavaScript experience, I assume everyone in the room. Great, okay, cool, cool. And again, here's that link where all the resources can be found too. So I think everyone's, wanna get it? Yeah, I'll hold this up one more time. I just added these yesterday. QR code, it's so smart. I saw someone at a talk yesterday where someone had QR codes on the links and I'm like, that is so genius. I just quickly added a bunch into my talks, but. Okay, so roadmap, what do we mean, what's the stock gonna look like today? I'm gonna do a quick introduction to IoT, what it is, what I love about it. We're gonna talk about JavaScript and Node and IoT and why you should be considering using them for your next IoT project. I'm gonna be talking about some data practices. I'm a MongoDB developer advocate, so it's kinda, I'm gonna be, I think I have to talk about data a little bit with it. So, which is cool, actually, and I didn't know a lot about this too, so I hope you learn a little bit there too. And then I wanna talk about a real project. So I've been working on an IoT smart kitty litter box in my free time. I've actually been streaming it on Twitch. So we'll be going over that project in particular. And then lastly, we'll be talking about my predictions for where IoT's gonna be going in the future. Right, so what the heck is IoT? It's basically anything that connects up to the internet. And by thing, I mean anything. It's the future. We're seeing lots of stuff, like smart watches, Fitbits. I think the part that people don't consider with IoT is automation, especially with manufacturing, smart plants, connected devices, but I think we see the consumer products quite often and think about those being IoT projects. My personal, personally, I'm interested in two parts about IoT. I love the stupid shit. Have you ever, I didn't see the Twitter account, internet of shit, where people make toaster ovens that connect to the oven or like toilets like I'm putting together here. I think we don't know exactly what it's capable of yet, so we're just putting chips in everything and kind of figuring out what sticks and what doesn't. I kind of love that. Actually, I ran a hackathon in Hawaii called the Stupid Shit and Terrible Ideas Hackathon. It was inspired by another hackathon that got started in New York City. I love that fine line between just a stupid idea and a kind of genius idea. I think that's where, I love that. I think that's great. And I think there's a lot of room there for us to kind of play around in an IoT. The other part I really like too is art. Whenever I travel to cities, I always try to go to an art museum. I personally think that the people in this room, you are really uniquely positioned to explore this new area of art. I think a lot of humanities and artists don't know a lot of programming, but I think that's where we're at. Like there's a lot of exploration that can be done there. I think with internet-connected art, I love that. I love where we're going with that, so, IoT. So, IoT is anything, you put a chip in it, and IoT is exploding. And I love art and stupid shit with internet programming chips in it, so, great. Okay, that was a fast version. I had to kind of give, I had to trim this up because we only have 30 minutes, so we're doing the fast version here today, but. Okay, so, I think that's the part that you'll care about. It's why should you be using JavaScript and IoT with your next IoT project? Well, first of all, did you know, I think actually the Node Foundation who runs this conference, they did a study and they found that actually over 50%, 58% of IoT developers self-identify as node developers. It's the primary language IoT is being developed in today. Personally, this is an opinion, but I think JavaScript's a great language for new developers. So if you're new to programming, right, I think it's a great choice, as opposed to like C or C++, which are like, there are advantages that memory-wise, space-wise, performance-wise, but low-level languages I think can be difficult to learn. I personally, I program in C and C++ and I prefer JavaScript every time. It's just easier, more fun, I'm more comfortable with it. Especially if you've never done an IoT project, like learning the hardware is already like kind of a step you have to learn and like learning a new language on top that's kind of challenging too. Just use what you know, you know? Other thing that, why JavaScript's really popular is it's super easy to update. So you can just have a command that goes out to all of your sensors out in the field and tell it to do a Git pull, an MPM install, and boom, you're updated. With like C or C++, traditionally, you have to reflash those chips with a new hardware or with a new software, excuse me. That can be expensive and time-consuming and challenging to do over a network remotely. And Doug, the internet already speaks JavaScript. We're already communicating on the net. Why can't we communicate with IoT projects also with JavaScript? There's a ton of libraries actually. It's been around, I've been actually developing an IoT and JavaScript for years now. And it's a pretty mature platform. The two big ones right now are Cylon.js. You may know that from Battlestar Galaxica or Johnny Fai from the 1980 something movie, Short Circuit. I'll be going over, I built my litter box using Johnny Fai. We'll be going over code samples with that today. Okay, and also .node in JavaScript, it speaks events, it's event-driven. We use callbacks to kind of handle, callbacks are promised to handle events. We have some sort of events, trigger some callback to handle it. That's basically how IoT works. We're waiting for something to happen and we want to do something. So for example, maybe I have a moisture sensor and it's waiting for like a water event to happen on that sensor and we want to do something with that. We want to analyze it and send it off to our centralized server, cool. Or we have a light sensor that's waiting for it to get dark. We want to trigger some sort of callback function to happen when that event gets triggered. JavaScript speaks that language, the language of physical hardware already. It works, it works just fine. That's how we're building it anyways. It's native. And that's helpful because it helps reduce the cost of listening. It makes it more power efficient instead of having to do work all the time. We just do work when an event gets triggered. All right, so recap. Why should you be considering JavaScript and Node for your next IoT project? 58% of IoT developers already self-identify as Node developers. It's super easy for new developers to learn. C and C++, great for a lot of reasons. There are reasons why you would want to use those for a project. But I would argue JavaScript is great. It works and it's great anyways. Super easy to update over network. You don't have to reflash anything. Just get pull, amp, amp, install, done. And Internet already speaks JavaScript. Super mature platform. And JavaScript is an adventure of a language which is natively how physical hardware works. Cool. All right, any questions so far? We're doing good on time. Great, okay. I want to make a little note about my personal philosophy on technical talks. I love having real projects in my talks. I think it makes abstract examples more concrete. However, there's a fine line. Have you guys been to talks before where the whole thing is just code and then you lose track and then your eyes kind of glaze over? I have that all the time. Or if I stop paying attention for two seconds and I get totally lost and then the rustic talk, I have no idea what's going on. I'm trying to find a balance there between making it less abstract but not have everyone glaze out. So we do do a little bit of actual code. We're not going to be doing a deep dive in anything today though. We have 30 minutes again. We're just going to kind of go into it though. If you do want to go into it deeper, I will be available after the talk on Twitter or like I said, all the code will be on my thing. I will be posting all this stuff to my Twitter as well. Great, great, great. As I already mentioned, I'm a MongoDB employee. So the question I always have to ask is how do we deal with this data? I want to come at this from an angle of what you should be considering if you're choosing a database to store IoT data. So first thing you should be considering is a database needs to ingest data quickly. So imagine I'm running a, I have a moisture sensor farm out at my farm, right? I have a bunch of little sensors out measuring the moisture of my crops. Maybe I have a thousand of them. And all thousand of those data over those IoT sensors are transmitting data back to my centralized database all at the same time. I need a database that's going to be able to handle massive concurrent data, which we see a lot with IoT projects, especially as you start scaling up, right? A home hobby project. Like my IoT kitty litter box, great. Can handle one just fine. But what happens if I start monetizing this and manufacturing and deploying, you know, millions of these out in the field? It's like you need a database that's going to be able to handle a constant stream of data, just a massive amount of concurrent data coming in all the time. So definitely consider that. You want a database that is event-driven. Remember when we talked about how JavaScript and IoT speaks to that event-driven framework? Or you also want a database that can handle events and can read in or write based on events coming in from the field. Flexible schema is also something I would strongly consider as well. So a super common example of IoT projects is upgrading or adding additional sensors. So for example, recently, we'll be getting this a little bit, I added a switch sensor on the door of my litter box to tell when I was going into maintenance mode or when I was opening it to clean it. It was super easy for me to add that additional sensor data to my database. I didn't have to do anything, I had to change any old data because I don't really care. Just like after March 3rd, I'm just going to start tracking all of my additional new sensor data. Not a problem. Not a problem, super easy. Definitely consider, I feel like IoT projects are more flexible with their schema than other types of projects. And lastly, time series data. So there's lots of ways to save your data with IoT project, but time series data is probably the best way. And that's because a lot of times if you're saving data to an IoT database, you're probably doing some sort of reporting on it. That's traditional. You do make some sort of admin dashboard, showing the data over some sort of time period. And yeah, I may be biased, but MongoDB is a great choice for this. It does all those and way more. I'm going to be going into a little bit, just briefly how to do, how I implemented time series data with my kitty litter box today too. Right, so IoT data, best practices. What should you be considering if you are considering saving data for IoT project? You need a database that handles massive concurrent read rights. You want a database that's event driven. You want a database that can handle flexible schema. Oops. And you want a database that can handle time series data well or natively, right? All right, easy. So IoT data best practices, awesome. This is my favorite part, IoT kitty litter box. So let's jump into some practical code. So I built a IoT kitty litter box. And that's my cat jumping on the box at the very end of that thing, but I sprang for a mid-century modern kitty litter box. I am aware that this is extra. You can buy a just $20 thing on Amazon, just a little closed covered thing on it, no problem. But he worth it, so I have a little extra for it. One other note I want to say about this too, this project is actually still a work in progress. I have the MVP done. I'm still actively working on this project. If you do want to watch me continue to work on this project, you can totally check it out. I'm streaming this weekly on the MongoDB Twitch channel. Find a link to it there. And some videos of me working on it actually on our YouTube channel right now too, if you want to check that out. I love this, so it's a great way to like jump in and like, I just love streaming on Twitch is the best, so you can check me out on there. Whoops. This is my cat eating my prototype slash helping out. I don't think he did any permanent damage and he didn't get electrocuted, which is great too. Right, I have a 3D printer. I print out some stuff. 3D printer is not required for this, but I would recommend getting a Raspberry Pi. You can work with a bunch of other stuff. Johnny5 works with a bunch of different IoT hardware, Klinger, Duino's, whatever. I use Raspberry Pi, it's super easy, great. You can run a full node runtime environment on there, no problem. I think it's really a great way to jump in as a beginner. The one downside, it's a credit card size, but you can buy much smaller internet connected chips these days too. Okay. So, I think it's helpful to talk about how we can actually use the Pi and JavaScript to interact with the real world. And that's through the GPIO, the General Purpose Input Output Board. This is actually how we're doing it. For me, and this was the hardest part for me to grow up when I was first starting IoT projects, like okay, great, I get programming, I get servers, I get the front end, but how do I start interacting with the real world? And it's through these pins. So, you can see here, this is a little prototype hooked up to a breadboard with data flowing in and out of the GPIO. And on the Pi there, you can see on the top row with those little black and white wires connected up, that's where the GPIO pins on there. I think there's like 35 of them. But the GPIO, there's two types of pins, well, there's two types in power pins. The first is output. So these are things that your Pi, you can like send out to the world to go do things on it, like turning a switch on and off, or an LED on and off. You go out to do things. The other one is inputs, reading in sensor data from the outside world. For example, sensor data, or light sensors, or weight data, or whatever. You're just waiting for that data to come in, reading that in. I have no idea what all these pins do. They're unmarked on the Pi, most chips in general. Every time I have to interact with it, I have to Google what they are. And I say that just to make it okay for you to have to Google stuff. I'm still learning this stuff. I have memorized it. I have to Google all the time. I don't know. But when you're working with it, just Google it. People will tell you to do this pin, do whatever. Or they'll give you some sort of schema diagram. You can kind of copy and just plug it in. Okay, cool. So let's jump into the real code. Here's another link there, too. Sorry, I'm having trouble here. Great, let's jump into some real code. I want to start from the, I want to kind of take you through a journey of how I put this box together from the beginning to end. So the first thing I always do with an IoT project is actually just getting that dang LED to blink. That's the hello world of IoT projects. And you can see here, this is my demo. It basically means I've initialized that sensor correctly and I'm interacting with the hardware and the GPIO correctly. All right, just like with traditional development, we do iterative development on this thing. I do one little thing, test it out, make sure we're good to go, and then I can upgrade up to the next piece. So this is even before I really knew the schema and what I needed to do. I just kind of set up the board. I just installed Node on the board, set it all up, connected up a diagram, and then I tried doing it. And this is what the code looks like for just the hello world for an IoT project. So I'm using Johnny Five as we talked about. I mentioned Johnny Five also is compatible with a bunch of different boards. So we need to bring in the package for Raspberry Pi because that's what we're working with. We initialize that board and tell it, hey, put Johnny Five working with a Raspberry Pi today. Cool, get that started. And then we have a callback function that is ready. So when that board has been initialized, it's saying, great, we run that up. We just tell it which pin. So we're saying on the GPIO, the 13th pin, which I had to go to Wikipedia for to find out which pin that actually was. And then we have a function just called blank. And that's it. It's super nice. I love Johnny Five because it's super expressive. It's just, they have a bunch of different sensors and it knows how to work with them. So I just have to invoke the function they want to do. But get that hello five. That's only a couple lines of code to get that LED to blank. And I can move that around. To be honest too, I had to look up the circuit diagram for how to hook up an LED. Johnny Five had a bunch of stuff on that too. I took one electrical engineering class in college. I don't remember any of it. I don't remember any of it. I know there's like things with resistors. I have to Google it every time. I'm just like, I want to lower the barrier of entry and say you don't have to be an expert to do this stuff. You can figure it out. Okay, great. So we got our hello world working. Cool. Let's make a toilet. I have a variation this talk where it's IoT, but Internet of Toilets. So we're getting into the IoT projects here, okay? So how does this work? I want to go high level over how this works. We got our kitty litter box here too. And what happens is I have a switch on it. So when I take the top off my box, it goes into maintenance mode. Maintenance mode means I'm either removing clumps from the box or I'm adding more sand to it. Point is though, the maintenance mode allows me to figure out when I need to recalibrate the base weight of the box. So when I put that weight or the close that box up again, that switch closes, I say great. Either I added or moved something, but I need to refigure out what the base weight of that box is. And then I have to, what I'm doing is waiting for a cat sized weight to get added to that new initialized base weight after the maintenance mode gets added. So I'm waiting for that cat sized weight to pop in. I do a, so the box, I'm keeping track, I'm passively tracking my cat's weight. So I have weight sensors in the bottom of the box. And when that cat sized weight gets added, I measure his weight and I'm saving that to a database. He's doing some sort of business on there. And I send that data out there. I kind of wait for, I wait 15 seconds. So we're kind of, see scratches and kind of digs a little bit. Wait for kind of a chill. And then I take his weight. And then once that cat sized weight leaves again, I recalibrate the box weight again. And then I wait for a new event to happen, either a new maintenance mode or a new cat sized thing. I have not figured out what would happen if a raccoon or a possum went in the box or a small dog. But it would probably, I would assume it's my cat over time, so. But the point is I can track things like my cat's bathroom habits and his weight over time. See if there's any drastic changes with that too. I haven't done this yet, but I would love to do like some machine learning models so that I predict my cat's bathroom habits. I want to go like just way too far down this rabbit hole of internet toilet data. But we'll see what happens. I haven't done that yet. Okay, great. So that's how the box is working from a high level. Let's dig into actually, I'm building the code out. So we're doing the same thing we did before. We're initializing a brand new Johnny Five Raspberry Pi board. And then we wait for that ready event. And then the first thing I'm gonna do then is set up the maintenance mode. And, oh, we have a switch. So it's a magnetic switch I have on the door. It just senses when it's open or closed depending on how close that switch is together. And when it's open, we have some sort of event that chappens and I set the maintenance mode. And once maintenance mode's happened, I do that recalibration and whatever I need to do too. So this is a little demo. It's a little hard to see. Let's see if we can figure this out. I may need to record a new video. But you can see the switch on the side there. And we'll just get cut off there. You can see the sensors sensing the open and close events for when that door gets open or goes in a maintenance mode or not. Again, the switch doesn't matter. You could get one of those cheap ones, just put it on the side there so you pop that top off. You need some way to track that whether it's a maintenance mode. I thought about other things too, like a physical switch if it kept like an open box. There's a ton of things you can do for that. It doesn't really matter. Okay, so the switch, the code's really easy for that. It's not too bad. The interesting part is the load cells. So I'm using, I made my own internet connected scale that goes underneath the box. And that's what's measuring the weight and waiting for cat-sized things to enter the box. So here's the tricky part. I couldn't actually find any support for these load cells that I purchased with Johnny Five. So I had to get a little creative. But I still gotta do some cool stuff with Node that you may or may not have played with. I hadn't, but let me show you. So I actually, I did find a library in Python which was able to interact with load cells. This is the code. I want you to, it's like doing some stuff, doesn't really matter. The while loop is where the interesting stuff happens. So it's just constantly, it's a never ending while loop. That's just getting away from the box. The important part here is that print statement. So I'm actually using Node spawn child process to spin up a Python process and read that data for me, which I had never done before. Cause the first time I did this, I set up my own Python server and then it had hooked up web sockets to just real time stream that data to my Node service. But it was like a pain in the ass and like I had to start both these services. And if one of them went down, the whole thing crashed. It was just a massive pain to maintain and like frankly overkill. Child process made this super, super, super easy to run. So the print statement is actually how I'm sending data up to the child process. So this is the Node code for how we're running that. I'm just requiring that spawn child process code. And then the process I'm bringing in is that Python code. And then detach means it runs on a separate thread. So I have one, I just do MPM start and MPM start and Node is responsible for starting up all my Node services. And then it's just waiting for data. So we're saying on data, read it in. And the way you send data from that spawn child process is through that print statement. You just print out the console and the parent process, my Node process reads in anything you're printing the console. So I'm just doing that for loop. Every half a second I'm just sending that data up to my parent child or my parent Node process. And then it reads it in with that callback function. And then I parse it in, comes in a string and then I read it and then do some sort of work with it. And then you also have data and error and a close event too you can also work with too. But, has it ever worked with spawn child process? This was like the mysterious part about Node I had like not worked with yet. I've worked with streams and all this other stuff but I'd never done spawn child process. That's actually pretty jazzed. I got to play around with this a little bit too, so. Hey, you came to an IOT talking. Maybe you learned a little something about spawning some child processes too. But it made my project so much more easier to put together, so much easier to troubleshoot. I love it. Okay, so I want to give a quick demo of how this actually works. So you can see that little piece of plywood there. That's actually my scale. I just bought a piece of plywood. The load sensors are loaded to the bottom of it. I have that little caption there. It's like kind of mess, you can't see really anything. But I'm pressing on the board and you can see that data being registered from my Node project. And you can see the little magnetic switch also hooked up on the door over there too. The reading zero is pressed. God, I really need to record a new video here. So you see nothing. Great. Cool. So this part was the trickiest part, but I think it's great. I do some math and some things on there to kind of zero it out, recalibrate, whatever. But it doesn't really matter what it is. I just kind of, whatever, I just set a base weight and then wait for some sort of weight increase to happen. Okay, cool. I do want to talk to you about, so I promise I'd show you my time series data and how I'm actually saving the state of the database. I'm gonna post a link here on the bottom. If anyone wants $200 in free credits to MongoDB Atlas, there's a link there too, I'll have a link at the end. And there's a link on that page there too. But I'm saving all my data in a MongoDB database. And this is actually what my time series data looks like for my kitty litter box. So I have some basic metadata about my box, what it is. I built some additional metadata in there to, I don't know, in the event I start mass manufacturing these with my Kickstarter, I don't think I will, but just to save some data, right? So I know who it is or if I get more cats or whatever, I can potentially save that data. And then I have an array of events. The events are just noted by a timestamp and a weight. And I also am tracking things like maintenance mode. That's when that door gets opened. So like for example, I'm out of town right now, I have a rover watching my cat. I can track how many times that box gets opened while I'm on the road too, by denoting the maintenance mode time series data on there too. And it's super easy to add or update things in there, but every time an event gets triggered, I'm just appending a thing on here. One note I will say about time series data, the way I would recommend constructing it is based on how you wanna do reporting. So sometimes you're getting sensor data every half a second. So I wanna record moisture data sensor data from a field of every seconds from a thousand sensors. That may be a little crazy. I'm doing mine by day, because I'm doing reporting based on how many times the bathroom, is it going in a day, or how many times I get cleaned a day. But maybe if you have massive data, you wanna do it by minute. So the event is every minute, you're creating a brand new document and keeping track of the array data. Or maybe a year, maybe you're only sporadically keeping track of it. I think with a document database like this, you can be far more expressive about how you are saving that data. And the way I'm doing it is I'm saving the data in the way I want to read it on my analytics charts. I don't have to do, it's already pre-computed, I just pull it in, read that data, boom, it works. I don't have to do any weird math or anything like that. I'm saving it the way I wanna read it. It can be far more expressive. Okay, I wanna talk to just, I wanna show you some of the final pieces there too. Let me kinda put in the whole box together. The single power file that goes in the back. Can I save or stop this? Let's see. You can see the pie, I'm just mounted to a board on the inside there. I 3D printed out a case for it. And I use some high-tech duct tape to kinda put those cards, let's save, make sure the cables are in place. Which is great. And you can see on the bottom, the little red cable, that's all the sensor data coming in from the load cells. Okay, great. Last thing I'm gonna show here too is, there we go. Some reporting. I did put a front end together for this and I'm saving, so I can dashboard it, check it out. I'm still working on doing additional reporting for it too, but I have basic stuff for it too. There's a link to the site too on that Bidley link I gave you as well, so. Great. So I do have a couple more to-do items. I do wanna do it. I mentioned this as a work in progress. But something I want to do is hook up stitch functions to do weekly email reports. I don't wanna get a text message or email every time a cat goes bathroom. I frankly don't care that much, but it'd be nice to get some weekly data or some aggregate data or run some additional analytics on it. I'd also love to do some more front end stuff with it. And like I mentioned too, I would love to do some machine learning with it too. I just wanna, like I said, I have this data. I wanna take it to the logical extreme. See how far we're gonna push it, so. Okay, great. So, we went over a real world example. I hope that you see that the code actually isn't that complicated. We're connecting to it. We tell what pin to go to and we have some callback functions we can do some work with on it. It's actually not that bad. But we talked briefly about the GPIO, how you're sending data out and in to the board. We went over a hello world, making the LED blink using Johnny Five and a Raspberry Pi. We went over the code for how I did that switch data and how I'd handle the load cell data. We went over the spawn child process to handle that Python subcode. We went over the IOT time series data and how we sent that to the cloud. And then we went over kind of my next steps for what I wanted to do with the project as well. Okay, great, let's see here. All right, last part here, the future. I love presentations that go over like their predictions. This stuff is all speculative. They're educated guesses, but it's where I, I don't know, what's next? What's next and what are we gonna start with too? Four things I see. First thing, duh, we're gonna continue seeing smaller and smaller devices that are more and more powerful. I'm using the Raspberry Pi 3B Plus. The Raspberry 4 just came out, super powerful, overkill for my project, didn't need it. But we're gonna continue to see smaller and smaller chips being added on every day. And I think that trend is just gonna happen. We're seeing even chips you can sew in your clothing. We're seeing great stuff, I love. When downside to JavaScript currently is its footprint, so it's garbage collection, it's huge, and it takes a, it's got a minor memory footprint when you're installing that on a device. I think that we're gonna see JavaScript's footprint getting smaller and smaller and more optimized versions for hardware too. It works fine, but that'd be my one caveat. If space and memory is a major concern for you, you would maybe wanna consider using C or C++. You're handling all the memory on your own. There's no garbage, it's like, you're responsible for all of it, but it also makes it way more efficient to run on a piece of hardware. We're gonna see better hardware support too. I, like we mentioned, the load cells, that wasn't currently supported by Johnny V. There's an issue and a PR open for it right now to get it fixed and get it natively supported, but as the platforms get more and more mature, I think we're gonna continue to see better hardware support for that as well. And then this one is always the tricky one and honestly, I think it's the biggest issue for IoT devices today. And that's power and batteries. I think we're already seeing, power is already the bottleneck for our devices today. I feel like everyone's begging our cell phone companies to get better battery life and they're doing it mostly through software and just optimizations of the processes to make better use of the battery life. I feel like on Hackie News and Reddit, I see graphite battery breakthrough at MIT labs or whatever, weekly. I don't know, I haven't seen any of that actually come to consumer market yet, but I'm crossing my fingers that that's gonna be an issue. Regardless though, the problem too with shrinking devices becomes not just battery life, but heat. I think a lot of times, we have those massive computers that produce a ton of heat. As our devices get smaller and smaller too, they're gonna produce more and more heat too, which also could be a concern as well. Batteries, massive problem. We haven't quite cracked that yet. Like my litter box is fine. I could hook those up to batteries. I hook up the wall because it's not moving much, but a lot of wearables have our bottlenecked by it too. Okay, great. Let's do a quick recap and then we'll wrap it up here. So we started the talk today with just doing a quick introduction to IoT. IoT is anything we put a chip in it. We talked about my favorite types of projects being just stupid ass projects. And IoT market is growing with an asterisk there. Why should you be considering Node JavaScript with your next IoT project? 58% of Node developers already self-identify, or IoT developers always are self-identify as Node developers. JavaScript is a great choice for new developers. C and C++ are awesome. They're more challenging to learn though. Easy to update over a network. They know it's already speaking JavaScript. There's a ton of great existing libraries. We went specifically into joining five here today. JavaScript is already an event-driven language. And then we talked a little bit about IoT data and best practices. So when you're looking for a IoT database, or a database to save your IoT data, some things you should consider are looking at a database that's able to ingest data quickly. One that is event-driven, just like we talked about JavaScript with the callback functions. You want one that has a flexible schema so that you can add additional sensor data or change that time series data easily. And look for databases that are able to handle time series data well too. Traditional RB messages can do it well, but like we saw with the document store, it's a really easy, native way to do that, and it works great for reporting and analytics. Then we went over a real-world example of my IoT kitty litter box, and we first talked about the GPIO and how to interact with the real world. We talked about that IoT Hello World project, making the LED blink. We talked about that switch data and the load cells. We sent some data to the cloud and I showed you the time series data, and we talked about next steps to the project. And then lastly, we talked about the future of IoT with smaller and more powerful devices and hardware. I predict that JavaScript will continue getting a smaller and smaller footprint as it gets more and more efficient. And we'll see better hardware support for the existing JavaScript and node libraries. And lastly, batteries will continue to become the bottleneck. I'll leave this up here too. Let me see some taken photos. Okay, so next steps to, if I've inspired you at all today, I hope the goal of this talk is to give you a gentle introduction to it. I also wanna show you that it's okay to not be an expert at hardware to jump in and just try stuff out. So I want to lower the bar of entry for trying your own project. And if I've inspired you to do that today, awesome. And I just want to talk about what you should do if you're interested in doing it. This may be lame, but I just make something, make some stupid shit, make an LED blink, make something for you. I get asked all the time too, like, are you gonna monetize this or sell it? Like, no, I just made it for me. I think it's fun, it's stupid. And I learned something with it, you know? And any project, even it's not IoT, just go home. You saw something inspired you this weekend. I saw a cool Kubernetes talk. Go home and just set up a Kubernetes project just for yourself. Just do it, Google things to get stuck on, you'll figure it out. Everyone in this room is intelligent, smart people who can figure out how to do it too. So just make something stupid just for you, try to figure it out. Let's see here, any questions? Oh, we're running out of time. So I'll be here for questions, if you have anything, but thank you so much. Clap, thank you. There's a link to the information and $200 for your credits and my information here too.