Prak, thank you for being with us today. My pleasure. Now you talk a lot about cities and you do that through visualisation much more than you do looking at stats and data. Why do you look at visualisation? Why is that important? Data visualisation is critical because we are a visual species, right? We actually understand pictures, images, video, even sounds better than just reading words. And this is particularly the case when we're trying to emphasise some of these big megatrends like urbanisation. It's one thing to simply say most of the world population lives in cities. But then in your mind you're still thinking, well the world is still defined by these national boundaries between 200 sovereign states. But if you look at a visualisation that shows you where every human being in the world is and you see this bright coloured belt of people concentrating around coastal Asia basically and other key urban corridors like Northwestern Europe, the Eastern Seaboard of the United States, you start to imagine the organisation of the human species being literally very, very different from what our mental and political maps tell us. I think only data visualisation and mapping can really drive that point home. We are actually not a human civilisation that is neatly organised into 200 countries. We are actually a coastal urban civilisation. That is a more true statement about mankind than that sovereign states are the immutable mode of human organisation. That's not true. The urban coastal reality is much more true. It's been becoming more and more true for 60,000 years. It has history on its side. And if you don't map that, it's much more difficult to persuade people. And as soon as people see the map, they're like, oh yes, it has to be true because I'm looking at it, right? So that's why it's so important.  So it actually has a very strict definition or formal definition, a global city ranks in the top tier for being the conduit of flows for goods, for people, for capital, for services, for data and so forth. So you have to be one of the places that amasses, that concentrates or that filters these flows around the world. And they are actually for the thousands of cities that there are in the world and for the dozens of mega cities that there are in the world, there's only about six or seven actual true top tier global cities. New York and London, Hong Kong and Singapore, Shanghai and Dubai, Los Angeles. Those are the top tier global cities. In other words, if they go offline, so to speak, a lot of flows of goods, services, data, people, it's on go with them, so to speak. And so they really are not just financial or demographic or even political centers for their own country. They are far more the capitals functionally for entire regions and regions that span boundaries. So Singapore is not at all a mega city. It is only five million people. But three quarters of all of the foreign investment, the hundreds of billions of dollars of foreign investment from all over the planet earth that flow into the ASEAN region of 700 million people, three quarters of it flows through little, little Singapore, right? So that's one little anecdote that demonstrates how a place can be a global city, even though it will always be a very small island with less than 10 million people. So you talked today about the different levels of development, I guess, within cities going from survival to quality of life. Can you describe what constitutes each of those four levels? Sure. So most people in the world who, first of all, only about 60% of the world's population is urbanized. So by definition, really, the majority of the world's population, those who live in mega cities of the developing world or in rural areas, live at this very basic level of infrastructure where you just have basic marketization, you have very simple housing, you have inadequate sanitation, if any sanitation and so forth. Literally much of the world's population is still there. Then you start to have more basic infrastructure around housing. You may have hospitals or be more like medical clinics. You may have some sewage collection and so forth. And then you start to get up to, today what we think of is modern cities that are, but still very inadequate. So even in places like Mumbai, New Delhi, Jakarta, Manila, these are really big, huge cities, but they're very, very stratified. Small quadrants of people live in places with very high-quality services where you would think that they were in Sydney, but there's very few people. You have tens of millions who live in slums or just tenements. You've got maybe just housing blocks stretching for miles and miles. At least they have housing, but it's now the services are insufficient in supply, whether it's transportation, education and so forth. So only at the top end, at the far right end of the spectrum, the highest quality of life cities, a very small percentage of the world population actually lives, not just in the cities, but in the districts of cities, because here I'm not talking about the Bronx. If we're talking about New York, I'm talking about Central Park South in Manhattan. So in the same city or worldwide, the number of people who have access to that highest quality of life, the sustainable buildings, clean energy, the top sort of educational and healthcare facilities and so forth, that is not available to the masses. So we're talking about maybe a couple of hundred million people out of a population of eight billion people in the world who enjoy that quality of life. And the task that we have is not to move every human being into downtown Sydney. That's not what the future is going to look like or should look like, but it's certainly to improve the infrastructural quality and access for the majority of the world's population because without those basics, you don't become consumers. You don't become educated. You don't live a healthy life. You are not going to become a driver of economic growth. We are going to live in highly unequal and stratified economic systems where the top five or 10% are driving everything for a long time to come until everyone has the basics. And so it's important for everyone to have those basics and we're going to live in a low growth world, except for in those places where you start to increase access for people and access begins with infrastructure. So you've talked a lot about boundaries and the old fashioned nature of some boundaries compared to what's really going on with the development of cities. Can we just talk about the United States as an example now with the 50 states on mainland United States? How would you reorganize those? So as with most countries, you have multiple layers of authority vertically, federal, state, local, municipal. So at the federal level, there's only one national government that is in Washington. But you have these 50 states. Now the 50 states is obviously a legacy of devising political administrative boundaries, mostly vertical lines, very large Western states. This owes really itself to 18th century logic of America's expansion and demarcating these administrative rectangles, basically. It's not exactly a good way to explain or even understand how the 300 million citizens of the United States operate on a day-to-day level. If you actually use data analysis to look at people's commuting patterns, where do they live versus where do they work? Where do they travel for business? If you look at their telephone calls, who do they call? What zip code? What area code? What area code? If you look at how they spend money, you will find that America has actually functionally organized, not according to these 50 administrative political states, but according to 40 high-density clusters around the country, mostly from the Northeast and the Ark that goes through the South all the way westward up through California, whereas the Midwest and Great Plains is largely depopulated. So there are 40 cities that actually administratively organize America. And that's a different map from those 50 rigidly divided states. But those 50 states are the ones represented in Congress, so you have an enormous amount of distortion in how fiscal allocation is done. It's not that the rural areas that control a lot of the political voice should be neglected, but there needs to be more balance and harmony. So I would, in fact, not necessarily do away with the 50 states as they are, but I would give a lot more power, a lot more fiscal voice to these urban conurbations, but with the emphasis that they actually have to connect to each other so that you enhance mobility of people around the country. That's absolutely fundamental. Mobility is not just something that we increasingly think of as a human right globally. Mobility is something that's really foundational for people to resort themselves as economies evolve. And we're seeing that that's a very critical priority for America today. So there are a lot of reforms that I would propose to the United States at all levels, federal, state, and local. But one of the key things is that the most densely populated areas need to have a sufficient political voice so that they can have the capital allocation that's necessary to provide for their people. I don't think that that is sort of an irrational claim. Just finally, I know that you talked a lot about the smart cities today within the forum, and the number of smart cities there are that claim smart city status. If you could narrow it down from that 2,500 cities and pick your top five, who are the top five that Australia should be looking to to learn more about smart city status? That's a great question, a difficult question. Of course, smart cities has become something of an industry, and I visited many so-called smart city projects around the world, and they're not particularly impressive. And a lot of people think that greenfield cities are the way to go. Where are the places in the world where you've built a high-tech city from scratch, and it really represents a role model and archetype of the high quality of life and sustainability that Australian cities want to emulate? And the answer is exactly zero. Australian cities already rank, whether it's Sydney, Melbourne, Adelaide, Perth, already ranked very, very high in terms of bringing together all of these attributes of good public services, affordable lifestyle, good harmony with nature, strong services, community, walkability, mixed use, real estate developments. India already features a lot of that. But if you want to evolve in the technological domain and think about how can you do this better? There are certainly places like Barcelona, like Berlin, where you're starting to see the latest technologies come together with public priorities, with upgrading infrastructure, with encouraging entrepreneurship through digital connectivity at the individual level. All of those factors in America, Seattle is doing really interesting things because they are a very powerful city that's saying we are going to raise local taxes to ensure a lot more investment in affordable housing and the technology upgrades in education and facilitation of e-commerce. It's the home of Amazon, of course, for all the people here. And people are flocking there because it's affordable. It's high-tech. It's sustainable. It's progressive. So Australia really does have those elements. So it depends on what you want to do. What any particular Australia city wants to do better than it's already doing, you may want to look at places like the Seattle's and the Barcelona's and the Berlin's. But I assure you, Australians, listening here, there are very few places in the world doing anything better than you are. So I hope that's an optimistic message. Thank you very much for your time, Farag. We really appreciate it.


I love that, very thanks very much. Ted Ralston here folks. Friday afternoon on our show, Where the Drone Leads and Think Tech Away downtown. You can see we're taking the studio apart in the background. You can see a lot of the framing and such, but don't worry, the show will continue on. And of course this show is the very last thing you have to do before beginning a three-day weekend. So we appreciate you sticking with us. And even though we're in the process of reconstructing the studio here. Anyway, Ted Ralston here. Our host today is John Mullen. John is in just north of San Francisco at home. John, you there? Yes, hi there. John, you're guilty of not having been on the show in the last six months, you know. Sorry. It's good to have you back on again. And as I mentioned, our studio is being reframed here. You can see in the background. You are in a really interesting place there. You've got timbers behind you and all kinds of interesting looking cathedral structure. Where are you at, John? It's an A-frame, A-frame house in the woods. Just about a half hour from downtown San Francisco. Okay. Oh, there is actually green grass and dirt and stuff within a half hour drive from San Francisco. Oh boy, it is there. It's, you know, the headlands where there's very few houses and all that stuff. That's great. And then you guys have had some heavy weather this week, haven't you? Very heavy weather. A lot of rain and uprooted trees. There's two major freeways down. Highway 37 and Highway 113 are both not operable because there's many trees over them. And you're kind of a guy who totally depends on connectivity. How's that been in the face of all that storm? I've got a lot of backup. Many different ways. I'll bet you do. That's cool. That's all right, John. That's great. And of course, we have here about a beautiful week. It's been a corner winds pretty much. So clear skies and a lot of heat and oceans beautiful. So anyway, comparison of two sides of the Pacific here. But John, the subject we thought we'd talk about today is something that you are pretty close to that of counter drone. We're talking about normally about productive means of drone uses on this show. But every now and then we have to stand back and think about the potential counter uses, malicious uses, adverse uses that people could either, either with intent or by accident get into in terms of drone usage and the potential downside risk that comes to the population as a result of that. I'll bet you spent some time thinking about that this week. I have spent a lot of time, yes. Okay, great. And we'll be thinking about that a lot next week, too. As you know, we had some visitors out here talking about that very subject. But I think when we speak of drones and counter drone, it's probably confusing to a lot of people who aren't very close to say where the technology is all going. And I wanted to think of it this way. We've taken on the show for this year coming up to consider 2017 to be the year of community outreach and community involvement in drones so that we can make sure the story gets distributed and passed and integrated with the schools and the people and organizations and such that potentially will come in contact with drones that will find them useful to them in such agriculture, education, environmental, coastal sciences and such, all participants in the future of drone utility. But I think, as I think about it actually, part of the community outreach and community involvement would include the safety and the protection against the misuse of drones. And drones could be misused accidentally. They could be misused intentionally. They could be misused only because the circumstances under which they're being used weren't thoroughly considered. So there's a lot of reasons that counter drone is an important aspect. I guess in the maybe analogy is that antivirus is a pretty important part of our operations daily with our computers and our laptops and such. So if you think about that, John, what are the components, the elements, the pieces that make up a counter drone frame of mind? I think in the public, first it's privacy.  You've got the loud buzzing sound and potential falling out of the sky, correct? So there's a lot of, I think, civil issues that have to be worked out. There's the FAA that's gone back and forth on what regulations you have to have to fly a drone and that's changing all the time. And then as you know, there's the military and the other use of drones which is defensive and offensive weapons and then protection and all of that. So there's many dimensions. I mean there's components to watch for drones whether you listen acoustic or whether you see a camera that's ready to see it or you somehow pick up the radio frequencies or radar. I mean those are all different things how you blast it out of the sky. You either push the electronics back at it and tell it to go away or you blast it with something and there's many dimensions. So we can actually maybe relabel that term counter drone which we throw around relatively loosely. We could maybe relabel that drone security or something like that which has in it the counter aspect and has in it the defeat aspect and it has in it all the social connections and the social permissions and legalities that you mentioned. There's a term other than counter drone that applies here in the larger scope and I think from our taking this obligation of making 2017 the year of community involvement we probably have to come up with the right term there. Yeah and there's different terms and different spaces. I mean as we're talking community involvement that probably doesn't include the defense department. Is that community involvement? So if we're talking community involvement you're probably talking public policy and municipal but it does overlap to airports and air traffic control and the drones have an electronic signature and electronic communications which can interdict and cause problems with other critical services. That's interesting so that not only is there the issue of the drones use being potentially misdirected but what you're suggesting is just the way drones operate with the radio communication maybe even the video downlink and such that could have some unintended interference with other civil operations. That's right, exactly right. In Hawaii it could affect the radio telescope up in the mountains or it could affect the air traffic or it could affect police communications or it could affect military. So even a small low power transmitter either the handheld ground controller or the transmitter on the UAV itself those are potential sources of electromagnetic interference. There's one today that the FAA is going after that was put on the market you can buy from the internet that will directly affect air traffic control signals and it's set up for people to use for drones and I don't know what country it comes from but if you buy it and plug it in you're breaking along. What does this thing do? It's a controller for drones on a different frequency than the standard frequencies but it steps on the air traffic control frequencies. What you're saying is I understand it now that most of the drones we have in this country and probably everywhere are on the unlicensed public frequencies 0.4, 0.5, 0.8 and those that are available for garage door openers, medical devices Wi-Fi and drones and you're suggesting that somebody's making a device that illegally uses the wrong frequency spectrum and as a result could potentially step on other people who are using that spectrum. Exactly, exactly. And how do we stop this? How do we open it? People that are putting this stuff out and they're such demand and interest they're not observing the laws. I mean it's always happened. It's always happened with the amateur radio and the rest of it where somebody kind of overlaps or does something and then they get caught and then they come back and then it's adjudicated, it's a civil tort or it's whatever but here we are but there's such demand right now in the drone area that I think you're seeing aggressive and a little bit more in this area. So maybe part of this public outreach and community involvement is some form of recognition that there are domains of legal operations such as frequencies, radio frequencies and advise the public that there are potential violations of that and I wonder how the public would even discover something like that. This is a very complex subject for the public to grab a hold of. I got it from the amateur radio magazine. I'll bet I know who you got that from. Exactly. She's sitting right out there. Great. So it's not going to go to the general public but it's going to go to anybody who's reading and digging deep into radio frequencies and in my, I'm an old guy, right? It's like Wolfman Jack used to probably... I think I'm probably older. I don't know but across the... When I was going to high school the earth was just crusting over. We went to bed on a Tuesday night and there were these piles of molten basalt and such and by the next day they had crusted over on Wednesday morning and got up. The guy named Wolfman Jack was broadcasting across the other side of Mexico, you know, across the border and he was using some illegal pirate frequencies and F.A. couldn't touch him because he was Mexico but he was broadcasting all over Southern California, you know, hip-hop radio, well before hip-hop it was some sort of rock and roll sort of thing where you're overlapping frequencies but in this case it's the air traffic control so planes could theoretically fall out of the sky which is not a good thing, right?  You can't tell it's on until it's on. Right, it's kind of the reason that the police have those cell phone scanners now, what do they call them? Tiger sharks or something? And they use them to see if people are making phone calls while they're driving and then there's all the ACLUs up in arms because what are you doing? Let's snooping in on my phone calls but, you know, it's back and forth again, same stuff. So we're going to have to probably at some point in time have a scanner that looks for radio frequency interference and operations in domains that are infrastructure critical such as air traffic control that are not licensed. Right. I guess that's the way of the world, isn't it? Every time you have something that works for you, you have to protect against it being used in the adverse way either by accident or by intent. Right. Well, when people weren't doing much radio frequency then we could kind of sit back and not have to do all this but when you introduce things like a lot of drones that are doing a lot of activity and some of them are homemade and some of them come from other countries and some of them are this and that, you're just increasing the spectrum which means you're going to have to govern it better. That sounds like a subject for RTCA the folks at the Department of Commerce who try to sit on top of all the spectrum usage and such. It does. I don't know them very well. Are you familiar with them? I've had to file so many papers every time we run a test anywhere like jumping through 100 hoops to just file the papers to be able to put it in the sky, right? And yes I have been unfortunately and I mean they're trying to do their job I'm not criticizing it's just it's not easy, right? You know that actually opens up an entire domain here and that is the just as we have so many more drones and systems of ground controllers and the aircraft entering the mix we're going to have mutual interference in some way I would think between ground controllers and aircraft and people inadvertently getting a control of somebody else's drone we're going to have this sort of self inflicted complication as a result as well we're going to need standards aren't we not in the radio domain to try to sort this thing out? Yes. That's with drones that you fly with a joystick but if you get drones that are autonomous and basically give them a flight pattern and get out of the way then it's a little bit different situation. This is a really complex future let's think about that over the first break here come back and figure out how we're going to identify and make a picture of this problem and then figure out how we can attack it after the first break here. Great. My name is Ray Tsuchiyama and I'm from Kalihi Palama spent 20 years in Tokyo, Japan I came back after the great earthquake I watch think tech all the time and hope everybody follows it on the internet because it is a program that is devoted to the future of Hawaii and brings all concerned citizens together to create a better society for all. Hi I'm Marianne Sasaki and I'm here today to tell you about the women's march on Washington on January 21st it's an incredibly significant march in which both men and women are going to stand up for women's rights women's reproductive rights and all the rights we've accrued over the past 40 or 50 years there's also going to be marches in each city on each island there's one in Oahu I urge you to join a march and stand up for women's rights. Ted Ralston here folks hosting our show where the drone leads Think Tech Hawaii on Friday afternoon this is the second half of our show we've installed these really advanced technology teleprompters here in the studio so if I was to read it I might actually read somebody else's script so we'll continue with the unscripted form of this program as long as we can. If you hear me say something like when in a course of human events you'll know we're reading somebody else's script from many years ago. Anyway John Mullen is standing by basically north of Sausalito California John one of our frequent commentators and great knowledge of things that are coming at us in the world of drones and we're talking today about the really complicated future space electronically electromagnetically that is necessary as a accompaniment to drone operations and and this leads to the the protection against drones being misused and the term counter drone which as we're discovering is probably a too broader term so John you were outlining just before the break about how complex this electromagnetic environment is going to be and in the past that electromagnetic environment if it was air traffic it had knowledgeable compliant people involved if it was the airplane side it had knowledgeable compliant people in it with heavily controlled and protected ever since 1927 when RTCA was created to solve problems of radios getting on airplanes but the emerging world of drones doesn't have that framework of control or even that framework of knowledge necessarily behind it we have manufacturers putting things out that are rapidly available and are rapidly emerging in in like software defined radios and things that have a lot of capability that we never saw before so the this infrastructure that we're creating and we're in the middle of in fact making it happen is getting more complex than can be defined even so John you're in that game the cyber game how do we even characterize what this emerging future looks like so we can figure out where the issues are that need to be protected well it does change every day okay so we're late we're day late already we haven't done today's homework yet but I think you're right categorizing when humans go after any complex problem the first thing they try to do is categorize and try to make a model a mental model and then they try to address the components of the model and it's how we learn it's how we do everything and so we have to do here and you know the good news is the FAA and others have done a good job of defining the frequencies and the waveforms and categorizing them I think the bigger issue is being able to identify and enforce any violations and you pointed out earlier that there's going to be either interdiction or conflict or some sort of when you overload a certain area with radio frequencies there's unexpected results sometimes you you know you get somebody else's control but more often than not just nothing works very well and gets scattered and starts to fall apart and that's definitely going to happen but I did I think it's hard to fly a drone I think for everybody it's hard to fly a drone it's hard to fly radio controlled airplanes you know you have to practice a whole lot and you crash a whole lot of times before you get to learn how to do it and but the drones that I've been seeing are many more are autonomous where they you have a screen you just press this button this button this button this button and say fly here then fly here then fly here then for here go there for three minutes at 200 feet go here for seven minutes at 400 feet and you never get on a joystick and I see that's where things are going it's a lot easier and humans like things that are easier it's too complicated to do the other but so I think it's going to get it's going to change you know it's hard to fly and they crash and if you buy a new drone it might last you a week or it might last you a day but if you have these autonomous ones it might last you six months or a year so I think it's going to change quickly that's interesting and of course the autonomy adds that more comprehensive mission I think for a less complicated operation structure but it also in the autonomy domain it diminishes the communications aspect because the thing can be out doing its own mission and there's no communication with the ground station at all except maybe a handshake every 10 minutes or whatever it takes to keep the radios alert and aware of each other the unit itself would be providing its position information down to the ground station so you can track it so you have a one-way down but it certainly the higher the level of autonomy the less communication there is and in some ways I guess that's good in other ways that means it's harder to track yeah it takes it over it can do things you don't want it to do I mean I'll thank you well you know in addition to the malicious aspects just the normal aspects of drone usage are going to require some form of surveillance and tracking and plotting to look at potential interactions and collisions and such NASA has a program called UTM Unmanned Traffic Management and testing has been done over the last couple of years looking at pieces of the solution and recently a fairly comprehensive program was run where a bunch of different drones are run at different parts of the country and it was found out that as long as everything worked everything worked but as soon as there was a disruption to the pattern of any kind either because a guy missed his waypoint the crosswinds were too high and the drone didn't have enough performance to get back on track or in one case an ambient airplane just came flying through and everybody had to go into a protective mode as soon as the nested set of moving dynamic pieces was disrupted there was not enough capability to get back on track and so as soon as there was a least level of technical or procedural variation the whole system kind of collapsed so obviously some frame of complex system modeling or something is going to have to happen here John so that these as the numbers increase and their utility is in different domains and such there's a picture painted in the local area or the broad area that defines what's going on and looks for patterns this is turning into a cyber situation even without contra-grown or malicious effects normal operations are going to require a cyber approach that's true but you see we see the same thing in big airplanes I mean when everything's going well everybody leaves on time and lands on time when there's a big weather pattern or broken equipment or a crew doesn't make it to their thing on time the disruption happens and if it's a big disruption it takes days you know and you're right it gets complicated nobody knows what's supposed to happen and you miss this flight and you miss this connection to this connection to this connection and so it's in both it's in both worlds but I agree with you and I can tell you I've dealt with some of the airlines on these issues and I know you have in different worlds and you know even buying tickets and getting seats at the last minute when there's some available and all of that is they spend a lot of money and a lot of time trying to optimize the profits to stay in business but when a weather thing comes through or other ones come through the disruption happens and all bets are off really you make an interesting point and that analogy is worth exploring the commercial airline business like 12,000 airplanes in the US probably half of them flying at any one time so we're looking at a pattern of 6,000 maybe 8,000 elements in the sky or on the ground that are in operation and with very compliant operators and very structured training and very structured performance and behavior the technical performance climb rate and accelerations and this sort of thing operation with a single mode failure all that's well defined and in fact when there's a missed approach or some other reason that you have to adjust the situation at the airport everybody knows where to go for their holding pattern it's all planned and trained so it's a well structured system dynamic but it's only 5,000 8,000 items at any one time if we look at 5 years and I with drones we'll have 500,000 in the country and none of that pre-existing training and procedures none of that's going to be present there is no nobody cares about it they will start caring when that $3,000 drone you just bought for the power company ends up in the water and you have to alibi to your boss as to what happened to it worse it hits a power line so there is going to be a need to take this analogy that works in manned aircraft and figure out how it's going to expand into the world of unmanned aircraft and admittedly the numbers may be high but the altitudes are going to be low and the range of operation isn't great so we're talking about much smaller domains but we are still aren't talking about potential issues that are going to be harmful that we have to think about it as you mentioned kind of a drone going down into a power plant substation or something like that cause some disruption that has to be corrected so John you or somebody has to figure out how a model this is a big data problem isn't it this is a it's a management control problem you know I've always said this and maybe I'm wrong here but I think the drones have to have internal automatic controls in them to say I can't fly to this spot I can't fly over an airport I can't fly over a freeway and they have to be able to be self enforced and they or if they get too close to another drone I have to be able to like cars like the self driving cars we're trying to do can't crash into it right so I think it has to come from inside the electronics and the avionics of the drones that's interesting so there could be geofencing there could be performance fencing there could be remaining battery time fencing there could be all kinds of different term and limits that could be applied and then when that when that limit is hit the mission has to be over you have to go to a reversion mode of some kind and do it in such a way that you don't harm the rest of the unmanned air traffic that's going on so once again we're talking about basically an industry issue and somewhere RTCA, ASTM somebody has to grab this bull by the horns and start thinking about how we're going to measure it and how we're going to model it and how we're going to establish standards that those who enter the mix are going to have to obey and then this reaches back into the manufacturing and design of drones to make sure they have that capability for handling common mode failure or single mode failure or whatever it may be that we decide it would be cool to do that John you've got the but once again it turns into a cyber problem and that's where you come in because you're solving, identifying and looking at cyber deviations and variations I don't like to over regulate anything but this I mean what else do you do I mean you can't depend upon the pilots to do this themselves it's impossible so they have to be able if you're going to fly this many drones they have to be able to behave behave themselves and so that's there are the electronics you have to put in the sensors the little radar sensors and the avionics controls all that but also you have to make sure that drones coming into the country either with intent or not with intent are compliant which to me again it sounds like over regulation you're going to have to be able to say what are the licenses who owns that drone what's it's unique identifier and you know who do I blame when it crashes and it burns everything and on top of all that when and if something does go wrong we have to be able to get it out of the sky and correct it right now and so John we've outlined a really interesting problem if we could get paid to do this the next couple of years we'd be doing alright so let's figure out how to do that how to stand this problem up and get people to pay attention to it the only way you're going to be able to do it is charge people that are putting the drones in the sky that's where it's going to come from at the end of the day so we hate to end the show with that note so let's make it a positive note the drones are here for good and we just have to make sure they don't wander off in the wrong direction


Realistic Gaming here today. We are in this pooky elevator roblox.  He just took us out in one hit Oh my god, and as we can see they have added the gingerbread man and evil Santa. Oh my god Yeah, they look pretty evil man, right? So hopefully we get those floors because This elevator just bonds them randomly and it takes forever to get the floors. Oh look at the elevator It's all nicely decorated with blood everywhere, and there's some presents in the back Nightmare killers will be released soon. Oh, we're back at the scary school. Where you look at that? Who goes face? Okay, so they just released like three killers out here, man. We got to be careful Jason. Oh my god Look, there's a gingerbread man right there That's hilarious. All right, let's go check out the gym.  They will find us here Okay, nice and survive that round. Oh my god. Okay, so we got a lot of gingerbread man in here We got a Santa Claus It's a pretty cool morse Then we got my boys over here. We got pirate. We got vygio spider-man What's up y'all? Oh, you shouldn't know what did you not buy? What is this guy talking about? Oh? He disappeared what? Dude, you just bought right in our face. That was not chill at all, man Where'd he go? Oh, he's over here not so friendly noob. Yeah, we could tell he's not friendly at all Oh, hey, what's up?  Oh My god, okay, you just got them Yo, what happened here by the way? Like if you get the other floor, it's all nice and put up and everything but that one is like burned down My god, he must have gotten mad because nobody purchased this lemonade, but little does know I actually have it All right We have five seconds to survive. Okay, we'll make this. Oh my god. It's pulling everybody backwards. What? How did we move? That made no sense all the elevators closed great Okay, let's go to the elevator. Oh wait, let's see if there's any new colors They got hever brand Freddy Krueger Samara Jaws SCP-96 Lenderman Sans Chuckie and the classic Chuckie Myles Jack Michael Myers Jason Jeepers Creepers and scream who contact. Oh This is the Stranger Things floor Look the Demogorgon's breaking through right there. Oh, I never noticed that till right now. I look pretty cool. Oh, there he is. Oh My goodness Somebody up at the door. Come on. I want to get out of here.  Well, there's the consequences. Oh my god. Okay, like in the lights save run Yeah, that's what I'm trying to do, but this guy is right on me. My god That was super close. He almost got us Okay, let's go over here My god, that Demogorgon is insane.  Yo Right, let's see if we can get a better look. Oh, you can't As you can see I put eyes on my dominance, which dominance don't have any eyes or face on them.  I'm pretend.  Oh, he has ready-wise Yo, Freddy, you did a chill, bro. We just came here to party and have a good time. Oh My kids lemonade, too Hey, uh-oh Gotta be careful with Freddy. Oh god. That was so close. All right, let's go check out this room.  I used dark co-realistic gene. Let's tell him thanks, man All right, that's what I caught support man. I love that dude. All right, Haddon Field. Oh, it's Jason Michael Myers, I think he's the best killer besides Jason Might be the best two killers down here. Oh my god. There he is. Oh My goodness. All right, let's go over here.  I would be very happy Michael Valdez you Oh, no, okay. I'm sorry. No, he's chasing us great exactly what we needed, right? Leave the poor person. Oh, no, okay. We're in a bit of a pickle here. Let's go around Dude Michael Myers is not playing games out there, man. Oh Sewers Okay, we got Pennywise out. Oh, dude. What's up with the kid are spawning right in front of me all the time It's like I'm cursed. Let's go visit Georgie. How do we get in there with Georgie? I forgot. I think you go here. No Well, I don't think he can go in there with poor Georgie.  He's trapped in there with a missing arm. Oh Man feels so bad for him here. Have a lemonade Georgie Here just get closer. You'll be able to take a sip bro. Come on All right, I think he's so shocked that he can't move a muscle. Oh, I mean he is missing an arm.  I Don't think that is possible, but okay Can we open these presents? No, we cannot the presents are alive restroom Well, I remember this floor from the scary elevator and it was a witch doctor On the plague doctor should I say? But I think he removed it, but here we are and he has cream. Oh My god, I guess cream likes to attack his victims when they're in the toilet When the list vulnerable and unexpected to get attacked Yo, you need to chill out, bro. Oh No, he's stuck in there in the stall Okay, nice. Oh, no, he got hops, right? We need to get out of here when you just get that all back to safety Okay, I believe we're safe here This dude is using the the urinal. Oh My god, all right Hey, this is a bending the English in music, right? I Believe it is. Hey, what's up pirate as we could see pirate is so chill He is the chill man of the elevator.  What you just grabbed us and threw us out in the wild That expects us to find our way back. All right Okay, let's head Slender man. I'm the real dude. Can you say something? Something All right, let's go back in the elevator. Oh My goodness. Wait. Wow. Where are they back in the elevator? I Don't think we need to run out except to find some coins Okay, let's go back this way. Let's go try to hunt down slender man Slender man Where is this guy? Like seven feet tall Okay, we couldn't find them anymore My god, that was so loud Slender man need to chill man. You need some chill milk. Oh My god, it's all like he has a rocket Not this for the random encounter. This is my biggest nightmare because of the giant dodge heads Dude that guy just said I don't have a head out. Oh, okay. There you go The earth is flat. Yes. We don't miss the cow whatever Okay, then he just flew up into other space Okay, oh my god, like this is totally random Okay, no, you are not my leader.   Oh, man. I swear Look at his picture. He's like so cute looking right here. But then when you look at him in the elevator He is a totally different person He is not the same cute doll job that picture man Hey, oh look, there's the handsome man What's up, man? Right. Oh, oh, it's this guy. Okay, so he's angry because double bodies lemonade But hey, look I have your lemonade here, buddy. Okay. Oh, you might want to move from there There he goes Can we throw the lemons back at him? Oh, we can't okay.  You got his grounds again Dude this guy's straight chilling up there.  He's slashing you bro. He goes Rest in peace to my man. Oh, he wants a screenshot Like give me a screenshot or actually come right here. Sure Right there you go man.  Actually that song died out, huh? All right. What is this? Oh, look there's candies everywhere Oh, look there's presents So it seems like Freddy Krueger is in the holiday spirits as well even though he is a massive murderer The snowman's chilling out here Okay, so what do we got in this door? Oh, there's donuts I want donuts Okay, what else is over here? Oh Hey, he was hiding in there. Oh no Freddy's in there Oh, you can hide from here. I'm opening so you can get up Come in here Freddy. No, stop hiding in there He kept closing the door shut trying to hide from Freddy Krueger It's pretty funny Hey, hey slender man. Hey, what happened to your hair? Oh my god No, he's just a bald man. Uh-oh. Oh Jaws Okay, this just be epic Guys watch out We're gonna be under attack by the mighty Jaws Where's he at? Hey, look at this beautiful Ocean We're sailing the beautiful ocean later that night. What what can I see a thing?  That was crazy Hey oof lasagna. Hey. Hey. Hey. Hey, everybody has to get lit to this. I'm at I'm gonna get lit to this oof lasagna. All right. Oh, no, not this floor again. No It's probably just towards those Salting these down here Oh my god, okay, we got this It's pretty easy. Actually you just walk actually never mind. Let me give my coil out Dude, this guy can I jump on his carpet? Give me a ride man Help me out. Okay. We can't jump on his carpet We've got to get the coins Oh my god, that's okay Let's go Okay, we got 10 seconds more to survive this Dude, that thing pulls you in pretty fast Oh my god. Come on. Come on four three two One just take me away Oh Oh, no, all right. Let's see if we get the Santa Claus floor next Because I've been waiting for that floor for like ever it's been like 20 days that I've been waiting for it And it still hasn't come up It's gonna turn me insane man Okay scarecrow. This is not Santa Claus man. Come on. All right, whatever scarecrow is pretty scary too Where's the scarecrow? Oh, I think he spawns here. There's like a devil star and That is so demonic. Oh my god, right. Why you go chase him away. Mr. Scarecrow All right, you guys while this was the spooky elevator roblox if you guys enjoyed the video Make sure to slap the like button Channel make sure to subscribe and turn that notification bell on. Oh, no my god. No Great And I will see you guys in the next one. Bye


Today we're going to be talking about diffusion, osmosis, and water balance. Diffusion is the movement of the solute in solution from an area of high solute concentration to an area of low solute concentration. So, for example, if we have a solution and we dump in some salt, we're going to have a high solute concentration in the corner of the beaker. As time goes by, we're still going to have a relatively high concentration of solute molecules in the corner. But we're also going to have some solute molecules diffusing, moving from an area of high solute concentration to an area of low solute concentration until eventually they reach equilibrium where they're randomly and evenly placed throughout the solution. In this example, we have solute molecules in the extracellular space moving across a cell membrane or lipid bilayer to an area of low solute concentration. So over time, again, we have molecules of solute moving from an area of high concentration to an area of low concentration until we have equivalent solute concentration on both sides of the lipid bilayer. So there are 14 solute molecules on this side of the bilayer and 14 on this side in the same volume, giving them equal concentration. So that's diffusion, whether diffusion happens as it did in these beakers without a membrane or in your cells where diffusion may happen across the lipid bilayer. Diffusion is movement of a solute from an area of high solute concentration to an area of low solute concentration. In contrast, osmosis is the movement of solvent, usually water, across a membrane from an area of high solvent concentration to an area of low solvent concentration. Let's take a look at an example of osmosis. On the right side of the membrane, we have a high concentration of solute molecules and a low concentration of solvent. So since osmosis deals with the movement of solvent, we're going to write down that we have low solvent concentration on that side of the beaker. And on the other side of the membrane represented in red, we have a high solvent concentration and a relatively low solute concentration. So again, we're going to look over time at what happens in osmosis. So we're still going to have the same number of solute molecules on each side of the membrane because the solute molecules are not moving. The solvent is going to move. And so over time, a movement of high solvent concentration to an area of low solvent concentration until they reach an equilibrium. Talking about osmosis, especially as it relates to our cells, we need to know three more definitions. Hypertonic, hypotonic, and isotonic. It's important to remember when we're looking at hypotonic solutions, hypotonic solutions, or isotonic solutions, they are always hypotonic to another environment, hypotonic to another environment, or isotonic to another environment. You always are comparing the solute and solvent concentrations from one solution to the next. So if a solution is hypotonic to a second solution, it has a high solute concentration relative to the other solution. Hypotonic solutions have low solute concentration relative to another solution. And isotonic solutions have equal solute concentrations relative to each other. Tinnicity and osmosis are very important when it comes to cells. In a hypotonic solution, the solute concentration outside of the cell is greater than the solute concentration inside of the cell. So that means that the solvent or water concentration is low outside of the cell and high inside of the cell. So in this case, water is going to flow from high water concentration to low water concentration. In hypotonic solution, water is going to flow out of the cell. In a hypotonic solution, the water concentration outside of the cell is high and the water concentration inside of the cell is low. So we're going to have water flowing from its high concentration to its low concentration. Water is going to flow in to the cell. In isotonic solution, solute concentration and solvent concentration are equal. So it's tempting to say that no water would move across the cell membrane. However, water is always flowing across the cell membrane. It's just going to flow so that the solvent concentration remains equal. It's going to flow in to and out of the cell at the same time. So let's take a look at how that might affect plant cells. So we said in a hypotonic solution, we're going to have water going from an area of high water concentration to an area of low water concentration, leaving the cell. In plant cells, we can see that they have this cell wall and the cell membrane, which surrounds all their cytosol and cytokodin. And so if water leaves a plant cell, that cell membrane pulls away from the cell wall. Let's look at an isotonic solution and see how that affects plant cells. So as we said, water would be entering and exiting the cell. And again, we see that the cell membrane of this plant cell has pulled away a little bit from the cell wall. That leads to a wilted or flaccid looking plant cell. However, if we're in a hypotonic solution, if water is entering the cell, water fills up this vacuole inside the plant cell, and the water pressure pushes the cell membrane against the cell wall, creating a more rigid or healthy appearance for the plant. So for plant cells, the ideal solution is hypotonic. And let's take a quick look at some plants that are either wilted. So we just said plant cells tend to be wilted in an isotonic solution, because there's less water inside of the cell, inside of those vacuoles pushing against the cell wall. So those cells tend to be wilted. Healthy plant cells exist in a hypotonic solution. Hypotonic, again, we said has a lower solute concentration outside of the cell than inside of the cell. So the way to get from an isotonic to a hypotonic solution, that's why if your plants are looking wilted and you water them, you can get a healthier looking plant cell. So plant cells ideally are in hypotonic solutions. But what about animal cells? Let's take a look at what happens to some animal cells. These are red blood cells in different solutions, and determine maybe what's the best for animal cells and whether that's different from plant cells. In a hypotonic solution, we see water leaving red blood cells. This gives these red blood cells sort of shriveled appearance. In an isotonic solution, water is entering and leaving red blood cells in an equivalent rate. They have their typical donut shape. They look pretty healthy. But let's take a look at hypotonic and determine if that might be the best, because that's the best for plant cells, remember. In a hypotonic solution, water is going to enter the red blood cells. So when water enters the red blood cells, they swell up, kind of looking more like balloons. What happens to the balloon when you put too much in it? It bursts. So this is called lysis. Cells are placed in a hypotonic solution, they burst. So obviously, that's not ideal. For our red blood cells and animal cells, an ideal solution is going to be isotonic. So animal cells are a little bit different than plant cells when we're thinking about water balance and tenacity.


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.  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.  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.  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.  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 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.  It was inspired by another hackathon that got started in New York City.  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.  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?  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.  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.  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.  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.  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.  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.  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.  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.  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.  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.  I get asked all the time too, like, are you gonna monetize this or sell it? Like, no, I just made it for me.  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.  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.


We're gonna worship God in a time of giving now and if you would turn to Leviticus 27 The last chapter of this book Leviticus 27 and we'll look at verses 28 to 34 Leviticus 27 verses 28 to 34 Nevertheless, no devoted offering that a man may devote to the Lord of all that he has both Man and beast or of or the field of his possession shall be sold or redeemed Every devoted offering is most holy to the Lord No person under the ban who may become doomed to destruction among men shall be redeemed But shall surely be put to death And all the tithe of the land whether of the seed of the land or of the fruit of the tree is the Lord's It is holy to the Lord If a man wants all at all to redeem any of his tithes He shall add one fifth to it and Concerning the tithe of the herd or the flock of whatever passes under the rod the tenth One shall be holy to the Lord He shall not inquire whether it is good or bad nor shall he exchange it and if he Changes it at all then both it and the one exchanged for it shall be holy It shall not be redeemed These are the commandments which the Lord commanded Moses for the children of Israel on Mount Sinai This final chapter of the book of Leviticus is seems to be an appendix of sorts given how the previous Chapter ends that chapter last verse as these are the statutes and rules and Laws that the Lord God that the Lord made between himself and the people of Israel through Moses on Mount Sinai So this chapter Has a primary focus concerning vows made to God Promises that go above and beyond required Obedience to the laws given in the first 26 chapters. It's kind of a something. We don't think about often and So I want to talk a little more just about this this a concept of vows vows made to God are a special measure of devotion in the heart of a believer who's Experienced a special measure of blessing or grace These vows go beyond what must be done and consider what may be done One commentator said another put it this way It was and is the will of our God that special favors Received at his hand or special influences wrought by his spirit in our hearts Should be marked by optional and exceptional services on our part and our confession actually addresses vows The 1689 there are copies on the shelf. I encourage you to read through it But our confession of faith Says in chapter 23 we read it says a vow Which is not to be made to any creature but to God alone is to be made and performed with all religious care and faithfulness faithfulness but Popish monastic vows of perpetual single life professed poverty and Regular obedience are so far from being degrees of higher perfection That they are superstitious and sinful snares in which no Christian may entangle himself We were talking in essentials about how sometimes we understand right doctrine by looking at wrong doctrine and Popish monastic vows are wrong But so in this chapter of Leviticus, it's all about performing vows with religious care and faithfulness The first 25 verses address vows made regarding the dedication of persons to God Then of clean and unclean animals then houses and lands and we won't get into all the Intricacies of how those were to be fulfilled, but for our purposes We're gonna look particularly well actually if you look in verse 26 We can see that the the writer is making there a point about the firstlings from verse 26 and then in verse 28 those things that are already devoted offerings, which are offerings irrevocably placed in the service of God and then in verse 30 the tithe Which already belongs to the Lord and could not be used to fulfill any vows and That's the point That's the issue here. This passage is affirming that the tithe already belongs to the Lord look at verse 30 again and All the tithe of the land whether of the seed of the land or of the fruit of the tree is the Lord's It is holy to the Lord Pastor Mark Chansky a name many of you know Preach to helpful sermon series on the viticus and he put it this way We must render the tenth of our increase to God not as a voluntary option But as a mandatory obligation Why? Because it's the Lord's it's the Lord's and Not to give the tenth to the Lord is to violate the eighth commandment not to steal so this Isn't always received well even by Some Christians Think when you talk about tithing as being a duty, but we have many duties as Christians Obedience to the laws of God is is the mark of a Christian of one who's been given a new heart One for whom the yoke is easy and the burden is light and so It's helpful to think of tithing in the context of the gospel of What God has given to us? Sinclair Ferguson once described the gospel this way In a presentation about the parable of the prodigal son Ferguson said this and this is at the gospel Everything the father has is yours That's what he offers to you All he has to offer to you is himself his son and His holy spirit and he offers all of that to you before you have done one decent thing in your life Everything the son has he offers to you Fellowship with the father pardon through his death on the cross and the gift of his holy spirit and Everything the holy spirit has The ability as Jesus says to bring into our hearts the father and the son So that the father and the son will come and make their home with us and Domesticate our lives for his glory. It is all yours gloriously generous giving and that means That to be like him we give Especially what it involves giving what is already his Let's pray Father in heaven Help us by your word to have a clear understanding of how we're to worship you in giving and to give joyfully Knowing that your gospel will go forth for your glory by these means amen