CppCast - Azure IoT

Episode Date: June 25, 2020

Rob and Jason are joined by Tara Walker from Microsoft. They first discuss the results of JetBrains C++ ecosystem survey and an article about bugs in Command & Conquer. Then Tara tells Rob and Jas...on all about Azure IoT, including the announcement of a new C++ SDK for embedded MCUs. News The Developer Ecosystem in 2020: How C++ is Doing The Code of the Command & Conquer Game: Bugs From the 90's. Volume one Compile-time Merge Sort [C++] Links Azure SDK for Embedded C Azure IoT Hub Paho TensorFlow Lite for Microcontrollers Sponsors PVS-Studio. Write #cppcast in the message field on the download page and get one month license Read the article "Checking the GCC 10 Compiler with PVS-Studio" covering 10 heroically found errors despite the great number of macros in the GCC code.

Transcript
Discussion (0)
Starting point is 00:00:00 Episode 253 of CppCast with guest Tara Walker recorded June 25th, 2020. Sponsor of this episode of CppCast is the PVS Studio team. The team promotes regular usage of static code analysis and the state of the C++ ecosystem. Then we talk to Tara Walker from Microsoft. Tara tells us all about Azure IoT and announces a new SDK. Welcome to episode 253 of CppCast, the first podcast for C++ developers by C++ developers. I'm your host, Rob Irving, joined by my co-host, Jason Turner. Jason, how are you doing today? I'm okay, Rob. How are you doing?
Starting point is 00:01:21 I'm good. I don't have too much to talk about myself. My state is finally starting to enforce a mask-wearing policy, so that's great. Oh, that's interesting. Yeah. We've, yeah, we're still doing fine here. Things are continuing to open up, and we see the majority of people wearing masks, and we see our numbers staying pretty flat. So whatever it takes at the moment for things to open back up, I'm all right with.
Starting point is 00:01:46 Unfortunately, the South, our numbers have been going up for a while and it's not been great. Hopefully that'll start to turn around. Yeah. Okay. Well, at the top of our episode, I'd like to read a piece of feedback.
Starting point is 00:01:56 We got this email from Jeff saying, I've been listening to the podcast for years. I like the guests and the news items. There's a couple of topics that might work well on the platform. The Blastorok interview is good. It would be nice to hear more about data-oriented design from someone like Mike Acton. There hasn't been much on robotics in a while, and there are good speakers from Roscon.
Starting point is 00:02:16 There have been build system interviews, but nothing on Bazel. It might be good to interview a Bazel user or developer like those at BazelCon. I like the interview about Rosetta. There's probably good info from other developers working on science projects like CERN. In addition, it'd be good to hear more about popular projects like PyTorch, TensorFlow, and Eigen. And finally, it might be good to talk to C developers.
Starting point is 00:02:33 They can either be on the C-SERN's body or working on firmware. It'd be interesting to hear from conservative language users about low-level software and hardware interaction. So thanks so much, Jeff, for the email. Lots of good suggestions here. I did actually already reach out to someone from Google to try to get some contacts for a Bazel developer.
Starting point is 00:02:55 But yeah, I'll have to follow up on some of these other suggestions as well. Well, we'd love to hear your thoughts about the show. You can always reach out to us on Facebook, Twitter, or email us at feedback.speakass.com. And don't forget to leave us a, Twitter, or email us at feedback at spigas.com. And don't forget to leave us a review on iTunes or subscribe on YouTube. Joining us today is Tara Walker. Tara is a principal software engineer on the Azure IoT product group, primarily focused on making services for IoT and Intelligent Edge great on Azure.
Starting point is 00:03:28 While she now primarily focuses on IoT, Tara has additional expertise and interest in serverless artificial intelligence cloud services and mobile development solutions. Over her 20-year career, she has been employed by Amazon Web Services, Turner Broadcasting, Time Warner, Georgia Pacific, and various other Fortune 500 companies. She holds a bachelor's degree from Georgia State University and is currently working on her master's in computer science at Georgia Institute of Technology. Tara, welcome to the show. Thank you. Thank you for having me. It's exciting. I'm curious about something. And I know from what we were talking beforehand here that you still live relatively close to Georgia State and to Georgia Tech, right? I do. Do you keep in touch with your alma mater and what is going on in the computer science
Starting point is 00:04:02 curriculum or whatever back there? What's funny is I don't, not probably as much as I should. What I did do, though, was I'm really big on getting kids and students and other people excited about computer science. So for a little while, I would volunteer at Clark University or Spelman, and I would teach these kind of pseudo classes around just various computer science topics. Another thing that I used to do a lot was during summer, which obviously COVID-19 is hindering this a little bit. There's a lot of summer programs out there for kids. And when I say kids all the way up to high school, and I would just do sessions around,
Starting point is 00:04:42 hey, let's build a game or, hey, let's, you know, tinker with this raspberry pie, right? And, you know, get them excited about the cool world of computer science, because I think it's super cool and what we can build. So I would do things like that, but less around like the curriculum of my automata. I think they think they got it. Who am I to say they don't? So I think that's where that goes. Just out of curiosity, when you're doing those like kids things with like Raspberry Pi, what what programming languages do you use on those? Mainly Python. I'm believing or not the kids pick it up really easily. And what's cool about this is we can also use Node, but raspberry pi has a full educational program like i don't even
Starting point is 00:05:27 have to think about it when it first i first started doing it i really had to sit down i'm like what can i do with them how do i explain you know these languages that are like kind of new or whatever i mean it mostly was them parroting what i would say to do and i would explain why it did what it was um but now you you know, Raspberry Pi and just devices in general have come so, so far since I got into this space that it's really amazing the programs they have. Like, I don't have to think about it anymore. I can go, okay, they have this full educational program and it helps them like explain, you know, if you want to choose this language, how to introduce it to them, how to get things running on the pie.
Starting point is 00:06:06 So they just kind of made my life easy if I wanted to do those kind of things. I had no idea. Yeah. Yeah. Go look. It's a full program. It's pretty cool. You could get you could run your own camp here and then migrate people over to be like, how cool is the C++? Maybe that might be a stretch. I don't know. So, but there you go. Awesome. Okay. Very cool. Well, Tara, we got a couple news articles to discuss, and then we'll start talking more
Starting point is 00:06:34 about what you're doing at Microsoft with Azure. So feel free to comment on these, and then we'll get more into what you've been up to, okay? Okay, cool. All right. So this first article we have is the JetBrains Developer ecosystem in 2020 survey results. And this one's pretty cool. In addition to hearing from JetBrains their thoughts on the server, they actually got Matt Godbolt to comment on some of these as well.
Starting point is 00:06:58 Right, Jason? Yeah, yeah. There's a comment here. We also asked Matt Godbolt, the creator of Compiler Explorer, to comment on the results, which I just thought i just thought you know it's kind of fun yeah so uh what are some of the highlights for you in here i saw one disappointing thing is uh asking what unit testing frameworks do you regularly use and a third of the respondents that they don't write unit tests for c++ that's kind of a little sad terrifying huh yeah uh there's one comment down here from someone says uh if you write good readable code you don't need unit test at all that's just a loss of time can i jump in and
Starting point is 00:07:38 just say out oh no please yes wow yeah um so as far as good news, though, there are lots of people using modern standards of C++. It was only 13% are still using C++98 or C++03. And I'm sure it's still much more than that out in the wild.
Starting point is 00:08:01 But among the respondents, that's pretty good. Almost half are using C++11 and almost half are using C++17 the respondents, that's pretty good. Almost half are using C++11, and almost half are using C++17. Yeah, that's awesome. Anything else you guys wanted to comment on this one? It would be cool for you guys to tell me what's your favorite one to use since they test.
Starting point is 00:08:18 Personally, I use Catch for my unit testing framework. I have been using MS Tests, but recently switched over to google test i don't like google project i work on sad compared to sorry i'm not i think in light of that i'm not going to comment how about that okay uh next thing we have is an article from pbs studio and this is the code of the command and conquer game bugs from the 90s and this is the first of two articles i guess because they found so many bugs when running the code that they had to split it up into uh two articles
Starting point is 00:09:01 and jason you recently also did some uh at Command & Conquer's source code, right? Yeah, last Friday, I did a live stream where we dug into Command & Conquer's source code that was recently released. To be honest, I was largely just trying to follow, you know, the trending YouTube topics to see what would happen if I would get a bunch of views for it. But I also thought it would be fun. And it was and we learned some stuff. But yeah, this article to me is just amazing, because you look at some of these bugs, and you're like, how did the code ever do what it was supposed to do? And the code base is 25 years old, so clearly it does do what they wanted it to do, but how? Yeah, the copy-paste errors are the ones that scare me the most like there's this one method you know mono x and mono y and they copied from mono x into mono y and call it the get x
Starting point is 00:09:55 method they call get x that's clearly wrong yeah they call get x and both how does that work yeah who knows it did something probably some bug that game players rely on and they like oh well if i go in this corner then the enemy can't find me or something that's why a cheat code yeah yeah okay and then last thing we have is pile time merch sort and this one i'll admit was a little over my head jason i'm hoping you can explain what's going on here a bit more uh sure so i the premise of this article he starts out by saying and c++ 20 standard sort along with other standard algorithms becomes constexpr it makes the following code possible and shows that you can just do a constexpr sort. Let's see how to accomplish this with C++17.
Starting point is 00:10:46 Okay. And C++, I need, this, okay. So the author goes through and does a bunch of compile time template magic to do compile time insertion sort. And the code is very complicated and difficult to read and realize on spin A and lots of other things. But I just feel
Starting point is 00:11:06 like i need to point out since i teach classes on constexpr that there's nothing special about c++ 20 that makes constexpr standard sort possible all you have to do is take standard sort and add constexpr to the front of it and you can can do compile-time sorting in C++17. Like, you don't need to go through all of this template stuff. And in fact, I mean, it's an interesting exercise. And if you're interested in template metaprogramming, it's an interesting thing to look at. But if you are actually just wanting a compile-time sorted data structure,
Starting point is 00:11:42 you can easily do that in C++17 by just writing a constexpr algorithm, and you get the exact same result with considerably less headache. That's what I have to say. Okay. That was a different answer. We like it. Yeah, yeah. Okay, so Tara, could you start off by telling us about Azure IoT? I don't think we've ever really talked about IoT on the podcast.
Starting point is 00:12:07 We haven't. We haven't talked about IoT at all, I don't think. Yeah. Oh, wow. Okay. I'm the first. Get us educated. I like being the first.
Starting point is 00:12:14 Okay. So let me ask a quick question before I answer that. Do you think, I mean, I'm hoping your users or your listeners are really excited about IoT. They know what it is. They kind of have some background on it. Would you assume that? Or should I just kind of give a quick blurb of what this whole space is about? I would assume most...
Starting point is 00:12:32 It's probably a mix. Yeah. Okay. Yeah. Go for it. But I'm sure we have plenty of listeners who are familiar with IoT, but plenty of listeners who have never heard of it. Okay.
Starting point is 00:12:40 Well, we'll do the first standard thing, right? IoT, Internet of Things. And I think the one thing that you should pull away from IoT, especially now it's so exciting. One, it's not new. Embedded systems have been around for ages. What we just did with embedded systems is just that. We stuck the Internet on top of it. And now, you know, you've expanded the reach of not only the power of these devices,
Starting point is 00:13:06 but the data and where it can go. So if you just kind of think about it like that, it's super cool. I now can turn my thermostat, even before the Nest, into something that can talk to other things. And so if you think about those kind of things, your refrigerator now can be an IoT device, which I won't say I'm trying to turn mine into one, but just know it's possible even if you don't buy it. And so that's kind of, if you think about the Internet of Things, we have circuits and chips and boards and almost everything. And now we are enabling them to do and talk with other circuits and chips and web and everything else. So that's kind of IoT in a nutshell, the marketing speak. But regarding Azure IoT, think about now we have all these devices, these chips, these SOC systems on chips,
Starting point is 00:13:54 and we've enabled them with the internet. And where do we put all this data? And how do we aggregate all this data? How do we analyze all this data? And how does this data trigger other things? And that's where the cloud comes in, hence Azure IoT. So Azure obviously is the cloud part of it. And IoT, we're getting data from these devices, talking to these devices to and from the cloud, and enabling those devices now to either trigger other things or aggregate data that we can make great decisions. And one big plug, just because I'm really excited about this. Think about that. Now we can also take this data, train models, and now we have AI ML with IoT, which is such a sweet spot right now,
Starting point is 00:14:39 that we can now make predictions with devices so that we can hopefully make good decisions or prevent things from happening. So it's an exciting world in IoT. And C and C++ is, oh my goodness, the embedded world is all about C and C++. So I hope your users kind of take those skills and start to look at the IoT space. I just realized something I don't think we explicitly said at all anywhere and probably worth mentioning, because you said you work for Azure. Azure is Microsoft's cloud product, right? I don't think we actually said that. Ah, okay.
Starting point is 00:15:12 Let me rewind again. All right. So, clouds, yes, I work for Microsoft. Azure is Microsoft's cloud offering. And it has, obviously, various cloud offering, different spaces, different SaaS,, PAS, all the acronyms, services there. And the one obviously I focus on is IoT. So obviously we have things for the rest of those great technology groups. There's serverless, there's ML, there's just, you know, base BNs, there's, you know, name it.
Starting point is 00:15:41 There's cognitive services. I mean, just name it. There's there's bot services. So, you know, typical services you see in a cloud. So that's Azure. And I just happen to work for the cloud space that's focused on the Internet of Things. Yeah, I guess we should have said that. Yeah. I basically know nothing about machine learning just from a very high level theoretical sense. But I'm sitting here going, well, what kinds of things, since you're excited about it, would we try to model on our Internet of Things devices? Are you talking about models running on the devices or models running on the data collected from the devices?
Starting point is 00:16:16 Well, I mean, that's what's super cool right now. We're in a world where we can do both. I think the most exciting thing for me about this world is for the larger end devices. So I'll kind of back up a little bit. So in the Internet of Things, there's two main classes of devices, and I'm just going to be very generic with them. There are what we call MPUs, so the processor units, microprocessor units, and there are MCUs, microcontroller units. My passion is usually around MCUs. Well, I mean, obviously I'm a CC++ person. So, you know, and those smaller devices, you need very small footprints. That's where you mainly use CC++. And that just happens to be
Starting point is 00:16:59 my focus area or the area that I'm most versed in. So there's two classes of devices. MPUs, if you think about it, they are the bigger classes of devices. They possibly can run some flavors of Linux. There are even IoT devices that even run Windows. And so you can probably program on those with a myriad of different languages and various things. What you also can do with those is you can actually, this has been kind of typical, run full models, AI models on those devices. They can do with those is you can actually this is you know been kind of typical run full models ai models on those devices they can do predictive models time series insights whatever you want to do and then either you can have that device based upon that model running on it either retrain if it's big enough like some of the nvidia devices are great about that um or you know get
Starting point is 00:17:41 that data and make various predictions object detection is a great one of those. That is open to do that because typically MPUs are bigger. I mean, you can almost think about your computer these days as an MPU, which it kind of is. But even though we say it's a CPU, but I mean, it's it's MPUs can be pretty big. It's just that. So that's kind of typical. You can do those things. And then you can also take that data and even those predictions, send them out up to the cloud and then get bigger models to be made or, you know, to do various things with the aggregation of devices. So I have one NVIDIA device and let's say everyone in the state of Georgia where I am has one and where you guys are and we're all
Starting point is 00:18:22 sending data based upon sensors or predictions you want to aggregate that maybe start to see some things come out of it of a pattern maybe oh a great work that's going on speaking of covid is people are starting to use devices to get data around covid temperatures and other things that's sensor data and you aggregate that up think about the power of what could happen with that data. So that's one class of device. And like I said, those are the big ones. What I'm excited about, because I love microcontrollers, so it's the little bitty devices that you find, you know, that have like the smaller chips. Like this is a board I have, but this is a SDM- F7. So it has the big LCD and everything else.
Starting point is 00:19:06 And it has all these sensors. But that's not what's cool about this device. And this is a more a little bit more of a powerful one. It is MCU. This whole device, this whole thing is just what we call a PCB. It's just it's just a board that I put various things on it. This whole thing is being run by this little chip here. So that's what I actually program against. And so so obviously if i'm programming against this little chip i need to be very efficient um that's where you know the cc plus plus world really shines and being efficient and that is and so that's when i say i deal with microcontrollers everyone looks at these and it's like oh that's not small but really you're just coding on this little chip. What is the architecture of that?
Starting point is 00:19:46 So this one is what we call a system on chip. This is a 32-bit architecture. You can get as low as 8-bit and 16-bit. Actually, I will reach over here one second and give you another device. And I have devices all around me, so luckily you can't see my messy office. This is a microchip device. I'm going to open up. I'm going to show you my smaller one because if you see all the things hanging off the bigger ones, you don't want people to think that, you know, I'm building something I shouldn't
Starting point is 00:20:14 be building, which I'm not. But, you know, people are more hesitant these days. So this is the, yeah, it's it took me a while to get through airports. I just start packing these things because people were really kind of curious about what I was doing. This is a microchip device. This one that I just bought is a 16-bit one. I have one that's 18-bit. Is that a PIC-16? 16.
Starting point is 00:20:36 This is 16. So this is a microchip one, smaller. That's real tiny. Really tiny. I mean, but here's the funny thing about it even this one is really tiny it's just that we created a board and people create their own boards i'm just not as patient as i used to be with it i have a co-worker you guys should follow pamela cortez she is great about making boards so anytime i'm like hey i need something you know and you can
Starting point is 00:21:02 just get a chip and actually make this board because the power here is not this stuff. It's this one little thing. So you can make a smaller board, which, as you see, has the same size chip relatively. But this is a this one is a 16 bit device. The trick of this is for microcontrollers. That means I have very little space in it. Some of the big ones might have, you know, 10, 24 KB of flash memory. That's all I'm working with. That's it. I might have, you know, some bigger ones that might have, you know, 128 megs of possible RAM and some other things. But you don't get too big in that space. Like, you know, 10, 24 megs of flash memory is pretty hefty right or um and you don't sorry kb can be pretty hefty so not megs kb um for this space so obviously if you're
Starting point is 00:21:56 thinking about building stuff on computers you have all this storage memory and everything else i don't i have to be really efficient for it and then you want these things so this. I don't. I have to be really efficient for it. And then you want these things. So this data, you don't want it just to stay on here, right? I want to get the sensor data and things of this nature that you can attach to these things up either to something that I can aggregate, like I said, if all of us are playing with various things or make some decisions based upon the sensor data I'm coming in. The temperature rose to like, I live in Georgia, so it gets hot. The temperature in the field, I'll make up something rose to 90 degrees, which is totally plausible here.
Starting point is 00:22:33 And I need to turn on the sprinklers to have my crops survive at, you know, 75 degrees. You definitely don't want, especially if it's a big field, someone, you know, sitting by the window going, okay, it's 90 degrees. Let me go turn on the sprinkler. What you would love to happen is that automatically triggers based upon the sensor of the temperature rising or moisture. It's okay, my ground is dry. I should probably water if I want to save things. Agriculture is a great place to think of that or even healthcare. You can think of things that you want automatically to happen based upon sensor data. You know, your temperature spiked at one hundred and three. Maybe I should have the IV give you.
Starting point is 00:23:15 I totally suck at medical stuff, but this is probably not right. But let's pretend I want, you know, beat a pump ibuprofen in you which but again i know my lane i suck at medical stuff so uh you know so that that's that's you know that world there so i focus mainly on mcus and just talking about the size of mpu mcu's really small footprint you have very little flash memory. Think about how efficient you have to be. So this is where the wonderful world of C and C++ comes in that I love to be in. That was more information than you wanted, I'm sure.
Starting point is 00:23:55 No, that's fine. So I am curious, though, that 16-bit microcontroller that you held up, you said that's a microchip device, microchip brand? Microchip brand, right. So this is a STMicro, so STMicroelectronics. I have expressive devices. I have Qualcomm. I mean, I also deal with Raspberry Pis, but here's an interesting thing to know. A Raspberry Pi is not an MCU. It is an MPU. If you think about kind of the generic definition I gave for MPUs, and I'm saying generic because people can be very specific of what those definitions are. So I want to stress that I'm being very generic. But, you know, a Raspberry Pi is really not an MCU.
Starting point is 00:24:35 If you think about the horsepower that a Raspberry Pi has and the operating system it runs, you know, that's not an MPU these devices the ones that I'm talking about run RTOS's real-time operating systems which are mainly kind of task-based algorithms that you know they're not the typical operating system we think about when we think about oh you know our undergrad classes where you had to fight through building an operating system or for people that are dumb like me and go back to grad school and now you have to do efficiencies with operating systems on things. But, you know, they're not typical in that they're really task based. You still have various operating system mechanisms, but you're being really, really efficient and you're kind of switching tasks and paralyzing that way. So these are running our tosses. And obviously, RTOSs have to have really
Starting point is 00:25:25 small footprints. They're, you know, kind of middleware that you would wear, or you would wear, or wear, or you would run. And to, you know, get some of that task-based allocation for some of the horsepower, the applications you're going to run on that. So how does that tiny device actually connect to the Internet of Things? great question um so you typically have either you can add one or these some of these pcb some of these boards uh these prototype boards have them if you're building one from scratch you just add a wi-fi chip okay and so the wi-fi chip is um is pretty much for these boards what's the great thing about these kind of things is usually Wi-Fi chips or sensor chips are common across various boards. Like I'm going to use a LED or
Starting point is 00:26:14 LCD. I'm probably going to use a SS101206. Don't ask me why I know that. That's a typical chip that, you know, that that's a typical driver for this particular sensor so we even consider like lcds and leds sensors and that's a typical driver that is going to run probably on no matter what board you have because these are a lot of these have been normalized a little bit um so you have a typical you know moisture sensor that you go by and it's going to run this common driver and you put it on your board this is why you see a lot of IoT people. We I'm good today. I have no burn fingers, but we solder stuff on a, you know, things on it. If you don't buy a prototype board, they have it. So those so sensors, a Wi-Fi adapter or Wi-Fi chip would just simply be something I would either put on there or I would have on there. And then I have a specific driver that is pretty common that allows
Starting point is 00:27:06 me to put in the SID and I get out to the internet. And then you would probably just build some code to check and make sure you had connectivity before you went on. So those things kind of things are common. So that's how we get to the internet of things. And so you could, if you wanted to be ambitious, you know, take your thermostat down, connect the wires to something else that can, you know, do power. Because all of this Internet of Things are pretty much just circuits. You know, you're sending bits of circuits. You get connected to something that talks to the Internet of a Wi-Fi adapter chip that's associated with it. And you then could start sending bit data to where you want to.
Starting point is 00:27:43 OK. More information than you want it. Okay. Nope, nope. Not at all. Definitely. I want to interrupt the discussion for just a moment to bring you a word from our sponsor, PVS Studio.
Starting point is 00:27:54 The company behind the PVS Studio Static Code Analyzer, which has proven itself in the search for errors, typos, and potential vulnerabilities. The tool supports the analysis of C, C++, C Sharp, and Java code. The PVS Studio Analyzer is not only about diagnostic rules, but also about integration with such systems as SonarCube, Platform.io, Azure DevOps, Travis CI, CircleCI, GitLab CI, CD, Jenkins, Visual Studio, and more. However, the issue still remains,
Starting point is 00:28:22 what can the analyzer do as compared to compilers? Therefore, the PVS Studio team occasionally checks compilers and writes notes about errors found in them. Recently, another article of this type was posted about checking the GCC 10 compiler. You can check out the link in the description of the podcast. Also, follow the link to the PVS Studio download page. When requesting a license, write the hashtag CppCast and receive a trial license not for one week, but for a full month. So, you know, does that mean that there is a SDK to make some of that coding easier to get it into Azure? Absolutely. So I should probably take a step
Starting point is 00:29:00 back and explain a couple of things really quickly, and then I'll get to the SDKs and everything else. So when you start dealing with these little bitty boards, especially if you have people that are not familiar with IoT, this is something too important to note. You have basic communication protocols that you use. So obviously we have the low level networking protocols, you know, your TCP IPs or your UDP,
Starting point is 00:29:20 right? We work with those obviously, but then you have things that are really targeted for very small data package sending very quick, because you've got to think about, I'm sending data, or I'm probably collecting data at these IoT devices at the microsecond level. So in one second, I could possibly send 5,000 to 12,000 messages, right? You're sending a lot, and one second is a lifetime for an iot device and so the way you want to send those things efficient sufficiently there are
Starting point is 00:29:51 various protocols for it the one that is the most popular is mqtt um and it's just if you look at it looks like a really small the payload looks like just a small json payload which is considered nodes but it's based upon tcpip and this protocol is um one that is what am i trying to say one that i can easily send very small uh packets of data across the wire uh to to talk with these various things what also is about the protocol? And I won't get into it completely because that would be I would be fully talking about it is these notes can mean something. So there are wild cards with the nodes there. There are you can use hierarchical nodes, but it's really designed as a communication protocol for the IOT space. So you can get a bunch of data in around sensors, you know, to various places.
Starting point is 00:30:50 OK, so I got that. So now you can talking about how you develop against this and send data. I can use open source stuff to just do pure MQTT talking back and forth. One popular open source library for this is Paho. Paho has open source library for embedded SDK for C, C++, and other languages as well. So I could, if I just wanted to talk pure MQTT, there's other protocols, but I'm just going to talk about the most popular one. If I wanted to talk pure MQTT to any cloud, including Azure. I want you to come to Azure. I could take a PAHO SDK or just a base level MQTT library. I'm just using PAHO because it's one of the more popular open source ones. And then just send this payload by doing low level connections. I'm going to say, hey, I want this IP address or this typical TCP IP. I'm going to connect. I want to get a connection back, an ACK back that says that I'm connected. So MQTT does the typical CONNECT, ACK backs.
Starting point is 00:31:54 And now I'm connected, and now I want to send this payload. All right, so that's just base level. I want to get the data to the cloud. I can use all of the myriad of MQTT, either libraries or SDKs that are out there, open source. For Azure SDK, we want to make that easy also for you to get to Azure. So we have an Azure SDK specifically, Azure IoT SDK specifically for people that are coding in C, C++. Now I know we're on a C++ call, but I don't want to leave out the C people because I want them to know we have one for both. Right. I will not be biased.
Starting point is 00:32:30 So, you know, you can you can do both. And that will help you, you know, establish a connection, a secure connection to Azure IoT. You can establish that connection using certs. So X509 certs, ECC certs, or with our own connection string. Obviously, there are varied and myriad of security ramifications for using one of those three options. So, you know, you can use certs or use our connection string. So we make that easier for you by using our SDK because obviously we know how to talk Azure. So yes, you do have an SDK that you can send. And SDKs, our SDK then does things like, hey, I just want to send telemetry. So when you're just sending data or getting data back and forth from the cloud for IoT spaces, that's called telemetry.
Starting point is 00:33:15 OK, when I want to send commands back and forth, that's I may want to send commands based upon telemetry. But typically when I want you to act upon something, either I want to send data from the device to act upon something or more than likely, I want to take data that maybe is aggregated from a device or from anywhere and then have the device do something. I wanted to turn the pipes or open the pipes because the dam is going to burst. I don't know. That's morbid. Release the pressure from the dam. So turn this on. And I so I want to send commands. So there's commanding things that are there to that. So we have SDK that knows how to talk Azure that is out today that you can talk around any kind of devices. So whether you're using the MPUs, the Raspberry Pis, the NVIDIAs, the others of the world, or you're in the MCU space like me, and you want to use the SDMs, the Qualcoms, the Expressives,
Starting point is 00:34:16 you know, those kind of devices, the microchips of the world there. So we have that. That's SDK that runs on the device, just to make sure I'm fully following here, right? Correct. So another thing that I should mention, you have usually with IoT devices, you have data plane and control planes, right? And based upon what you're doing, there's obviously an SDK that runs on the device, but there's also an SDK. And, you know, and when you see our big SDK, you determine that I maybe want to run. I have my phone and I've done this a lot and I want to control my device.
Starting point is 00:34:58 I have videos on this where I want to control my device with my phone, even though a phone can also be a device. But let's just pretend it's just a phone. So I want to control my IoT device with my phone. So I actually have, you have SDKs where you have mobile SDKs that has IoT features that I want to actually send an MQTT packet to my device from my phone and control it from there. A great example of this would be, think about some of the tools you build here, like iRobot, right? You want this robot to do stuff. Usually when you set it up, you grab your phone. It has an app and that app is then can either control the device or, you know, allocate, you know, how it's going to talk to the internet and things of that nature. So you have these two planes that we say there's a control plane and a data plane. And I want to control the device and I may do that on something that's not the device. That's really important.
Starting point is 00:35:48 And I might have a Web site that I want to trigger various things to happen with my device from the Web or a command center. If I'm someplace where, again, back to the damn example, I don't want to flood a town. I want to control something there. So you have the SDK that you have that are out there. You can have IoT SDKs that are targeted toward mobile and you can have IoT SDKs that are targeted towards device. In my space, I kind of work primarily or using, leveraging, testing, et cetera, SDKs that are work on the device. But I would be remiss if I didn't talk about the fact that you have SDKs that allow you to talk to the device that are not on that platform. Okay. Oh, so we're talking about SDKs. So I just got good news that I can actually talk about.
Starting point is 00:36:36 We have a new embedded. So there's the SDK that's out today.. I'm going to look down because I got the link to it because I want to share it. We have SDK that's out today, but we have a new SDK that is coming in the fall. And I just got great news that is officially on public preview. And let me share the link. So I'm gonna look down and give it to you. So you can we have a new embedded IET SDK that's coming out. And for someone like me that's in the MCU space, this is huge. And I guess I'll explain why. I'm so excited about it. Yes. So we talked about the architecture of MCUs. They're 8-bit, they're 16-bit, they're 30-bits.
Starting point is 00:37:22 And think about how small the footprint is from a flash storage space, just RAM, really small. But MCUs, there are billions, and I do mean billions, so go look it up, billions of MCUs out there. There are less MPUs. There's lots of MPUs. But when you talk about the sheer magnitude of the IoT space world, there are billions of microcontrollers out there. And that billions is exponentially going to grow. So if you look about anything about the Internet of Things, that small space is huge. So obviously you want to take advantage of that small space and get as much data to and from as possible and leverage this. But if you think about an embedded SDK, that means it has to be super small. So the SDK we had out originally is great and it's lovely and divine, but it wasn't just for embedded devices.
Starting point is 00:38:15 Right. It's for, you know, you can either run it on your MPU. And then we had a lower level as a part of it that you run on your MCUs. But it wasn't just for embedded devices. We're now having one come out. It's in public preview that is just for embedded devices like my little device here where it's going to optimize the smaller footprint. It's still going to have TLS. So you're still going to have the security as a part of it.
Starting point is 00:38:41 It's going to talk MQTT. So that's why I explained MQTT earlier. I'm going to give you the links. I'm looking down so I can give it to you. You can access because it is in public preview now. You can access it at aka.ms embeddedcsdk.
Starting point is 00:38:58 Obviously, it has both for C and C++. It's really just targeted for microcontrollers, my space that I love. So it's going to be very limited on the space it takes up. Because you think about it, if I only have 10, 24, you know, the SDK has to run in that space. If I'm running an RTOS, it has to run in the rest of the space. And then your app has to run in a space. You have to be very efficient about your memory. You know, I have my, and you actually have to allocate okay for the linker
Starting point is 00:39:26 i'm going to put all my static variables here and blah blah blah all that stuff so you actually go ahead you're saying when you're writing for these devices you really have to optimize the space you're optimizing the linker script as well yes i mean depending on the device it's funny i just finished and i can talk about this new cmake tool I'm working on, I'm excited about. I literally for different devices, you have different linkers that you have to optimize for. Now, if you're lucky, you know, some of the vendors will provide you with some base level linker scripts for that device. And sometimes you're not. You're building them yourself unless you happen to find someone who did the heavy lifting for you out on the wonderful web. But sometimes you're you're doing it yourself. When you're talking about IOT devices, you're you're at you're kind of getting really, really close to the metal on all aspects. How memory is allocated, whether this will be static or dynamic, you know, you're really getting down to it. Because remember, these little devices here, you know, you're not giving a lot of room for error.
Starting point is 00:40:29 I'll say it. Right. So, yeah, you like the tool that there's some patterns for certain devices about how you optimize linkers. But if you're lucky, you know, some of the big ones give you, oh, here's the linker for this device. We have Microsoft has a device called the sphere. It's a microcontroller that's supposed to be super secure. Starbucks is using it. So it's a really secure one. So for that one, you know, we have a linker script. But for instance, a co-worker out in the UK and I got to shout him out. I love Paul. Hi, Paul. We were working on a project that we wanted to put TensorFlow Lite Micro on the sphere. And we needed to do some updates with the linker to make that efficient. So you kind of work in that space. But the embedded C SDK that's out right now, I mean, out right now, the SDK we have right now, it's not targeted
Starting point is 00:41:20 just for MCUs. The one that the link I just gave you is going to be targeted for that. So you're going to have things like really small footprint of the SDK. You want that on an MCU because really, I want the SDK to get out of my way. I want the RTOS to get out of the way. I want to write my app. The app is where the power is. This is where I'm getting my telemetry. This is where I'm controlling things. This is where I can get data that I can build models or do predictive analysis against. That's the power, the horsepower of the IoT while you're building these things on these tiny chips that can go anywhere. So you don't want your firmware or your SDK to get, or not your firmware, your middleware is really what RTOS is. You don't want that to get in the way. You want it to help you and then get out the way. So that's why when you're building an SDK for these kind of devices, they need to really have low footprint.
Starting point is 00:42:16 They need to be really efficient. They need to, you know, memory needs to be managed appropriately. So they help you without getting in the way. So according to this, just wanted to make sure that I got the time frame. We're looking to go G.A. this fall. So this is a I'm this is a part of the Azure IOT PG that I work on. It's this SDK team. So that's why I would ping them is like, can I share stuff? And, you know, I got stuff back that I can. And that link is public that you can check out. We'll be sure to put in the show notes for sure for the listeners, too. Yeah. Yeah, absolutely.
Starting point is 00:42:54 The last thing I'll say about the SDK is what's cool about it is you can use it in existing projects. You can use it with tool sets that are targeted for devices. So like if you use IAR or Kiel or those kinds of things, it's targeted for it. I'm a GCC ARM Visual Studio Code person. So I'm more, I guess, more command line, which is funny because that's just kind of where my life is. So if you are a GCC ARM person using CMake or Make, this is also perfect for you. So it covers the world, whether you're using one of the more advanced IDEs that has their own compiler, or you're like me that loves the GCC ARM world and you're just going to command line it. It works for both.
Starting point is 00:43:43 So you use VS Code for all the editing but then when it goes to the time to actually transfer stuff to the device then are you dropping out of the command line or does vs code have support for that also so v and you can actually do the command line and all that in vs code okay the reason why i go out is because that's just kind of i live you know that's my world but absolutely you can do you can my world. But absolutely, you can do, you can set up, you know, your build in VS Code, like you want to trigger a build and it goes against a Linux system or if you're running a Linux and it builds on that, you can absolutely set that up in Visual Studio Code. For me, I usually, I want to go out in the command line because I'm doing different
Starting point is 00:44:17 things. But you absolutely can do it from VS Code. So I use my own personal thing. I mainly use VS Code for editing. And then once I, you know, get the code edited, I'll go out in the command line and, you know, either run CMake or make based upon the tool chain I'm using. Like I said, I use the ones I like the most are GCC ARM and Extenza. Extenza is mainly used by cadence devices or either expressive devices for their tool chain. So those are the ones I like the most, but there are plenty of tool chains out there. Don't let me bias you. Those are just my favorites. Please, if I did not mention your favorite one, use what you feel is best. So I usually just drop out to the command line and do things like that
Starting point is 00:45:02 nature. But of course, even with the IDEs I noted, like IAR, you can absolutely use just a basic CMake file with IAR as well versus using their compiler if you want to use that. So just, I know that gets suggested to use what's best for you. What I've been working on, which is not really a secret, it really is something I, just a passion project that I kind of demoed yesterday. Well, not a passion project. It's something that will help is around using CMake to dynamically build across boards. And that's, I'm having a ball with this. So if you're not familiar with IOT, and I talked about the tool chains, the reason why I like GC arms tool chain. So is because they have created a level of standards that, you know, most boards, each of these boards are different. Like Microchip has, you know, different architectures. There's the PIC architecture.
Starting point is 00:45:53 There's obviously the Cortex-M architecture that is familiar with ARMS. There are various architectures there. So you might build these differently. And there's different drivers. And let me talk about what drivers are. So when you talk about a board and I'll keep this as high level as possible it's not just you can go low level that's fine okay okay when you're building on a board there's some considerations you have to do not just your app which would be lovely if that was the only thing you have to consider you know not only the drivers of your sensors, but
Starting point is 00:46:25 what is my hardware extraction? So if you know anything about IoT, there are some different things I have to consider. ADC, analog digital converter. Okay, so I maybe have been getting an analog signal in that I need to be converted to digital. Well, typical, there are components that are on these boards that are ADCs, analog digital converters. Right. There are GPIO. So I, you know, general purpose IOPs. So I'm just going to get a current in and I need to transfer this current to mean something. For instance, let's say I have a the temperature sensor. Why does everybody use temperature? I got to find another one to use, I think, because everybody can relate with temperature going up and down. But let's say I have a temperature sensor. I am going to connect that possibly to a gpio pin that's literally just going to take that current and
Starting point is 00:47:09 the driver will convert that current that you're getting into something that now can be translated into a temperature so that you have general purpose pins um you have uart so I want to plug my device into my computer, take this binary that I created and download it onto the board in a way that now the board can run it. And I need a connection to do that over possible USB and things of that nature. So I may have UART. There's a bunch of them. Like, I could go all day with all the different components that are on the board. You can either talk directly on that board doing that. There's low level opportunity to do that. You can even get down to the assembly level to do that if you wanted to, by the way. And I won't have time, but assembly is a big part of this, too. You can take advantage of some assembly features and more than likely you will.
Starting point is 00:47:59 But let's say you just want to for SDM, for instance, this chip has, you know, these hardware components as well as, you know, possibly a hardware abstraction layer, unless you're writing directly with assembly. And you, of course, can that I want to use that's targeted for SDM devices. You know, so I you have to know which how hardware abstraction layer is for which board. Let me see if I have this other board right here. I do. So this board here that's connected to my other computer is also a stand board, right? Different chipset here. This one is the M4, Cortex M4. This is the Cortex M7. Obviously, different boards, different architectures, different RAM, different considerations.
Starting point is 00:48:50 I'm even going to compile these completely different. My flag stick of polities are completely different. Completely. I also have different handles for these. I also have different VSPs or board components that these support and they support them differently. You have to know. Right. Let's just go with the using GCC arm because to me, I feel like that's a normal normalized one because I can use that with these as well. I have to know that if I'm using a HAL, SDM is great. Well, they have SDM. They have SDM cube that gives you a HAL.
Starting point is 00:49:25 But I have to know the HAL that goes with this one. It's not the same one that goes with this one. Right. Right. So you're building on boards. You have to know what hardware extraction layer that you're going to use for this. You also have to know, you know, what board components are a part of it. And you can just say, hey, I want all of them or I just want this to enable GPIO in ADC.
Starting point is 00:49:44 Maybe. Right. Or I want to light up all of them. Well, want this to enable GPIO in ADC, maybe. Right. Or I want to light up all of them. Well, how do you know which ones this supports? So I need to know what how to use. I need to know what BSP to use. I need to know or I need to build the appropriate linker for it. So there's a lot of aspects of IOT that this is even before you get to the wonderful world of the cloud, you to build and do these devices. What I've been working on is there was a tool that I still use and I love the open source tools specifically just for esteemed devices and using CMake. And that's just for these devices. And it's fantastic because you put in the chip name.
Starting point is 00:50:24 This one is a L4 5 VG. Don't ask me why I know that. So that's that's this chip. And that's different from this chip's chip name or chip family. So this is in the L4 family and then it's specifically a L4 7 5 VG chip. I can put that in and this tool will then go out and find the HAL, the BSP, the, you know, the standard ARM libraries that go with that. In addition, it will go and build the linker for me based upon that's the 1024 flash memory 128 chip. This one is RAM. It'll go and do all that for me and then if people have done a great job even with the open source of this tool where depending on what rtos you want you know you want free rtos you want whatever it's there so i have to talk about azure rtos in a minute
Starting point is 00:51:17 and i you know it's i can go out and do that and so now that will either give me an l file a hex file or a bin file what are those those are the binaries that run on various devices so okay you know when you get to the binary level you're building one of those three or all three depending on what you're doing so i you know because i can have an l file that then i'm gonna optimize and i might run a thing before i get it to a bin to the binary for it so anyway so i um you know, it'll do that for you. So I was like, this is so cool. I've been using that for probably about five years. So shout out to that open source project. And I was like, okay, now we have released if you guys are not aware of, you know, an IoT world, that middleware that you run on these devices that does that operating, that real-time operating system,
Starting point is 00:52:11 there are various ones out there. We have released one for Azure. We acquired ThreadX, which is a very efficient RTOS that actually runs a lot of the world's commercial devices. Your printers of the world and things like that are running on ThreadX. And most people probably don't know that because no one cares about RTOSs but geeks like me. But so this is a very powerful operating system, and we acquired them. And now we have it, our Azure RTOS, so this powerful RTOS that we use. There's other RTOSs out there, just to make sure everyone knows. There's FreeRTOS. Should I say this?
Starting point is 00:52:44 I love Free free RTOS. I should I say this? I love free RTOS. I saw that, you know, and I and Amazon, I know, bought. Well, didn't buy. They created a version of free RTOS. I know Richard Berry, the creator of free RTOS, you know, works there as well. So there are different RTOS. There's Zephyr that's coming out from the Linux Foundation, which is RTOS. So there's various RTOS out there that that middleware that you wear. We have which is the RTOS. So there's various RTOSs out there that middleware that you wear. We have one, it's Azure RTOS. We're very proud of it. Very efficient, very low footprint, very secure, has a ton of certifications. MISRA is one of them that, you know, is a part, is associated with this RTOS. So we just went GA on that in May and in the virtual build because we couldn't do real build. And so what I thought back to the CMake thing was how cool would it be not only to take this open source tool,
Starting point is 00:53:34 but to build a tool that a CMake tool that would not only determine all the various parts for SDM, but what if you could do it across devices, device vendors? So the microchips, the Qualcomm's, the, you know, the NXPs of the world, another vendor, famous, popular Silicon vendor. And, you know, that would be huge because that would take so much heavy lifting out of us as device developers. But then what if I could take this tool and have it put, you know, the Azure R toss on it for you. And so now I just took out a lot of the heavy lifting and then you could focus on your application. So let's say I just could give it, here's my application. Here's my basic CMake file, you know, that I want. Here's my basic, you know, just my CMake list, just not anything special. And I just need to have, like, one
Starting point is 00:54:26 thing in there that says, find this package, run it against this tool, this CMake tool. Like, I have various custom flags. And then it does all of that heavy lifting for me, using GCCR. So I'm kind of working on my site about it. And it'll add, you know, Azure RTOS in there for you.
Starting point is 00:54:42 It'll, you know, find the appropriate things for the boards, whether, you know, find the appropriate things for the boards, whether, you know, I pass in that this is microchip and this is the family or I pass in this is microchip and this is a particular chip versus this is SDM. It's a huge project. So but it's going pretty well so far. And it just trying to see if I can how much of the heavy lifting I can take out of not only across board devices, because there's nothing like that that exists out there, so maybe I shouldn't be saying this. I don't know. So someone's going to be like, hmm, can I do this faster?
Starting point is 00:55:11 So, you know, but also to put Azure RTOS onto those boards for you, that firmware on there for you, so now you're already raring to go with a very task-efficient, multitasking RTOS for your IoT devices. So that's something that I've been having fun with. Is that currently like a – It sounds really useful. Is that on GitHub or something?
Starting point is 00:55:32 Not yet. I literally just kind of did the first prototype to my team yesterday. So it is on GitHub, but it's private. I will be – depending on on i'll just say this depending on what we do i would i'm hoping that um not only will i release it on github this is hope so this is hope but also that uh you know maybe it could be open source i don't know it's right now it's just so early on and it's just where i'm excited about uh some of the things I'm doing that I can just say I'm hoping that it'll grow somewhere that I can share it or that I can make it open source so people can contribute to it. It's because it's a lot of work. The guys, if you look at the STMicro CMake tool, has a lot of open source people, open people contribute to open source.
Starting point is 00:56:23 It's a very powerful tool. So I can't say I was a rocket scientist. I thought of this. I literally am just taking an idea that works really well and expanding it to hopefully make it easier for developers. So my my goal, my hope is that I can do this. And even if we don't just adopt this internally or just, you know, do something with it from a Microsoft world. Maybe I can release the open source and get all of you wonderful C, C++ people to help me. So anyway, that's that. So I wanted the two things I'm really excited about right now. We have Azure RTOS. I love RTOS. That's, you know, in the microcontroller world. Would love you guys to check it out. It just went how we have samples out there for it. The next thing is, you know, the embedded SDK, CC++ SDK that is in public preview, gave you guys a link to it.
Starting point is 00:57:12 And that's kind of the world that I'm in right now. And the last thing is, and I kind of alluded to this, that I think is very exciting. And I think this taking the world by storm is TensorFlow Lite Micro, which is not a typical thing to talk about if you think I'm a Microsoft person. But it is a fantastic thing that's out. And the reason why this is so powerful back to microcontrollers, obviously on Linux, I can run normal TensorFlow. I can run, you know, Keras. I can you know, I can run all these, you know, typical machine learning frameworks. Right. But think about how small I just said this system on chip is. That's what he is. Right. Yeah. How do you get a model on here? Right. Kind of like, can you do that? Not really. If you think about how big models are, but what tends to flow like micro has done.
Starting point is 00:58:02 Shout out to Pete Warren and their crew over there. He's the guy I follow that really introduced me to this, and I just got super passionate about it. You might hear it called TinyML. The actual technology is called TensorFlow Lite Micro. The TinyML book is the book that Pete and Daniel wrote, and I find that more people for some reason call it TinyML. So whatever floats your boat there. Where they've now enabled AI for microcontrollers. I mean, that's super. That's that's my other thing. I'm having so much fun working on the fact that now I can put an AI model on these chips to do various machine learning algorithms without really reducing the accuracy.
Starting point is 00:58:52 I mean, think about how phenomenal that is. And so that's another thing I'm kind of just a passion thing I'm working on that I want to make sure things like, you know, you can do that easily with Azure and, you know, send data back and forth and trigger from these things to get that predictive maintenance or to aggregate data up. So, I mean, it's an exciting world. Maybe I'm really geeky right now, but it's an exciting world. And I see there's so much you can do and your listeners are C and C plus plus people. And so especially if you're a microcontroller focus or you like microcontrollers like i do this is like a perfect world for you because you're gonna live in you know building things with efficiency and c++ code so um it's it's a great world to be in if you if you love that you can love the c++ language so yeah i really don't think you have to worry about being too geeky on a C++ podcast. I just kind of heard myself and I was like, I'm awfully excited about stuff.
Starting point is 00:59:51 It's like super like nerdy right now. And I was like, okay, hopefully I'm not. This is the best place to do that. Yeah, it does all sound really exciting. It's super fun. I hope that your listeners will. They haven't kind of dived into the world of IoT. Their skill set is perfect for this.
Starting point is 01:00:12 And I don't know, the first time you build something and, you know, your garage goes up or, you know, you get the trigger, some things happening with it. I think you're gonna get hooked and like i said if you're in the space where you know you love csc plus plus especially you know these languages you're like this is gonna be like your own heavenly playground of what you can do with these little gadgets that you never thought you could do before um another space that is really cool that i haven't gotten to yet that i want to want to is robotics runs on a lot of microcontrollers. There is Ross out there, the typical Ross out there. And so another place where it's really cool, where your your your listeners hopefully can tag into is, you know, think about these little chips drive so much, including robots. So next thing, you know, next thing you know, you can build on these various microcontrollers
Starting point is 01:01:10 using things like ROS and other things out there and you're building robots to do cool things. So, I mean, there's so much out there. These microcontrollers or these devices, whether it's an NPU or microcontrollers, are in everything we do. Your cars, how your cars get manufactured, the way, you know, you look at your telephone. I mean, think about the devices we have in our house that we talk to using, you know, voice recognition and other things. Those are all driven off of these chips.
Starting point is 01:01:38 So the world is just kind of opened up to us, especially if you're in the C++ world for IoT. It's just a great place to be. Excellent. Okay. Well, it's been great having you on the show today, Tara. Thanks so much for bringing all this to our listeners. Like I said, we've never talked about IoT before, and it sounds like it's a very exciting space.
Starting point is 01:02:00 No, thank you for having me. Thanks for coming. Thanks. Thanks so much for listening in as we chat about C++. We'd love to hear what you think of the podcast. Please let us know if we're discussing the stuff you're interested in, or if you have a suggestion for a topic, we'd love to hear about that too. You can email all your thoughts to feedback at cppcast.com.
Starting point is 01:02:19 We'd also appreciate if you can like CppCast on Facebook and follow CppCast on Twitter. You can also follow me at Rob W. Irving and Jason at Lefticus on Twitter. We'd also like to thank all our patrons who help support the show through Patreon. If you'd like to support us on Patreon, you can do so at patreon.com slash CppCast. And of course, you can find all that info and the show notes on the podcast website at cppcast.com. Theme music for this episode was provided by podcastthemes.com.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.