Monitor performance issues & errors in your code

#272: No IoT things in hand? Simulate them with Device Simulator Express Transcript

Recorded on Thursday, Jul 2, 2020.

00:00 Thought is one of the primary languages for IoT devices with runtimes, such as circuit Python and micro Python. They're ideal for really small IoT chips. Maybe you've heard of the circuit playground Express, BBC Micro bit, or the fancy Adafruit clue. They aren't too expensive ranging from 25 to $50 each, but for large groups such as classrooms, this can still be a lot of money. Moreover, getting your hands on these devices can sometimes be tricky as well as they often go out of stock. With an extension for VS Code called device simulator Express, you can have instant access to all three, virtually Of course, this cool extension adds a visual emulator as well as the native interactions such as buttons and temperature sensors. Get your IoT on without a real device using VS Code today. Let's meet the most recent team behind this project. Andrea ma seda Moosa, Vandy Lee and Kevin Nolan. This is talk Python to me Episode 272, recorded July 2 2020.

01:10 Welcome to talk Python to me, a weekly podcast on Python, the language, the libraries, the ecosystem in the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm at m Kennedy. Keep up with the show and listen to past episodes at talk python.fm and follow the show on Twitter via at talk Python. This episode is brought to you by linode and Talk Python Training. Be sure to check out what the offers are for both of these segments. It really helps support the show. Speaking of Talk Python Training, have you been thinking about taking one of our courses, we're participating in the latest Humble Bundle deal for Python developers along with a bunch of other great educators and tool developers until July 22, you can get $1,400 worth of Python goodies, including three of our popular courses for just $25 Yeah, humble bundles are crazy. That's $25 for our three courses, and all those other things combined. Just visit talk python.fm slash humble 2020 at talk python.fm slash humble 2020 all together before July 22 to take advantage of this offer. Now let's get to that interview. Hi Saida. Andrea, Kevin Vandy. Welcome all to talk Python to me. Thanks for having us. Thank you for having us. Yeah, it's great to have you all here. It's gonna be fun with five people in this conversation. And we got a really cool topic to talk about. Micro Python and circuit Python is really big these days. And I think it's opening up a new realm of programming and what you all have done, and the project you're working on is going to be really excellent for helping people around the world. take better advantage of that, I think, awesome. Yeah. Like, we were hoping to kind of like make learning Python and learning like IoT a lot more like accessible and available to people around the world. So yeah, we'll get more into that a bit later. Yeah, absolutely. I mean, getting hold of these devices, they're not very expensive. But they can be hard to get ahold of. And if you know, you're talking about a classroom with 100 kids, then all of a sudden, it is expensive, right? Or a school with different classes and so on. But before we get to all that, which is gonna be really fun to talk about. Let's just do quick introductions around here. Andrew, do you want to start first? Yeah. So of course, my name is Andrea. I'm currently a student at the University of British Columbia. I'm studying computer engineering. I'm originally from the Canadian prairies. And but I came here for school. And yeah, right now, I'm still an intern at Microsoft, interning with the coalition, which makes Gears of War. And yeah, I guess like, I'm currently just go. I'm currently just interning at different places to kind of get a grasp of what I want to do in the future. Well, those sounds like some really fun areas to get some experience in Actually, yeah, it's like, it's really fun to just kind of like get different perspectives. I mean, every time I go to new internship, it's just like, a whole bunch of new stuff. And I learned a lot, which is awesome. Awesome. Yeah. See that? How about you? Yeah. So my name is Dana. I'm a undergraduate student at sfsu. I'm studying data science right now. And I was a pm intern at Microsoft last semester. Yeah. And most of my coursework, revolves around data analysis, and he designs business. And I have a little bit of background in design as well. So yeah, I think after my internship at Microsoft, my passion for pm has increased and hopefully my full time career will be in that as well. Yeah, it's cool. Yeah, it sounds like you're studying a lot of neat technical areas as well. Yeah. VND have a daddy. I'm a third year computer science student at the University of British Columbia. And currently, after finishing the Microsoft garage internship, I'm, I'm interning at Splunk on the machine learning team right now. Oh, yeah. Cool. Check it out. Getting into all the logs and all that good stuff. Yeah. Right on it. Kevin. Are you Hi everyone. My name is Kevin. I'm from Montreal, and I'm sitting at pretty influential

05:00 So just like the others, I'm interning at various places like Microsoft. I'm currently interning at AWS working on cloud technologies, which I find very interesting. And yeah, pretty much it. I love software engineering. That's why I gone to the field. And I'm very excited today to share about our one of our most fascinating culture. It's super fascinating. But before we get to that, so you you did this internship at Microsoft, and you're, you're doing an internship at AWS? Yeah, well, I'm not at the same time. Like I'm doing one. Oh, no, I know what one into the other. But that's still like, I was just gonna say, that's a really cool experience to have before you've even graduated. That's a lot of a lot of background you're picking up there. It definitely is, like, I'm pretty lean quite a lot of both places. Yeah. I mean, they're both very different. But right, those are two of the tech giants. So quite cool. Now, you'd mentioned several of you the the garage projects at Microsoft. And I know, you all had this interrelationship with Microsoft. And who knows, maybe you'll go back and work there as well. Afterwards, but just what is this garage thing? I've never heard of this. So Oh, sorry.

06:05 Oh, okay. Yeah, so the garage program is pretty much so unlike a regular internship, where you jump into an existing project, a garage internship encourages, like the interns to group up and start and finish a project, kind of, in our case, we continued on existing garage project, but it's just mostly focused on interns kind of leading their own projects. So instead of working on like, yeah, we're gonna add that other button to excel. You guys get to create something new and original, and see what direction you could take it right. Yeah, I mean, the ideas itself are backed by sponsors. So in our case, our sponsor was the VS Code Python team. So the ideas aren't just thought out by us, but like, we're given kind of the ideas and support are from like people, actually, from Microsoft in the industry. So it really fosters kind of this startup mindset, kind of, but I feel like we're also given like a lot of support from the coaches that they give us. And just like, overall, the people in garage, anyone want to add to me looking at weighing down at the other internships I've seen, this one is more intensive, you actually see the whole full product lifecycle from start to finish. And there's a lot of, you know, uncertainty when we're actually dealing with what we should do next. And I think the garage program gives us that liberty to make those decisions and kind of figure it out on our own. If you have any questions you can ask them. But it gives us a lot of space to kind of think creatively and kind of collaborate as a team and come up with the next steps of the project. And, again, we have their support, if we're heading in the wrong direction, they're there to kind of push us back. But yeah, program is very unique. It's not like we're you jump into an existing major product. And you just add one or two features, you're working on multiple features, at the same time, conducting a lot of user testing, going back and forth with sponsors, it's a lot of photo work, it's very intensive, but we learned so much within that four month span. Yeah, it's very, like what makes garagem very unique and special is that is very empowering, like making decisions as interns decisions that sometimes co make that are like data driven, looking at the telemetry and making the right product decision. That's really empowering. That's what makes garage completely unique. And I don't think you can find anything like that the whole. And sorry to add to that with the data as well. Sometimes there is no data. And we have to create our own data by creating surveys or talking to others in our customer base. So sometimes we have nothing to work with. And we're put up there to you know, figure it out, which I think for us all four pushed us and actually showed how capable we are working in this field because we had no idea before this internship and how to do certain things. And after this internship, he hurt so much that I never imagined that I would learn Yeah, well, and you know, it's also worth pointing out that the thing that you guys worked on it is now our I could go over to Visual Studio code and pull up the little marketplace and type device simulator. And it's right there. It's not just some theoretical project you got to work on or whatever, but you actually are working on something that is shipping to people and they're using and they're trying out. Yeah, and we were really lucky in that we were picking up an existing project that was already kind of live. So during our internship, we actually made updates to the extension, and kind of got to see the user telemetry from that and kind of like user feedback. And like, if we made like a mistake, then we kind of like knew pretty much immediately. So I feel that like with other projects that weren't launched yet, they didn't really have that instant feedback, but we were able to get that which is really cool, right? If there was some kind of bug or whatever you would know immediately cuz of course, right? Yeah.

09:39 Yeah, that's great and stressful. You said like, it's not like theory is very like, no, like it's shipped. And we really felt that the truth of it, once we got teachers and students contacting us through emails or GitHub, when they wanted to fix books, and like we felt that we had a real impact. Yeah, absolutely. So let's

10:00 Really quickly before we talk about the device simulator, you know, a lot of people who have been listening to the show for a while they know that I've had the folks come talk about circuit Python, I've had folks come talk about micro Python and whatnot. But there's a lot of people who maybe didn't catch those episodes, or they, you know, they're newer to the show. When have you all just sort of tell people what circuit Python is and how it's the same in different than, say, Python if I go to my Mac or Windows and type Python, so the circuit Python library, it's a fork of the micro Python library made by Adafruit so that we could work on like the Adafruit microcontrollers. So it's pretty much just like a like a version of the Python library that could just like work on those like microcontrollers. But the way that we did things was a lot more just kind of writing like simulation libraries. So it didn't really work as low level as like they usually do what they make or microcontroller. But yeah, that's kind of like the gist of circuit Python. Yeah, it's incredibly it runs on incredibly small devices. Like one of the things we're going to talk about is the circuit Python Express. What's the name of that little circular circuit? circuit playground Express circuit playground Express? That's right. So that thing is like a $25 little device, and it has buttons and it has lights and has all sorts of other stuff in addition to just the little chip on it. So circuit Python runs on really small things, I guess is the point. Yeah, like I think that it's like really cool how Adafruit has so many of these, like microcontrollers, where like all of these, like LEDs, buttons, sensors are all built into it. So you don't need to like hook it up as you would with like an Arduino for example. So like, it gives a new learners like a lot more to work with in terms of just like seeing how one thing interacts with another thing without really worrying about like, you know, damaging their products by hooking up things are often which is like something that was really daunting to me when I first learned microcontrollers. So yeah, no soldering irons necessary to get started. For example, yeah.

12:00 This portion of talk Python to me is brought to you by linode. Whether you're working on a personal project or managing your enterprises infrastructure, linode has the pricing support and scale that you need to take your project to the next level, with 11 data centers worldwide, including their newest data center in Sydney, Australia, enterprise grade hardware, s3 compatible storage, and the next generation network linode delivers the performance that you expect at a price that you don't get started on the note today with a $20 credit and you get access to native SSD storage, a 40 gigabit network industry leading processors, their revamped Cloud Manager cloud not linode.com root access to your server along with their newest API and a Python COI just visit talk python.fm slash linode. When creating a new linode account, you'll automatically get $20 credit for your next project. Oh, and one last thing they're hiring go to lynda.com slash careers to find out more, let them know that we sent you.

12:59 Another thing I wanted to ask you all at the beginning, I get a lot of questions from folks how to get into programming, how to get into Python, how to get maybe a first job or an internship didn't even guys have good advice. Sounds like you've had pretty good success finding internships, the first thing I would do is attend meetups or networking events that discuss a topic and technology can be Python, it can be public speaking, it could be anything, just to get a means of being comfortable in the tech space. It doesn't have to be super technical, but meeting like minded people, I think once you get comfortable with that, and then you can go to the next step and maybe start programming small little projects. But I think the first thing is to meet people who are in the same field, like minded people, and you can discuss certain passions, and then go from there. That's the first thing that I did. It really helped. And I actually went to the I think it's called a networking night before the internship applications open in September, I'm not sure if you guys were there. I didn't see Andrew evaluate. I was there at Microsoft. And it was basically talking about the garage program. And that's where I met so many people. And we talked about like, what school they came from the projects that we're working on, and kind of getting the gist of who's out there, you know. So that's the first thing that I would do. I definitely agree with what you just said, like, biggest advice would be to answer get out there, get out there and meet people program with them. how I got into it is with like a hackathon. Even though I didn't know coding people were ready to take me by the hand and like teach me how to code and bring me onto their team. And yeah, I think that's how, like, that's a good way to start. Cool. And to add to that as well. Like, I think two things that, as interns you've learned and I've actually carried that on today, like in my school years and like when I graduated at Microsoft were learn to have a growth mindset and to fail fast. And what advice I would give to students who kind of break into technology or break into this field is to adapt those two mindsets. It's okay, if there's something that you're not aware of when you're in a hackathon, or there's some kind of technical question you're not you're not aware of how to solve It's okay.

15:00 Looking feel fast, it's all good. Figure it out and have that growth mindset. And you'll learn from there. Once you're comfortable with that uncertainty, you're able to progress and actually be more comfortable in the tech space. So that's another advice I would give to people who are trying to break into this. Yeah, that's good advice. Yeah, like to add to that, I think that like the growth mindset, and like the fail fast mentality is really helpful. Like, whenever, personally, whenever I'm helping someone with programming, and they're all like, Oh, I made this mistake. And this mistake in this mistake, I'm like, Yeah, I've made those mistakes, too. Like, I made them, like 1000 times, you know, it's like, whenever anyone's getting into programming, it's like, natural to, like, totally not know what's happening, and just to feel like super lost, but it's like, kind of like making those mistakes. And just like kind of like, taking that time to learn is like really necessary. And just being patient with yourself. And just like not being so hard on yourself when you like, make mistakes, I think is like a really important part. Yeah, I agree. I think that feeling of being lost or not knowing what to do, when you're new, I think it feels like oh, I don't belong here. Because I'm other people seem to know, and I don't, but as the more you get into it, just feeling kind of lost and unsure. Like, that's just part of the way it goes in technology. And you just keep going. Yeah, like, it's pretty easy to kind of find yourself in that mindset where you feel like you're as caught up as everyone else, especially when everyone throws like throws around terms like ml and AI and then like go database and like you don't even know anything on the technology then it feels like a whole I'm not I don't belong here. But it really is just like, just like a process to learn. And it's like, no one should ever really feel discouraged or ever feel like they're not the type to be in this field, you know? Yeah. Yeah. All right, let's talk about this idea. This project that you worked on, you can go to Adafruit, and you can buy some of these devices is everything that you're simulating now. VND is everything that you're simulating available in physical form from Adafruit, or they're different places and different devices. Everything you can simulate on the simulator is also doable on the actual hardware device. And we have three devices that you can play around with on our simulator, we have the Adafruit circuit playground Express, the BBC Micro bit, and then the Adafruit. Okay, cool. So the BBC Micro bit and then the two from there. And you know, I had gone to Adafruit, I was going to get some cool device for a project with a friend. And we were going to build that. And then you know what, this part was not available. And this thing was backordered. And who knows when this other thing is going to be available. And what I really like about what you guys have built is you can go from, hey, I want to try out this little IoT thing to I'm trying out that IoT thing almost instantly, you don't have to wait for it to be in stock for it to be shipped for everyone to get one right. So tell everyone about the device simulator in VS Code. What's the main idea? What is it do? Yeah, that's pretty funny that you say that actually, when we were coding for the clue, it was actually sold out as well. And we had to contact Adafruit to get some devices from them, because we can invite them actually, yeah. And so the extension, what it does is it simulates the, like you write code that would normally work on the hardware, but you can run it in our VS Code extension, and it will do the same thing as it would do in the hardware. So if you say, like, turn the NeoPixel to the color green, you can run it in the simulator, which is directly like embedded into VS Code. And then the simulators, the device on the simulator will also turn the NeoPixel to green. And then you can even say you have a lot of fun with the simulator, and you actually want to get a device. And so like when they come back in stock, and you buy one, you can also use our simulator to deploy your code to the device, and see it work on both the simulator and the actual hardware. Yeah, and I was really surprised when I first saw it, because it looks really good. Like, you've got the code and circuit Python, you have like code.pi, or main.pi, there's just the one file to get everything started. But then in a split pane, you have the circuit playground Express, and it's like this big nicely rendered a realistic looking replica. And it's much bigger, right? It might even be better to program on the simulator than the tiny little device, because you've got it like big screen right next to your code. It's beautiful. We did a lot of user testing, to make sure that the UI was preferable to all our customers. And anytime we come up with an update, we will I would like to schedule a testing and ask them questions on how it's looking after they've done some programming and give us some suggestions like, Oh, hey, can you make this meter bigger? Can you adjust the size? So for that feature is not there yet, but we had in our backlog and you wanted to work on it. But we made sure that we were advocating for what our users wanted to ensure that what's the final product was pushed out. We would be happy with it. So I'm glad you knew if you like the interface, though.

20:00 Cuz I do really I was really surprised when I saw it come up, because it looks exactly like the circuit playground Express, it has the buttons, you can click on it, you know, click on the picture, and it's like you're clicking on the buttons. It reminds me a little bit of like an iPhone or an Android Dev experience where you've got an emulator, they're like, you run it, the thing is there and it looks more or less like what you're working with. But like I said, Here, it's a bigger and bolder and maybe even better than the real thing. And somebody just took a look, it's not only visually appealing, we can improve it to make it very practical as well. That's what there's a lot of excellent features, I could tab and switch between those buttons. There's also keyboard shortcuts, or you can click in some direct feedback, directional lights happening on the UI, right? Right. So you've got that you can click on your mouse, but you can also assign keyboard shortcuts for like pressing the A button or the B button or both at the same time, and things like that. Yeah, that's quite nice. Okay, so maybe a nice way to help people understand sort of what the flow looks like, here is maybe we could just talk through like a really simple Getting Started demo of like, what are the steps of getting started? Yeah, first, you will obviously need VS Code, the code editor, and then you'll have to have Python installed as well. And then you can go into the extensions, part of VS Code and search for device simulator Express and then install it. And then once you have it installed, there is a little page that like a readme that you can read through the gist of it is that all the like to use the extension, you have to go through the command palette, which is through Ctrl, Shift p on Windows and Apple shift. Yeah, that's pretty common for Visual Studio code, right. So people who are familiar with that, they're used to just, you know, hitting, you know, Command Shift p or Ctrl, Shift p or whatever it is, right. And so basically, it plugs into that same infrastructure, right, you pull up the command palette, and there's like, not quite a wizard, but there's like an onboarding flow. Yeah. And then so usually, what I tell people is to check out the Getting Started page, which is like a little webpage that we packed in there, and it tells you, you can select the device you want to use, and it has like little code snippets, that you can copy and paste into the simulator to like test things out. And then once you want to really get started you there's like a new file command, that'll load up a like a very short template. And it'll open up the simulator for the device you want on the right side. And then you can add the top there's like a comment with like, like a usually a web page where you can click to also see more code snippets, which you can copy and paste as well. And then like once you have some code, you can there's a big green play button on the right side under the simulator, and you press it and then your code starts to run on the simulator, depending on what your code says. And then we also have under the simulator, there's like a toolbar, and it has a bunch of icons and some. And they usually describe what it says like there's a temperature sensor so you can adjust the slider to simulate different temperatures in case like your code says if the temperature is less than 25 degrees Celsius, like change the NeoPixel degree Yeah, turn blue or something, or red if it's above it, or something like that. Right, exactly. We're like changing the text even Yes, because some things are easy, like push the button, but change the temperature. Right? So you've got like a little slider. So all these inputs and stuff, they're available on that right hand side. So you just write the code, like if you know how to write for any of the circuit Python stuff. It's just that right? Yeah. And it's pretty neat. Because, like, imagine you're writing code for the actual device, and you want to know if it works, let's say, like, you want the micro bit to say something when it's over 30 degrees Celsius, but so what are you gonna, are you gonna like, take the micro bit and then microwave it or something? It's in case it's a winter day, you know? Yeah, yeah, exactly. Yeah. Yeah, super cool. Andrew, were some of the other sensors that you have in this circuit playground Express, there are some of the other devices even I'll talk about the other devices. First, I saw that you added were like the the micro bit, the BBC Micro bit and also the Adafruit clue. So initially, our garage project was to work on like the micro bit for the entire term, but we were able to get that done quickly. So we were able to just take on the clue, which is a bit more daunting, because I'm not sure if everyone knows but the clue is pretty much just like a micro bit, but it has like a 24 pixel by it. I was sorry. 240 pixels by 240 pixel screen, and it can have like slideshows it can draw shapes and it's just like, it's really cool, but at the same time it's like oh, how are we gonna do this? You know, it has its own Yeah, it's one thing to go from 12 or whatever it is led that turn on and off to like full screens with the animation. Yeah, yeah. So it's like it even had its own like, built in like, kind of like console like terminal that or that had print statements and stuff. So we had to deal with like, like getting the text works.

25:00 Working in everything. So eventually we were able to use some of the drivers already, like provided by Adafruit and kind of like make our own, like custom base code for that to work on. And then yeah, we're able to get that working. But like the clue has like a lot more in terms of just like sensor sensors like it has like, I'm just looking at it right now. It has gyro acceleration, like temperature, pressure, and it has like a NeoPixel right at the back, too. So it really just has like a lot. It's pretty much like, as we said, as we would often say, it's like a micro bit on steroids. So yeah, that was like, really cool, but also like a really daunting task to have. But yeah, going back to like, the sensors on the CP x. Kevin, do you want to speak on that orange? Sure. Well, like I'm not gonna route like each of them. But there's motion sensors, which is pretty cool. If you shake it or all the system, we can we can detect it. And it's also possible to simulate it inside our extension. We have temperature, many do you want to list the the?

26:08 I think there's an IR one, but I don't know all of them. Yeah, I haven't. I haven't tracked about light sensor temperature, the NeoPixel the motion sensor. The IR one isn't in the simulator, but it is on the actual device. Yeah, right. Right. So what I think is cool about this is you basically expose almost all the functionality of these little devices on there in order to play with them and whatnot. Yeah. Again, apologies for like us not going all in a while since we looked at it. But yeah, it has like the different LEDs, push buttons, slider switch. 10, neopixels, light sensor, motion sensor, acceleration, shake temperature, and yeah, yeah, I'm just reading off a screen.

26:54 Yeah, yeah. So I think it's really neat. And you've got these three different devices, the clue sounds the most interesting, but maybe not the first one you would start with if you were like a true beginner and whatnot. But maybe just talk to you about how like, maybe teachers, or people on education might use this. I think for teachers, I think we initially started with a micro bit. And teachers who are trying to teach micro Python, Python or just microcontrollers, in general to their students, they would use our extension to kind of get the basics of the code and then just deploy it to the simulator and have the devices in the class but also deploy it to the device as well, the actual device, we also have a feature called getting started. So if teachers and students are brand new to this whole VS Code, extension, and Python, in general, they can install the extension and then just go to the Getting Started page. And we'll give you give them step by step instructions on how to get started with the basic codes and like hello, world. So that's pretty much it for that if you are a teacher, and you had a class of students, instead of saying how do I get my school to buy 20 clues or circuit playground express or whatever, you can just say, we're going to install Visual Studio code, it's free, install the Python extension, and we're going to install the device emulator. Alright, kids, now we can have class and we can play with these ideas. Right? Yeah. And also like, if you're not able to install VS Code itself. This is also available on VS Code online. Oh, it is okay. Yes, it was Andrew was evil, like the team was able to get it. I'm working on the online version. So I think

28:32 if I correctly remember, it was an era. I'm not really sure. I was given that task. Yeah. Okay, cool. I don't.

28:40 I was working, I was actually working on two projects during my internship. So I was in between two teams. So lots of information. But basically, if you have an Azure subscription, then you can get the ps4 online. And the extension works there. So yeah, as soon as can just kind of move on login online and start with extension. And I think we also have, we also made step by step video tutorials, we gave that to our sponsors, basically, on how to install the actual VS Code all the way to the extension all the way to the point a sample code, yes, step by step exactly on how on how to do it. And so teachers ever needed that we do have that package ready. And I think it's for a sponsor. So depending on which project which which teachers are using it, they can always reach out and get that package. Yeah, okay. Yeah, very cool,

29:27 Vandy, one thing that seems interesting to me is like, on one hand, we in this education scenario, we could have a bunch of kids with these devices. Or we could have them using Visual Studio code, and the simulator, but in the end, like kids really like having the physical thing that does something. So it might make sense to have like a teacher get one clue and one circuit playground Express. All the kids work on the simulator, and then they each get a turn with the physical device. What do you think? Yeah, I think that's like the best way to do it. Because let's say you

30:00 Code something awesome and you have it on your screen. And but like at recess or something, you want to show other kids in different classes. And so if you can deploy what you did on the simulator into the device and like, walk around and show it actually light up and show it change state depending on like, if you shake it or, or if light is shining on it, that would be super cool. And I think that's a perfect way to use our simulator and also, like, have the device on hand. And with our simulator, there is like a feature where you can deploy straight to the device with the click of a button. So yeah, so you're so connected device to the computer, and you're working on a simulator, and then you just push a button. Yes, yeah, what device? Does this really go to? You pick it? And then then it's on the device, just as if you just deploy it right? Yeah, exactly. Nice. Kevin, anything else you want to add to this whole education story? What are you seeing people doing? Yeah, definitely. Like, the example you just talked about shows that our extension is not mutually exclusive, of having a device, like we think is really like adding to the experience of having, let's say, a microcontroller. So he said before, like, we make it easier to deploy. But in the end, especially for kids, they're very visual people, they want to see it on live, they want to hold it in their hand and show it to their friends. And that's where like, it all goes in together. Our extension makes it easier to code. It's a little bit practical, and they transfer code to the microcontroller. And then we have like a full kind of like circle going around here. Yeah, it's quite cool. Yeah. Another thing I wanted to add is that one of the goals of our simulator was also just to be able to program microcontrollers on the go. So I could see that our extension would help if the teachers had to leave the microcontrollers at the school, but the kids wanted to work on like certain homework assignments, you know? Oh, yeah. Like, yeah, so then they could just like, they could work on that at home. And then when they get to school, they could upload it onto like, the, onto the actual device. So yeah, it's like, it's a or even if, like, they just like, they just have limited resources. You know, it's, I feel like just having it on the go is really convenient. Yeah. Yeah. Like I said, also, it's, it's not just about not having the money for the devices, like, they go out of stock, and you can't get them anymore. Right. So yeah, really, really cool. Yeah. Now, one thing I want to talk about the experience you all have here that I think is pretty cool. So we've got the simulators, you write the code, and then you have the ability to interact with the sensors of the simulator through like sliders and whatnot for like, say temperature, put it on the real device, check the real temperature, whatnot. But if you're writing some code, and it's not doing what you would expect, you said, turn it blue, and it turns red or just does nothing. You're trying to figure out why. It'd be cool if you could debug it, right? Definitely. It's one of the future we spent a lot of our time on. And one of the features we're most proud of, is we integrated the VS Code debugger with our extension. So it gives a real like industry experience for people wanting to learn in brings up to the next level, you can start with it. But you can also learn and become advanced with it. As we know, yeah, deep breath is using the industry. And that's very useful for young developers and students to learn. I think debuggers are, I think they're underused, most the time, a lot of people just write code, they just do print statements or like, or they just spend a lot of time staring at it. You know, put a breakpoint, see what the value of that variable is? Why is it going here? Right? Oh, it's a string seven, not the number seven, I get it. That's why it's not equal. Things like that are really obvious in a debugger. If you print out the string seven, it looks a lot like a regular seven. Yeah. And I think that like integrating something like a debugger for like, people who are just starting to learn is like, super, super important. Because like, as someone who has used print statements for like a lot of debugging in the past, it's like, if I was more used to using a debugger, and if that was like, kind of like my instinctual choice A lot of the time, then maybe I drift more towards it. But just because I'm so used to just like, my first strategy, which was print statements is like, I just keep going back to print statements. So yeah, having the debugger there. And just like kind of just overall, like even having the extension, like, like having the simulation as a part of VS Code. It just really helps the young developers kind of like, get a sense of what they actually use the industry. Yeah, and you can put a lot of a cool, you can like level up on a lot of the stuff of say, like the Python extension, right? So if I type, you know, string dot, and I get a big list of stuff that I can do, right, that's really cool. You get all the autocomplete and all the the code formatting features and all this stuff. The VS Code does already just for micro Python circuit Python. Yeah, we spent like a considerable amount of time and like to make sure that like the autocomplete and everything was working with, like our library, so that like it could help out a lot. But definitely like having like the IntelliSense help from like the actual, like, Python people was super helpful. Yeah, yeah, that's awesome. That's pretty complicated stuff. So what's the sort of ml

35:00 Story of the autocomplete on Vespa is that intellicode or something like that? Where you guys know this what I'm talking about? Yeah, so we actually didn't do like too too much in terms of just like digging into the whole, like IntelliSense stuff. But essentially, we just applied what the Python extension people had on our library. So essentially, the IntelliSense applies to any like, it will look in any directory that you tell it to. So we just, we just structured our code so that it would give the correct results. And then we pointed to our directory. If I were to simplify it, yeah.

35:35 Yeah. Okay, cool. See that? One thing I heard when I was looking through here was certain things like Vandy said, the IR sensor is not available in a simulator, but it is in the real device, and also heard that, oh, you can go over to make code and do some stuff there for some of the more advanced scenarios, what's this make code thing, place. So make code is basically a building block software. It's basically drag and drop, you can kind of look at certain functions, and then you drag it and then you put another block inside. And it would kind of work with that function. So it's a very basic way of coding, but it's a very good stepping stone. Okay, if I select Express is basically the next step after my code. It's more like industrial programming. So yeah, my code is very, it's a very basic way of understanding coding, but it's a way good way of just introducing yourself into the programming world. And that's how I started actually great chat. I started using that building block software to learn programming. Okay. Yeah, really cool. So it's the the more visual, visual side and then like you kind of graduate to writing actual Python code. Yeah, yeah. Okay. Yeah. Yeah. That's quite cool. Maybe we could talk a little bit about how you all built this, like digging inside some of the implementation? How did you build it? What's going on inside? Like, how does this thing work? Me and also like, then do we work tomorrow on like the Python side. So on the actual device, how usually work is the speaking more on the Adafruit side first, so then they would have Python drivers that would work on the circuit Python library. So the device itself would would run circuit Python, and then it would have these drivers to connect to like the LEDs and just like the sensors, so that like when you say like CP x like and then sensor, you would actually be accessing that value, right? And so then how we essentially did it on our side is, it would just run on regular Python, like Python, like 3.8. But we would kind of make our own simulated library that instead of, instead of communicating with the hardware, it communicated with a front end that was written, right. Yeah, I see. So you almost write just a really simple Python layer that just when they say, light up LED, instead of going down to real hardware, he's like, Alright, how do I communicate that over to JavaScript? Or something like Yeah, yeah, essentially. So it just it would send a JSON file, just like with all of the new values for all of the offer, like the LEDs, for example. And then like, the front end would send back like a new JSON with the sensor values, and stuff like that. So it would just be communicated like that. But most of the state would just be stored on the Python side, within the Python object. Yeah. Okay. Cool. And people who don't know, Visual Studio code is basically a huge JavaScript application, right?

38:26 Yeah. Yeah. Like, the front end. Yeah, it was made using like TypeScript and like the VS Code API. And I didn't really other than like working with virtual environments. I didn't really work that much. On the front end, it was mostly Kevin trying to like wrangle that mess. I every time. I had to work on it. I was like, oh, how do you do this?

38:50 Yeah, it's all electron j. s and TypeScript and all that kind of stuff. Right. So Kevin, you're the one who had to make it flash on the screen. Yeah, yeah, exactly. I worked a lot on the actual UI, and what you can see, but also kind of like the part that interconnects the Python side with the UI. And the central piece at the end is the VS Code API, which makes it easy to communicate between those two blocks. Yeah. That's cool. All right. Any notable packages or libraries that you guys used out there in the thing that you thought were pretty cool? Well, like I'm gonna say that like the VS Code API is pretty cool. Like it is at the end, like a packaging library that we use. And yeah, I might be a little bit biased.

39:34 On my side, like for Python, we didn't really like per se import a lot of packages, we kind of like mocked a lot of the Adafruit packages like the slideshow on display shapes, display text, bitmap font, like so just kind of adapting those for like our own use. Like I found that they were like super interesting and that like, I don't know, it'd be super cool to like work for like Adafruit and actually write these because it's like, it seems so fun, but

40:00 Yeah, just like, overall, and like even the underlying libraries that are amazing. See, when I was trying to transcribe them into Python, it was like, Oh, this is like, this is really cool, you know?

40:12 Yeah, it seems like a super fun project to work on it. Definitely. It has, you know, like five star ratings on the marketplace, which is really good, right? Y'all must be proud of that. Very, very, yeah, yeah, yeah, we worked really hard. And like we wanted, we're always like really keen and trying to like fix the things that like the users are having troubles with, like, for example, when we entered like the internship, like, a lot of the users were all like, not a lot. But like some users, were pointing out that it was kind of cumbersome to always have the dependencies download to like, their main interpreter. And we found that Yeah, like the dependency download step would fail for a lot of people. Because like, it was kind of complicated, like it would download the packages to a certain like local folder, and then just set the program to look at like that directory. So then we kind of re purpose that so that overall, when it does the setup, it sets up its own virtual environment, and then sets up our dependencies there. So it's a bit more like isolated. And also, yeah, we were able to enable users to use their own virtual environment and set up on their own virtual environment if they wanted to. So definitely iterating on like people's feedback was like an important part of the internship. Yeah, I'm sure. Yeah, we always had that in our user testing, like at the bottom, mastering to test user flow, we opened the extension for this the end, how did they enjoy that experience? And you found that again, what, as you mentioned, the dependencies is a bit tedious to see, like certain pop ups and all that. So we always ensure to refine that further to make it optimal. Yeah, it seems like a really nice experience. Super cool. So I do want to ask you all one final question. And whoever wants to jump in, just jump in, to what I see you have these three devices, the clue the micro bit and the circuit playground Express. One area that seems like it'd be really cool is there's a lot of companies out there making IoT things that have an API that people might need to program, maybe their program in Python. And if I'm going to work with a company, let's say I make tractors, and I've got a little IoT thing you could program to, I don't know, control the tractor or whatever. Is there a way that say that tractor manufacturer could make a virtual addition to the device simulator so that people could try it out and play with it and use it, get their API working, and then actually get a tractor, or whatever a car that self drive you whenever they want to talk to you like that device? Could you plug other devices in. So currently, we don't have that when we were starting the project, it was an idea that was pitched to us just like by like another intern, like, oh, maybe you could make it more extendable to support different microcontrollers. But like in that task, there's just like, kind of like a lot to unpack For a start, like kind of like, see what the best UI is for these manufacturers and just kind of like how they prefer to do this. And that. And that, in itself is like a pretty big and daunting project and kind of sense. Like, we're not really in the internship anymore. And we are kind of like we have our own things. For now. It isn't on our schedule, but it would definitely be something that could help out like our extension to be more useful to like different industries. I think it would definitely take it from education to broader IoT for sure. Yeah, I think what's awesome, though, is that all the code is open source. And so like, if a company or if like people wanted to bring in like another device, they could check out the GitHub repository and make a pull request. And like, if they're really keen on it, add another device that they want to see in the simulator. Yeah, cool. I think it would be neat, but obviously, it's a lot of work, right? It's not just plugging your API here or whatever. But it still would be cool. I think that it would be really cool and really interesting to work on. But at the same time, like when I when I think about it, I think about kind of like all the user research study want to do first in terms of like how they want it to actually work because it could work like in multiple different ways. So just like having that plan first, like, yeah, I think that it'd be super important to like, even more important than it never was before. So yeah, yeah. Cool. All right. Well, I guess maybe that's a good place to start wrapping it up. I know that you all did this as an intern project in the year on two degrees, do jobs and whatnot. But where do you see this going in the future? either from you know, if you guys were to contribute more, or maybe the next garage intern group picks it up and runs with it. So about like next interns spinning it up, that we're not sure, and we can't really confirm it. But this is completely open source. Anyone can contribute to it, like myself, I still contribute even though I'm not doing the internship anymore. And it would be definitely nice to have more and more support and more support from the Python community. And we could grow that extension way more. Some things like the ideas you just suggested, would actually be possible on a technical side that we would need

45:00 More people working on that. Make it happen. Yeah, yeah, for sure. Yeah. Like Personally, I'd contribute more. If I had more time. Like on my side, I mostly kind of looking at bug fixes and seeing, like how we can kind of just keep it like sustainable. But just because we kind of have our own things, whether it be internships or classes, it's not really easy for a lot of us to contribute as much as we used to be. Maybe you all could go on a podcast and tell other developers about it. And then they could also maybe pick it up and do some contributions. Yeah.

45:32 Right. All right. Well, let me just ask you all what question I normally I have two questions, but since there's four of you, I'll narrow it down to one each. So if you're gonna write some Python code, what editor Do you use, and you may all be biased, given your focus here, but nonetheless, I'll ask anyway, Andrew, you wanna go first? I like I like VS Code. Like, I'm not just saying that because I'm still at Microsoft, and that we made a VS Code extension. But actually, like, one of the reasons why I picked this project is because like, I actually did use like, VS Code a lot with Python before and I thought it's like, wow, they can put a lot in like a pretty lightweight editor. So I was like, yeah, it's like, we actually get to work with the team that does this. That's so cool. That's pretty cool. Yeah, like mini fan girl moment. But yeah, I go vs. Code,

46:17 Vandy, how are you? I'm going with VS Code as well. Okay. I just like love the experience. Oh, and now you have stuff built into it that like vs. Code is partly your code. So that's cool. Yeah. Awesome. So you know, I'm going to be as soon as well, I think that's the first editor used in my first university until today. I've good like good memories for I think I would continue with that. All right. Awesome. Okay, final call to action. People want to try this out. They want to play with it, maybe use it with students, what do they do also want to use it with their students, I guess the first thing to do would be to download it. But just just like Isiah said, there are like there are like packages that we made in order to kind of like guide learning. And just kind of like having or getting like going through a getting started pages. And looking through even like existing code that's like on the internet for like the CPM. Micro better the clue. Most of the time, it'll work like, I know that for the clue. There's code in the actual Adafruit clue GitHub repo, and you can actually put that on the put that on our simulator, and it'll work. So just kind of like, I'd say, just to download and play around with it and kind of like, get the vibe first. And also kind of like see where to go from that. Yeah, and I think the first, the first thing when you download it, definitely don't get intimidated. Read the readme page, like carefully, because there's so much there that can help you actually get to certain pages. Because I remember when we were doing user testing, we worked with some people who didn't have any experience with VS Code. So opening like the command palette, like how do we do it? I'm like, it's right in the readme. So take a look at that first. And definitely don't be intimidated by it. And just yeah, have some fun and fit and fail fast. won't break anything. So it's okay, if you write some bad codes so far, but if you break something, then let us know if we have.

48:07 Yeah, let us know. So we can help fix that. Yeah. Awesome. All right, guys. We're out anything else? Sir? What should we call it? call it good. I could add one more thing like that. Yeah, the tick world is becoming more and more forgiving. And, like, we want everyone to participate. So you know, like, learning and breaking things is completely okay. And have fun. That's pretty much awesome. I just, I also wanted to add something just like that at the end. Overall, like, personally, my experience in garage was like, really awesome. And we were able to get like a lot done. But this was also because like, I says a team had like a really good dynamic. So just like, I don't know, I just wanted to shout out just like the team for being awesome. And just like, the coaches and everyone else in garage for being for just like making it a great experience, because it's like, definitely, this is like a team effort. And I want to have gotten, like anywhere close near like our end product. If it was like, you know, just to me, I agree. 100% I think the team dynamic that we had the support we had from the sponsors from the garage team was really, really helpful. I've gotten so much in the span of four months. I'm glad that our product is so impactful that those a day people are using it. And it's basically with the help of the whole team. The whole team effort. Yeah, very cool. So I guess final thing before we call it a wrap, if people are out there, and they're like this garage internship sounds awesome. How do I get to it? Like, how would they find out more for next year, next time around, I would look out in the careers page for the postings for the garage internship. There's also a page and type in garage internship at Microsoft and gives you a good explanation of what it is. There's some videos that they've made on on what people have been doing in the internship. And also I would follow Microsoft Vancouver on Facebook, and they would post like an event, mostly because I went to the networking event sometime I think if I'm not mistaken, September, October, I think it was September so they met and you can register and you

50:00 can actually go for an information night and network with other people who are fine person. All right, very cool. All right. Well, thank you all for being on the show. It was really great to have you here. A lot of fun and congratulations on the project. It really looks genuinely useful. Awesome. Thanks for having us. Thank you so much. Yeah, you bet. Bye Bye. Hi.

50:19 This has been another episode of talk Python to me. Our guests on this episode were Andrea ma Cena, Moosa, Vandy Lee and Kevin Nolan. And it's been brought to you by linode. And us at Talk Python Training. Start your next Python project on the nodes state of the art cloud service, just visit talk python.fm slash linode li in Eau de, you'll automatically get a $20 credit when you create a new account. Want to level up your Python. If you're just getting started, try my Python jumpstart by building 10 apps course. Or if you're looking for something more advanced, check out our new async course the digs into all the different types of async programming you can do in Python. And of course, if you're interested in more than one of these, be sure to check out our everything bundle. It's like a subscription that never expires. Be sure to subscribe to the show, open your favorite pod catcher and search for Python. We should be right at the top. You can also find the iTunes feed at slash iTunes. The Google Play feed is slash play in the direct RSS feed at slash RSS on talk python.fm. This is your host Michael Kennedy. Thanks so much for listening. I really appreciate it. Get out there and write some Python code

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon