1 00:00:00,000 --> 00:00:03,960 [MUSIC] 2 00:00:03,960 --> 00:00:06,440 >> Hi, welcome to the Bootloader. I'm Tod Kurt. 3 00:00:06,440 --> 00:00:08,400 >> I'm Paul Cutler. We're back after 4 00:00:08,400 --> 00:00:10,600 an extended break with a special episode breaking 5 00:00:10,600 --> 00:00:13,240 down the recently released CircuitPython 9. 6 00:00:13,240 --> 00:00:15,540 It's been just over a year since CircuitPython 8 7 00:00:15,540 --> 00:00:17,760 was released in February 2023, 8 00:00:17,760 --> 00:00:19,840 and Tod and I are going to chat about what's new and 9 00:00:19,840 --> 00:00:22,240 what we think is cool in CircuitPython 9. 10 00:00:22,240 --> 00:00:23,600 With that said, Tod, 11 00:00:23,600 --> 00:00:25,840 what are you excited about in this release? 12 00:00:25,840 --> 00:00:27,200 >> All right. There's a ton of things, 13 00:00:27,200 --> 00:00:28,520 but I'm going to list four real quick 14 00:00:28,520 --> 00:00:30,200 without any explanations. 15 00:00:30,200 --> 00:00:32,400 We can get to them in detail as we go. 16 00:00:32,400 --> 00:00:36,040 JPEG I/O, parallel display bus, 17 00:00:36,040 --> 00:00:39,720 USB host, and ESP-IDF update. 18 00:00:39,720 --> 00:00:42,080 How about you? What are some of the things you're excited by? 19 00:00:42,080 --> 00:00:44,880 >> JPEG I/O and the Momento camera definitely. 20 00:00:44,880 --> 00:00:47,400 CircuitPy on Android, I think is pretty cool. 21 00:00:47,400 --> 00:00:51,200 Brand new connection manager and USB host, 22 00:00:51,200 --> 00:00:52,520 I'm excited to learn more about. 23 00:00:52,520 --> 00:00:54,000 I haven't played with it yet. 24 00:00:54,000 --> 00:00:57,700 So let's jump in. We both had JPEG I/O on our list. 25 00:00:57,700 --> 00:01:00,520 The Momento camera just came out in the last couple of months and was 26 00:01:00,520 --> 00:01:03,740 just unveiled in the latest AdaBox as well. 27 00:01:03,740 --> 00:01:05,960 Have you had a chance to play with a Momento? 28 00:01:05,960 --> 00:01:09,020 >> I have. Yeah. I ended up getting a board before the AdaBox, 29 00:01:09,020 --> 00:01:11,120 but then I also got the AdaBox. 30 00:01:11,120 --> 00:01:14,420 Of course, there was JP's wonderful unboxing video 31 00:01:14,420 --> 00:01:16,320 that he did last night, 32 00:01:16,320 --> 00:01:18,920 which was the 20th of March, 2024. 33 00:01:18,920 --> 00:01:20,760 So there have been other, 34 00:01:20,760 --> 00:01:23,020 so it's an ESP32-S3, I think, 35 00:01:23,020 --> 00:01:28,800 baseboard that has on it a camera module, microphone, SD card slot, 36 00:01:28,800 --> 00:01:30,800 bunch of this stuff, accelerometer. 37 00:01:30,800 --> 00:01:34,900 But it's ESP32, so it's Wi-Fi capable, Bluetooth capable. 38 00:01:34,900 --> 00:01:39,040 But the camera module writes JPEG. 39 00:01:39,040 --> 00:01:41,840 Like when you turn it on and say, "Take a picture," it spits out 40 00:01:41,840 --> 00:01:44,920 JPEG data that you're supposed to just save to disk as a JPEG file. 41 00:01:44,920 --> 00:01:46,680 So that raises the question, 42 00:01:46,680 --> 00:01:49,920 how do you read that on a CircuitPython device? 43 00:01:49,920 --> 00:01:51,880 So now we have JPEG I/O, 44 00:01:51,880 --> 00:01:55,620 which allows you to decode JPEGs and load them, 45 00:01:55,620 --> 00:01:58,900 load JPEG images into CircuitPython and display them on a screen. 46 00:01:58,900 --> 00:02:01,460 >> That's a big deal. I mean, we had a bitmap support 47 00:02:01,460 --> 00:02:03,060 and most everything is using bitmaps, 48 00:02:03,060 --> 00:02:04,240 but there's also ping support, 49 00:02:04,240 --> 00:02:05,440 but you don't see a lot of it. 50 00:02:05,440 --> 00:02:07,460 But JPEG is the standard for everything. 51 00:02:07,460 --> 00:02:10,440 You can get small enough file sizes and all that fun stuff. 52 00:02:10,440 --> 00:02:12,140 So it's pretty cool to see that added. 53 00:02:12,140 --> 00:02:14,260 >> Yeah. It's incredible. 54 00:02:14,260 --> 00:02:16,820 The one downside of JPEGs compared to 55 00:02:16,820 --> 00:02:20,280 the other image formats that we like to use in CircuitPython, 56 00:02:20,280 --> 00:02:22,060 the BMP or the PNGs, 57 00:02:22,060 --> 00:02:23,780 is those can be palletized, 58 00:02:23,780 --> 00:02:27,180 which means you can choose exactly how many colors your image has. 59 00:02:27,180 --> 00:02:29,560 So if you have a specifically just black and white image, 60 00:02:29,560 --> 00:02:34,080 you can say, "Only use one bit per pixel for this image," 61 00:02:34,080 --> 00:02:38,120 which makes the image on your disk a little bit bigger 62 00:02:38,120 --> 00:02:40,680 because there's no real compression in BMPs. 63 00:02:40,680 --> 00:02:42,700 But it means that in memory, 64 00:02:42,700 --> 00:02:45,980 the CircuitPython image buffer will be much smaller. 65 00:02:45,980 --> 00:02:48,840 With JPEGs, JPEGs are like the full color space. 66 00:02:48,840 --> 00:02:51,940 So I think that it stores them as a 16-bit color, 67 00:02:51,940 --> 00:02:53,300 two bytes per pixel. 68 00:02:53,300 --> 00:02:54,500 So it's a bit bigger. 69 00:02:54,500 --> 00:02:59,180 So JPEG I/O will only probably work really well on ESP32 devices, 70 00:02:59,180 --> 00:03:00,360 things with lots of RAM, 71 00:03:00,360 --> 00:03:02,340 but it's like we got it. 72 00:03:02,340 --> 00:03:05,740 >> I think one of the really neat things about it too is it 73 00:03:05,740 --> 00:03:08,180 shows how Adafruit's innovating around the product, 74 00:03:08,180 --> 00:03:11,880 the hardware, and the software coming together to create the product. 75 00:03:11,880 --> 00:03:12,260 >> Yeah. 76 00:03:12,260 --> 00:03:14,180 >> It's almost Apple-like that when you can 77 00:03:14,180 --> 00:03:16,460 have influence over both of those things, 78 00:03:16,460 --> 00:03:18,960 you can have an experience that's really pretty cool. 79 00:03:18,960 --> 00:03:23,240 >> Yeah. I've had a couple of these little ESP cams. 80 00:03:23,240 --> 00:03:25,440 You can get them pretty cheap off of AliExpress or whatever 81 00:03:25,440 --> 00:03:29,120 that are what the Memento was based on. 82 00:03:29,120 --> 00:03:30,720 It's got ESP32 with one of 83 00:03:30,720 --> 00:03:33,140 these little low-cost camera modules hooked up to it, 84 00:03:33,140 --> 00:03:39,020 and some simple C code that shows basically how to just write the file. 85 00:03:39,020 --> 00:03:40,340 But it's not a product. 86 00:03:40,340 --> 00:03:42,500 It's not really anything that's usable. 87 00:03:42,500 --> 00:03:44,860 Whereas the Memento is super usable, 88 00:03:44,860 --> 00:03:47,120 partly because it's got a good design physically, 89 00:03:47,120 --> 00:03:49,860 but also because now you can do it all in CircuitPython. 90 00:03:49,860 --> 00:03:52,520 >> The first open-source powered camera. 91 00:03:52,520 --> 00:03:52,660 >> Yeah. 92 00:03:52,660 --> 00:03:54,220 >> That's pretty darn cool. 93 00:03:54,220 --> 00:03:57,260 >> Yeah, it's pretty awesome. One of the other things I like about 94 00:03:57,260 --> 00:04:02,140 the Memento effort was that one of the CircuitPython devs, 95 00:04:02,140 --> 00:04:05,880 Jepler, added a bunch of image effects in 96 00:04:05,880 --> 00:04:10,980 a general way with this thing called a new library in the core called Bitmap Filter. 97 00:04:10,980 --> 00:04:13,420 This lets you do what's called convolution filters, 98 00:04:13,420 --> 00:04:15,820 which is your standard Photoshop filters. 99 00:04:15,820 --> 00:04:21,060 You can do things like sepia tone or blur or unsharp mask or whatever. 100 00:04:21,060 --> 00:04:23,820 >> But it is pretty cool how that piece of hardware 101 00:04:23,820 --> 00:04:26,300 is driving the software innovation that Adafruit is working on. 102 00:04:26,300 --> 00:04:27,620 >> Totally. 103 00:04:27,620 --> 00:04:30,060 >> Next up, let's chat about USB host. 104 00:04:30,060 --> 00:04:33,180 I understand you've played around with that a bit. I have not. 105 00:04:33,180 --> 00:04:36,860 >> I've played around with a little bit on other systems, 106 00:04:36,860 --> 00:04:38,440 not much in CircuitPython world yet. 107 00:04:38,440 --> 00:04:41,980 But yeah, the thing I've mostly played around with is that there are a lot of 108 00:04:41,980 --> 00:04:48,580 really interesting little USB MIDI keyboards out there in the world that are only USB. 109 00:04:48,580 --> 00:04:50,820 It'd be really cool if you could plug these into 110 00:04:50,820 --> 00:04:53,620 something that's not a full computer, 111 00:04:53,620 --> 00:04:57,740 but something that's smaller that could then create normal MIDI, 112 00:04:57,740 --> 00:05:02,060 standard five-pin MIDI, or it could be a synthesizer in itself. 113 00:05:02,060 --> 00:05:04,980 So with this new USB host functionality, 114 00:05:04,980 --> 00:05:06,540 we might actually get that. 115 00:05:06,540 --> 00:05:09,100 >> The other thing it adds is keyboard support. 116 00:05:09,100 --> 00:05:11,500 >> Oh, like for computer keyboards. 117 00:05:11,500 --> 00:05:13,380 >> Yes, it does. Scott, 118 00:05:13,380 --> 00:05:14,480 I think earlier this year, 119 00:05:14,480 --> 00:05:17,900 blogged in a CircuitPython 2024 wish list 120 00:05:17,900 --> 00:05:21,720 about how close we're getting to an actual CircuitPython powered computer. 121 00:05:21,720 --> 00:05:24,480 We've got the bigger displays and the quality is right. 122 00:05:24,480 --> 00:05:25,840 You've got USB host, 123 00:05:25,840 --> 00:05:27,500 so you can actually have the keyboard, 124 00:05:27,500 --> 00:05:30,740 and now you've got the microcontroller working as a full-blown computer. 125 00:05:30,740 --> 00:05:33,500 It's almost back to the eight-bit days of yore. 126 00:05:33,500 --> 00:05:36,500 >> Yeah. Back when we could turn on the computer and it would 127 00:05:36,500 --> 00:05:39,460 immediately give you a little prompt to let you start programming, 128 00:05:39,460 --> 00:05:41,160 like that was amazing. 129 00:05:41,160 --> 00:05:45,460 You'd have to wait for it to boot up because you just turned it on and there it was. 130 00:05:45,460 --> 00:05:51,000 >> It's funny, I think not that it's in CircuitPython 9 specifically, 131 00:05:51,000 --> 00:05:53,260 but I've seen work going on with a soft keyboard, 132 00:05:53,260 --> 00:05:54,660 so a software keyboard, 133 00:05:54,660 --> 00:05:57,420 as well as just a couple of weeks ago in Discord, 134 00:05:57,420 --> 00:05:58,700 and I don't know the details, 135 00:05:58,700 --> 00:06:03,100 but someone was talking about how could we have a terminal actually in CircuitPython. 136 00:06:03,100 --> 00:06:04,220 >> Oh, interesting. 137 00:06:04,220 --> 00:06:08,420 >> Right. I don't know how that would work if it's connected to the REPL or what, 138 00:06:08,420 --> 00:06:09,560 but there were some questions. 139 00:06:09,560 --> 00:06:12,980 I'm like, "Oh, every day we seem to get just a little bit closer." 140 00:06:12,980 --> 00:06:15,100 >> Yeah. It's amazing. 141 00:06:15,100 --> 00:06:17,820 It's a pretty complicated problem, it seems, 142 00:06:17,820 --> 00:06:21,420 where right now when you want to talk to CircuitPython, 143 00:06:21,420 --> 00:06:23,120 you connect via the serial REPL, 144 00:06:23,120 --> 00:06:27,340 this USB interface over generally the USB interface, 145 00:06:27,340 --> 00:06:30,580 but it looks like a serial port to your computer and you can control-C 146 00:06:30,580 --> 00:06:34,660 your program and you can start the program back up again and you can see printouts. 147 00:06:34,660 --> 00:06:37,840 But then there's also what's called the web workflow, 148 00:06:37,840 --> 00:06:41,340 where you can do that same interaction but via a web page. 149 00:06:41,340 --> 00:06:44,620 There's also a Bluetooth workflow where you can do something similar, 150 00:06:44,620 --> 00:06:46,860 but with a little BLE app. 151 00:06:46,860 --> 00:06:50,460 Now we might have something where there's a different workflow 152 00:06:50,460 --> 00:06:54,940 where the keyboard and the screen are connected directly to the microcontroller. 153 00:06:54,940 --> 00:06:58,980 Somehow these all work without them colliding. 154 00:06:58,980 --> 00:07:01,380 If I do something in the web workflow, 155 00:07:01,380 --> 00:07:04,220 I can still see it in the serial REPL, I think. 156 00:07:04,220 --> 00:07:10,000 It's just a tour de force of programming to make all this work together. 157 00:07:10,000 --> 00:07:13,520 >> It absolutely is. With that said, 158 00:07:13,520 --> 00:07:16,000 we have to give credit to MicroPython. 159 00:07:16,000 --> 00:07:19,560 CircuitPython is a downstream fork of MicroPython. 160 00:07:19,560 --> 00:07:21,800 Every major release of CircuitPython, 161 00:07:21,800 --> 00:07:25,520 they merge back in all the changes within MicroPython. 162 00:07:25,520 --> 00:07:27,900 In this release alone in CircuitPython 9, 163 00:07:27,900 --> 00:07:30,480 there were three MicroPython merges that they made, 164 00:07:30,480 --> 00:07:34,420 1.19.1, 1.20, and 1.21, 165 00:07:34,420 --> 00:07:36,880 were all merged into CircuitPython 9, 166 00:07:36,880 --> 00:07:39,760 which brings a lot of innovation. 167 00:07:39,760 --> 00:07:42,620 There's one thing called the split heap management. 168 00:07:42,620 --> 00:07:45,840 I actually looked into it and couldn't understand it, 169 00:07:45,840 --> 00:07:47,660 so I went to one of the core developers, 170 00:07:47,660 --> 00:07:50,040 and Dan Halbert gave me a really great explanation. 171 00:07:50,040 --> 00:07:51,220 It's a little long to read here, 172 00:07:51,220 --> 00:07:52,740 I'll include it in the show notes. 173 00:07:52,740 --> 00:07:57,580 But especially if you have some of the boards with smaller amounts of memory like the SAMDs, 174 00:07:57,580 --> 00:08:00,020 you might have some memory issues going forward 175 00:08:00,020 --> 00:08:01,340 to watch out for. 176 00:08:01,340 --> 00:08:04,020 But overall, it's a really innovative change. 177 00:08:04,020 --> 00:08:09,180 >> I've also been looking at the piece of text that Dan gave you. 178 00:08:09,180 --> 00:08:10,980 I'm a pretty good coder, I feel, 179 00:08:10,980 --> 00:08:12,900 but this is a little bit beyond me. 180 00:08:12,900 --> 00:08:16,140 >> Those of you who want to know the guts and internals of CircuitPython, 181 00:08:16,140 --> 00:08:17,740 I want to know about what changed. 182 00:08:17,740 --> 00:08:18,960 We've got the info for you. 183 00:08:18,960 --> 00:08:21,340 Just go to the bootloader.net and read the show notes. 184 00:08:21,340 --> 00:08:23,900 >> Totally. About the merge, 185 00:08:23,900 --> 00:08:27,100 I don't know how many people who are listening have actually 186 00:08:27,100 --> 00:08:31,100 done merges to an upstream fork of code they're using. 187 00:08:31,100 --> 00:08:36,220 But it is a ordeal because you take this code, 188 00:08:36,220 --> 00:08:38,380 some piece of code, and you fork it, 189 00:08:38,380 --> 00:08:39,940 you make your own changes, 190 00:08:39,940 --> 00:08:43,100 and then the original makes their changes. 191 00:08:43,100 --> 00:08:45,980 And if you want to track what they've done, 192 00:08:45,980 --> 00:08:48,020 you have to go through this merge process. 193 00:08:48,020 --> 00:08:50,340 Man, if you've changed the same file, 194 00:08:50,340 --> 00:08:52,780 if you've decided to re-architect something 195 00:08:52,780 --> 00:08:55,380 to have a different way of thinking about a problem, 196 00:08:55,380 --> 00:08:57,940 it's just a huge problem. 197 00:08:57,940 --> 00:09:01,300 And the fact that they're still doing upstream merges, 198 00:09:01,300 --> 00:09:03,300 where they're still trying to track what MicroPython is doing, 199 00:09:03,300 --> 00:09:07,220 so that CircuitPython is a subset of MicroPython is amazing. 200 00:09:07,220 --> 00:09:12,780 And I was looking at the changes just for the 1.2.0 MicroPython merge, 201 00:09:12,780 --> 00:09:16,060 the commit for that in CircuitPython touched 202 00:09:16,060 --> 00:09:20,780 779 source files over 250 commits. 203 00:09:20,780 --> 00:09:23,100 And that's pretty much- 204 00:09:23,100 --> 00:09:24,500 >> And they merged three of those. 205 00:09:24,500 --> 00:09:25,700 >> Three of those. 206 00:09:25,700 --> 00:09:27,940 (laughs) 207 00:09:27,940 --> 00:09:29,420 It's like, this is a huge undertaking. 208 00:09:29,420 --> 00:09:31,820 And it seems to work, you know, 209 00:09:31,820 --> 00:09:34,060 that like, so we get some of the new thinking 210 00:09:34,060 --> 00:09:36,500 from MicroPython into CircuitPython. 211 00:09:36,500 --> 00:09:38,780 And sometimes some of the CircuitPython ideas 212 00:09:38,780 --> 00:09:40,060 bubble up to MicroPython, 213 00:09:40,060 --> 00:09:42,500 but sort of in an out of band way, 214 00:09:42,500 --> 00:09:45,500 because it would be hard for CircuitPython 215 00:09:45,500 --> 00:09:47,940 to sort of push changes back up directly. 216 00:09:47,940 --> 00:09:49,540 But yeah, I think it's really cool 217 00:09:49,540 --> 00:09:52,500 that we're working together with MicroPython, CircuitPython. 218 00:09:52,500 --> 00:09:53,820 >> Yeah, the beauty of open source. 219 00:09:53,820 --> 00:09:55,380 >> Yep. 220 00:09:55,380 --> 00:09:59,180 >> Next up, let's chat about parallel display bus. 221 00:09:59,180 --> 00:10:00,260 What's going on there? 222 00:10:00,260 --> 00:10:04,820 >> Ah, okay, so if you've used a little display, 223 00:10:04,820 --> 00:10:09,820 little like, you know, LCD or TFT OLED or something, 224 00:10:09,820 --> 00:10:13,180 you can talk to it via the I2C bus, 225 00:10:13,180 --> 00:10:17,700 which is two little wires kind of slowed around 400 kilohertz, 226 00:10:17,700 --> 00:10:20,780 or you can use the SPI bus, which is also two wires, 227 00:10:20,780 --> 00:10:23,340 but can operate to like 30 megahertz or so. 228 00:10:23,340 --> 00:10:26,700 And anytime you want to rewrite the entire screen, 229 00:10:26,700 --> 00:10:28,740 that could be kind of slow because you're transmitting, 230 00:10:28,740 --> 00:10:31,860 you know, several hundred thousand bytes of data 231 00:10:31,860 --> 00:10:33,140 to rewrite all the pixels. 232 00:10:33,140 --> 00:10:36,100 'Cause these displays are pretty dense, you know, 233 00:10:36,100 --> 00:10:39,100 like one of the ones I like to use is 240 by 240 pixels. 234 00:10:39,100 --> 00:10:41,180 And so you do your remote, 235 00:10:41,180 --> 00:10:43,860 you do your best to minimize whole screen updates. 236 00:10:43,860 --> 00:10:45,380 You just want to change little bits 237 00:10:45,380 --> 00:10:46,380 that are changing on the screen 238 00:10:46,380 --> 00:10:48,280 rather than rewrite the whole screen each time. 239 00:10:48,280 --> 00:10:50,360 But there are some really nice boards 240 00:10:50,360 --> 00:10:52,420 that LilyGo has made. 241 00:10:52,420 --> 00:10:55,940 They're another like maker of little microcontroller gizmos 242 00:10:55,940 --> 00:10:59,340 that have these really beautiful TFT color displays 243 00:10:59,340 --> 00:11:01,620 with an ESP32 board on the back. 244 00:11:01,620 --> 00:11:04,180 And, but they're hooked up via what's with a parallel 245 00:11:04,180 --> 00:11:06,380 technique, which is eight data bits 246 00:11:06,380 --> 00:11:09,460 instead of the one data bit that SPI has. 247 00:11:09,460 --> 00:11:11,540 And so you can essentially get like eight times 248 00:11:11,540 --> 00:11:12,360 the bandwidth. 249 00:11:12,360 --> 00:11:14,140 So it's like an eight times faster display. 250 00:11:14,140 --> 00:11:16,820 And CircaPython has sort of supported this, 251 00:11:16,820 --> 00:11:18,840 but only for certain chips 252 00:11:18,840 --> 00:11:21,900 and not for these cool LilyGo chips, which are ESP32. 253 00:11:21,900 --> 00:11:24,460 And so lately the parallel display bus 254 00:11:24,460 --> 00:11:27,820 has been turned on and fixed for ESP32. 255 00:11:27,820 --> 00:11:30,100 Now we can use these cool boards 256 00:11:30,100 --> 00:11:31,500 that have the really fast displays 257 00:11:31,500 --> 00:11:33,460 and you can update them really quickly. 258 00:11:33,460 --> 00:11:34,980 - So on the LilyGo displays, 259 00:11:34,980 --> 00:11:37,260 they're actually built into the boards 260 00:11:37,260 --> 00:11:39,900 similar to like the reverse TFTs that Adafruit sells. 261 00:11:39,900 --> 00:11:41,820 - They look a lot like the reverse TFTs. 262 00:11:41,820 --> 00:11:42,660 Yeah, yeah. 263 00:11:42,660 --> 00:11:45,540 And so it wouldn't surprise me if Adafruit comes out 264 00:11:45,540 --> 00:11:46,860 with something similar 265 00:11:46,860 --> 00:11:48,720 'cause they can now take advantage 266 00:11:48,720 --> 00:11:50,020 of these parallel displays. 267 00:11:50,020 --> 00:11:50,900 And it's kind of like, 268 00:11:50,900 --> 00:11:53,260 it's really the native way of how you talk 269 00:11:53,260 --> 00:11:56,020 to these displays is via these parallel interfaces. 270 00:11:56,020 --> 00:11:59,020 You have to go through extra work to talk via SPI 271 00:11:59,020 --> 00:12:00,500 or I swear to see. 272 00:12:00,500 --> 00:12:01,420 So yeah, so I'm excited by it 273 00:12:01,420 --> 00:12:03,240 because I like to do a lot of cool graphic stuff 274 00:12:03,240 --> 00:12:04,900 with these little computers 275 00:12:04,900 --> 00:12:08,580 and watching things load the display is kind of, 276 00:12:08,580 --> 00:12:09,420 it's like, oh man. 277 00:12:09,420 --> 00:12:10,240 - Sure. 278 00:12:10,240 --> 00:12:11,080 (laughing) 279 00:12:11,080 --> 00:12:12,640 - That's not good for a little video game. 280 00:12:12,640 --> 00:12:14,680 - Next up, one of the things that I'm excited about, 281 00:12:14,680 --> 00:12:17,260 and you were just talking about something related to this 282 00:12:17,260 --> 00:12:19,500 is you have a number of different ways 283 00:12:19,500 --> 00:12:20,900 that you can work with CircuitPython. 284 00:12:20,900 --> 00:12:22,740 You can plug, with most of the boards, 285 00:12:22,740 --> 00:12:24,820 you plug it in as the USB drive, it sees it, 286 00:12:24,820 --> 00:12:27,060 and you can edit the code.py right on there. 287 00:12:27,060 --> 00:12:28,300 There's the web workflow now 288 00:12:28,300 --> 00:12:31,220 where you can connect wirelessly and edit your code. 289 00:12:31,220 --> 00:12:33,260 You can do it via Bluetooth. 290 00:12:33,260 --> 00:12:35,960 Now you can do it on an Android device. 291 00:12:35,960 --> 00:12:39,620 They updated CircuitPython 9 with Android support. 292 00:12:39,620 --> 00:12:42,580 So you can plug in a CircuitPython 9 device 293 00:12:42,580 --> 00:12:45,400 and actually write to your code.py right on there 294 00:12:45,400 --> 00:12:48,660 and unplug it and your microcontroller will run the code. 295 00:12:48,660 --> 00:12:49,500 - Oh, that's so cool. 296 00:12:49,500 --> 00:12:51,060 Yeah, because on Android, 297 00:12:51,060 --> 00:12:56,060 you can do serial devices over the cable, right? 298 00:12:56,060 --> 00:12:57,180 - I believe it's over USB. 299 00:12:57,180 --> 00:12:59,100 - Yeah, yeah, 'cause I think that's one of the restrictions 300 00:12:59,100 --> 00:13:03,220 on iPhones is you can't do USB serial or something, 301 00:13:03,220 --> 00:13:05,740 but that's so cool. 302 00:13:05,740 --> 00:13:08,000 Yeah, 'cause we should be able to edit these things 303 00:13:08,000 --> 00:13:09,060 with a tablet, right? 304 00:13:09,060 --> 00:13:10,020 (laughing) 305 00:13:10,020 --> 00:13:11,480 - Right, we should be. 306 00:13:11,480 --> 00:13:14,780 But as you said, Apple's got all that market share, 307 00:13:14,780 --> 00:13:17,180 so not yet. 308 00:13:17,180 --> 00:13:20,060 - They prefer you to do everything via Bluetooth 309 00:13:20,060 --> 00:13:21,500 rather than with a physical cable 310 00:13:21,500 --> 00:13:23,940 for reasons that are only clear to them. 311 00:13:23,940 --> 00:13:25,020 (laughing) 312 00:13:25,020 --> 00:13:25,860 - This is true. 313 00:13:25,860 --> 00:13:30,780 Next up, let's chat about the ESP-IDF. 314 00:13:30,780 --> 00:13:33,220 - Ah, yeah, so this is because I'm a big fan 315 00:13:33,220 --> 00:13:36,540 of these WiFi chips, ESP32. 316 00:13:36,540 --> 00:13:38,820 There's a bunch of different types of ESP32s 317 00:13:38,820 --> 00:13:41,500 that are, unfortunately, they all have the name ESP32 318 00:13:41,500 --> 00:13:43,340 and they're very, very different. 319 00:13:43,340 --> 00:13:48,300 So like the ESP32-S2 is a single core WiFi only, 320 00:13:48,300 --> 00:13:52,700 but the ESP32-S3 is dual core with WiFi and Bluetooth. 321 00:13:52,700 --> 00:13:54,860 So it's just very confusing. 322 00:13:54,860 --> 00:13:58,780 But the underlying sort of code API 323 00:13:58,780 --> 00:14:02,320 that we all use to write software for these 324 00:14:02,320 --> 00:14:03,620 is called the ESP-IDF. 325 00:14:03,620 --> 00:14:05,640 It's an SDK that Espressif, 326 00:14:05,640 --> 00:14:08,580 the company that makes ESP32s, puts out. 327 00:14:08,580 --> 00:14:10,160 And for the longest time, 328 00:14:10,160 --> 00:14:13,480 CircuitPython was using ESP-IDF 4, 329 00:14:13,480 --> 00:14:16,160 which was like two or three years ago version, 330 00:14:16,160 --> 00:14:19,640 and it supported only a certain amount of chips, 331 00:14:19,640 --> 00:14:21,640 a certain number of the chips, 332 00:14:21,640 --> 00:14:24,700 and it only supported certain of the features. 333 00:14:24,700 --> 00:14:26,320 Most notably, we couldn't get, I think, 334 00:14:26,320 --> 00:14:29,520 Bluetooth support on some of the newer chips we like to use. 335 00:14:29,520 --> 00:14:31,440 And so through a big effort, 336 00:14:31,440 --> 00:14:35,520 similar to the effort of merging with upstream MicroPython, 337 00:14:35,520 --> 00:14:38,360 was updating the ESP-IDF to version 5, 338 00:14:38,360 --> 00:14:43,000 which enables CircuitPython to have new chip support. 339 00:14:43,000 --> 00:14:46,760 Like there's this ESP32-C6 coming out soon 340 00:14:46,760 --> 00:14:49,760 that I think has WiFi mesh or something. 341 00:14:49,760 --> 00:14:52,720 I forget, but there's all these new ESP32 chips coming out, 342 00:14:52,720 --> 00:14:55,480 and also it fixes some of the Bluetooth stuff. 343 00:14:55,480 --> 00:14:59,680 So we should have BLE support for ESP32s soon, 344 00:14:59,680 --> 00:15:01,480 which has been a sticking point. 345 00:15:01,480 --> 00:15:03,120 People are like, oh, you know, 346 00:15:03,120 --> 00:15:05,780 CircuitPython has such good Bluetooth support. 347 00:15:05,780 --> 00:15:09,500 Well, only for the Nordic NRF chips. 348 00:15:09,500 --> 00:15:10,340 - Right. 349 00:15:10,340 --> 00:15:12,340 And I'd caution you, 350 00:15:12,340 --> 00:15:15,660 I wouldn't say that expressive Bluetooth support 351 00:15:15,660 --> 00:15:16,860 is coming soon. 352 00:15:16,860 --> 00:15:17,700 - Oh, no. 353 00:15:17,700 --> 00:15:18,520 - Hopefully it's coming. 354 00:15:18,520 --> 00:15:19,360 - Yeah, no, no. 355 00:15:19,360 --> 00:15:20,580 It's like now it's possible, 356 00:15:20,580 --> 00:15:23,100 whereas before it wasn't even possible. 357 00:15:23,100 --> 00:15:24,020 - Right. 358 00:15:24,020 --> 00:15:25,840 So I don't want people to get their hopes up 359 00:15:25,840 --> 00:15:26,680 too much right away. 360 00:15:26,680 --> 00:15:27,500 - Yeah, yeah, yeah. 361 00:15:27,500 --> 00:15:30,620 But if anyone knows ESP-IDF and wants to help 362 00:15:30,620 --> 00:15:34,220 kind of flush out the Bluetooth support for CircuitPython 363 00:15:34,220 --> 00:15:36,260 for the ESP chips, you know, 364 00:15:36,260 --> 00:15:39,460 go to the GitHub and you can help out immensely. 365 00:15:39,460 --> 00:15:41,020 - Or join the CircuitPython Discord. 366 00:15:41,020 --> 00:15:42,760 There's a user, a community member 367 00:15:42,760 --> 00:15:45,500 working on Bluetooth support for the Pico right now. 368 00:15:45,500 --> 00:15:46,340 - All right. 369 00:15:46,340 --> 00:15:48,280 - Being done via community members. 370 00:15:48,280 --> 00:15:50,260 So, you know, which is a great segue 371 00:15:50,260 --> 00:15:52,220 to the next thing that I'm excited about, 372 00:15:52,220 --> 00:15:53,860 which is Connection Manager. 373 00:15:53,860 --> 00:15:55,020 - Yeah, what is this? 374 00:15:55,020 --> 00:15:57,700 I've only heard about it obliquely. 375 00:15:57,700 --> 00:15:58,860 - So from what I understand, 376 00:15:58,860 --> 00:16:01,340 and I haven't updated my wireless code yet, 377 00:16:01,340 --> 00:16:03,300 is they've standardized the ability 378 00:16:03,300 --> 00:16:05,300 of how you connect to Wi-Fi 379 00:16:05,300 --> 00:16:07,280 when you're instantiating the network 380 00:16:07,280 --> 00:16:09,560 on the microcontroller itself. 381 00:16:09,560 --> 00:16:13,280 So if you were using an airlift, you did it one way. 382 00:16:13,280 --> 00:16:15,780 If you did it with built-in Wi-Fi, 383 00:16:15,780 --> 00:16:17,180 you did it a different way. 384 00:16:17,180 --> 00:16:20,700 From what I understand, if I'm understanding it correctly, 385 00:16:20,700 --> 00:16:22,460 a lot of that code has just been simplified 386 00:16:22,460 --> 00:16:24,460 so there's one right way to do it 387 00:16:24,460 --> 00:16:26,740 and it figures it out for you. 388 00:16:26,740 --> 00:16:27,900 Don't quote me on that. 389 00:16:27,900 --> 00:16:29,300 What I think is so cool about it 390 00:16:29,300 --> 00:16:30,380 is a couple of different things. 391 00:16:30,380 --> 00:16:32,980 One, it's snuck in right under the release. 392 00:16:32,980 --> 00:16:35,620 But two, it was done by a gentleman by the name of Justin 393 00:16:35,620 --> 00:16:37,180 who's a community member. 394 00:16:37,180 --> 00:16:38,960 He partnered up with the core developers, 395 00:16:38,960 --> 00:16:42,940 figured out how to build CircuitPython, how the CI works. 396 00:16:42,940 --> 00:16:45,380 It was great seeing him get involved 397 00:16:45,380 --> 00:16:48,620 and it's great seeing that a community member's involvement 398 00:16:48,620 --> 00:16:52,580 resolves in a whole new library built into CircuitPython. 399 00:16:52,580 --> 00:16:53,420 - That's great. 400 00:16:53,420 --> 00:16:54,520 That is one of the nicest things 401 00:16:54,520 --> 00:16:57,140 about the CircuitPython team, 402 00:16:57,140 --> 00:17:00,860 the distributed global community that's working on this, 403 00:17:00,860 --> 00:17:02,580 which some of them work at Adafruit, 404 00:17:02,580 --> 00:17:04,220 is that they're very welcoming. 405 00:17:04,220 --> 00:17:05,460 It's like, oh, if you've got something 406 00:17:05,460 --> 00:17:09,060 that you wanna contribute, submit a PR, let's try it out. 407 00:17:09,060 --> 00:17:12,580 Yeah, I've created a couple different libraries 408 00:17:12,580 --> 00:17:14,940 and people are like, yeah, 409 00:17:14,940 --> 00:17:16,420 we'll put it in the official bundle 410 00:17:16,420 --> 00:17:18,180 that you can then use to, 411 00:17:18,180 --> 00:17:19,860 that anyone can then easily install. 412 00:17:19,860 --> 00:17:21,600 So, yay. 413 00:17:21,600 --> 00:17:23,900 I can't wait to try out this connection manager 414 00:17:23,900 --> 00:17:26,220 'cause that's always been the real bummer 415 00:17:26,220 --> 00:17:30,540 is that if you are using one of these Wi-Fi add-on boards, 416 00:17:30,540 --> 00:17:35,020 the way you started up the Wi-Fi was totally different. 417 00:17:35,020 --> 00:17:37,420 The way you got sockets and stuff was totally different 418 00:17:37,420 --> 00:17:42,340 than doing the ESP32 native Wi-Fi stuff. 419 00:17:42,340 --> 00:17:44,120 - And I'm not the most technical, so don't quote me, 420 00:17:44,120 --> 00:17:46,100 but that's my understanding of how it works. 421 00:17:46,100 --> 00:17:48,060 And I'm sure if I'm wrong, I'll hear about it 422 00:17:48,060 --> 00:17:51,260 and we can issue a correction notice next episode. 423 00:17:51,260 --> 00:17:53,820 - Well, that's how we get the viewer numbers up, right? 424 00:17:53,820 --> 00:17:55,280 Or the listener numbers up 425 00:17:55,280 --> 00:17:57,500 is we say something purposefully wrong 426 00:17:57,500 --> 00:17:59,300 so that we'll get more engagement. 427 00:17:59,300 --> 00:18:00,140 (laughs) 428 00:18:00,140 --> 00:18:02,100 - Oh, a little controversy for you right there. 429 00:18:02,100 --> 00:18:04,100 (laughs) 430 00:18:04,100 --> 00:18:06,140 Last up, we would be remiss if we didn't mention 431 00:18:06,140 --> 00:18:10,000 some of the things that CircuitPython 9 no longer supports. 432 00:18:10,000 --> 00:18:12,300 So there's a couple of things that have been deprecated. 433 00:18:12,300 --> 00:18:15,720 The big one for me personally is using display.show, 434 00:18:15,720 --> 00:18:17,900 parentheses, and then you would put your group name 435 00:18:17,900 --> 00:18:19,240 in the function. 436 00:18:19,240 --> 00:18:23,100 Now it's display.groupgroup equals the group name 437 00:18:23,100 --> 00:18:25,260 that you created earlier in the process. 438 00:18:25,260 --> 00:18:27,940 So that's a big one for me as I'm going through slowly 439 00:18:27,940 --> 00:18:30,580 and updating all my devices that have displays 440 00:18:30,580 --> 00:18:32,740 so that they work correctly. 441 00:18:32,740 --> 00:18:35,100 Next up is file system mounts 442 00:18:35,100 --> 00:18:37,220 need to be on an existing directory. 443 00:18:37,220 --> 00:18:40,140 So no longer can you have the drive blank, 444 00:18:40,140 --> 00:18:43,020 you need to manually create a /sd directory, 445 00:18:43,020 --> 00:18:45,100 for example, if you're using SD cards. 446 00:18:45,100 --> 00:18:49,460 - Yeah, that one, I'm not, even though, 447 00:18:49,460 --> 00:18:52,980 so as an old Unix nerd who knows that like, 448 00:18:52,980 --> 00:18:54,320 whenever you mount a disk, 449 00:18:54,320 --> 00:18:56,260 you must first create the directory 450 00:18:56,260 --> 00:18:58,080 and then use the mount command to say, 451 00:18:58,080 --> 00:19:00,040 put this disk at this directory. 452 00:19:00,040 --> 00:19:01,760 So it's always a two-step process. 453 00:19:01,760 --> 00:19:05,000 I really liked the old CircuitPython way of just like, 454 00:19:05,000 --> 00:19:06,800 hey, mount this thing at that directory. 455 00:19:06,800 --> 00:19:08,260 (laughs) 456 00:19:08,260 --> 00:19:10,060 It was so much simpler. 457 00:19:10,060 --> 00:19:10,900 - Sure. 458 00:19:10,900 --> 00:19:12,780 - But yeah, so now it's more in line 459 00:19:12,780 --> 00:19:15,580 with how real Python works, 460 00:19:15,580 --> 00:19:17,660 but I kind of miss the old way. 461 00:19:17,660 --> 00:19:18,940 - Yup. 462 00:19:18,940 --> 00:19:22,380 And speaking of being more in line with how C Python works, 463 00:19:22,380 --> 00:19:24,940 the last change is CircuitPython now requires 464 00:19:24,940 --> 00:19:26,920 explicit socket port reuse. 465 00:19:26,920 --> 00:19:27,760 - Yeah. 466 00:19:27,760 --> 00:19:28,580 - So you can see in the show notes, 467 00:19:28,580 --> 00:19:30,140 the actual command that you would have to use. 468 00:19:30,140 --> 00:19:30,980 - Yeah. 469 00:19:30,980 --> 00:19:32,880 - But that aligns to how C Python does it, 470 00:19:32,880 --> 00:19:35,100 which makes sense why they would make 471 00:19:35,100 --> 00:19:36,260 a breaking change like that. 472 00:19:36,260 --> 00:19:37,140 - Yeah. 473 00:19:37,140 --> 00:19:39,940 Yeah, I'm glad they're getting more and more close 474 00:19:39,940 --> 00:19:41,860 to C Python, to the desktop Python, 475 00:19:41,860 --> 00:19:44,300 'cause I wrote a networking library, 476 00:19:44,300 --> 00:19:46,820 a little UDP library recently, 477 00:19:46,820 --> 00:19:51,820 and I was able to support both C Python and CircuitPython 478 00:19:51,820 --> 00:19:54,220 with just a very small, like two or three line changes 479 00:19:54,220 --> 00:19:56,820 in the middle of like, basically, how do you get a socket? 480 00:19:56,820 --> 00:19:58,340 And I'm like, oh, this is nice, 481 00:19:58,340 --> 00:20:01,660 'cause this means I could do like almost all my testing 482 00:20:01,660 --> 00:20:03,540 on my laptop with no device connected, 483 00:20:03,540 --> 00:20:05,180 and then like just do the couple line changes 484 00:20:05,180 --> 00:20:06,540 and try it out on a CircuitPython device, 485 00:20:06,540 --> 00:20:08,380 and it all works. 486 00:20:08,380 --> 00:20:09,880 - Well, that's pretty cool. 487 00:20:09,880 --> 00:20:11,540 So lastly, I think we should give some credit 488 00:20:11,540 --> 00:20:13,220 to everyone who contributed 489 00:20:13,220 --> 00:20:14,900 to CircuitPython 9's development, 490 00:20:14,900 --> 00:20:18,140 who beta tested it through the long beta testing process 491 00:20:18,140 --> 00:20:20,700 that went on, who filed issues, 492 00:20:20,700 --> 00:20:22,340 who left feedback in Discord, 493 00:20:22,340 --> 00:20:26,340 who participated in the CircuitPython 2024 wishlist. 494 00:20:26,340 --> 00:20:27,740 It's a great community. 495 00:20:27,740 --> 00:20:30,020 That's why I did the CircuitPython 9 show. 496 00:20:30,020 --> 00:20:31,140 That's how we met. 497 00:20:31,140 --> 00:20:33,160 We're both still in the Adafruit community. 498 00:20:33,160 --> 00:20:35,580 So thank you to everyone who's had any part 499 00:20:35,580 --> 00:20:37,500 in bringing CircuitPython 9 to life, 500 00:20:37,500 --> 00:20:40,900 and thank you to Adafruit for sponsoring CircuitPython. 501 00:20:40,900 --> 00:20:43,280 - Totally, and if anybody is interested in like, 502 00:20:43,280 --> 00:20:45,540 kind of getting in and like kind of listening 503 00:20:45,540 --> 00:20:47,420 to the development process of CircuitPython, 504 00:20:47,420 --> 00:20:49,860 there's a weekly meeting via Discord audio, 505 00:20:49,860 --> 00:20:51,980 whatever that feature's called. 506 00:20:51,980 --> 00:20:54,120 You can join just to listen in. 507 00:20:54,120 --> 00:20:55,900 You don't have to present or anything. 508 00:20:55,900 --> 00:20:57,940 The core developers, but also people 509 00:20:57,940 --> 00:20:59,980 that are just like writing libraries and stuff, 510 00:20:59,980 --> 00:21:01,340 and you can listen in and see 511 00:21:01,340 --> 00:21:03,360 if you want to participate actively, 512 00:21:03,360 --> 00:21:05,700 or it's also good just to get a behind the scenes 513 00:21:05,700 --> 00:21:08,100 as to what's kind of coming up in CircuitPython, 514 00:21:08,100 --> 00:21:09,020 'cause you'll see somebody, 515 00:21:09,020 --> 00:21:11,580 like I saw that Jepler was working on JPEG I/O 516 00:21:11,580 --> 00:21:13,300 like three months ago or whatever, 517 00:21:13,300 --> 00:21:14,220 (laughs) 518 00:21:14,220 --> 00:21:16,220 and I was like, "Oh, I can't wait." (laughs) 519 00:21:16,220 --> 00:21:18,700 - Right, and that's where Connection Manager 520 00:21:18,700 --> 00:21:20,500 has been discussed in the Weeds section 521 00:21:20,500 --> 00:21:21,700 at the end of the meeting. 522 00:21:21,700 --> 00:21:23,140 So that's a great idea. 523 00:21:23,140 --> 00:21:25,260 It's Mondays at 2 p.m. Eastern. 524 00:21:25,260 --> 00:21:26,540 Check it out if you're interested 525 00:21:26,540 --> 00:21:28,540 in joining the CircuitPython community. 526 00:21:28,540 --> 00:21:30,340 We're members, we love it. 527 00:21:30,340 --> 00:21:32,480 I think that enthusiasm comes through, 528 00:21:32,480 --> 00:21:34,980 and thanks for listening to the episode. 529 00:21:34,980 --> 00:21:36,860 And I'm Paul Cutler. 530 00:21:36,860 --> 00:21:37,860 - And I'm Tod Kurt. 531 00:21:37,860 --> 00:21:40,900 - Thank you for listening to The Bootloader. 532 00:21:40,900 --> 00:21:42,260 For show notes and transcripts, 533 00:21:42,260 --> 00:21:44,220 visit thebootloader.net. 534 00:21:44,220 --> 00:21:47,420 If you use Mastodon, you can follow the show on Mastodon 535 00:21:47,420 --> 00:21:50,180 to be notified when new episodes are released. 536 00:21:50,180 --> 00:21:53,380 Visit thebootloader.net, click on the follow us link, 537 00:21:53,380 --> 00:21:55,380 and enter your Mastodon handle. 538 00:21:55,380 --> 00:21:57,780 Until next time, stay positive. 539 00:21:57,780 --> 00:22:01,140 [MUSIC PLAYING]