 Hello, hello. Hello, everyone. We're going to get going here. If you're watching this after the fact, you might want to take a look at the description for time codes. Thanks to David for putting those in there. That's great because we're going to take a few minutes to get going and then we're going to talk about a whole lot of different stuff. So know that those are there. All right, I'm going to pause these videos so it's not like watching a mirror back to me. I'm going to arrange my windows. So let me say some hello's. I'm getting a little glare off that. Maybe I should close that window. Hello, unexpected maker. Zarnlin. Hello. Hello, Tammy. Hello, Keithy EE. Hello, Oats and Honey. Hello, Dexter Starboard. Hello, Minnesota Mentat. Hello, Hamslab. Congrats on the new job. Is the volume softer than usual for anyone? Can you hear me okay? I don't think I changed anything on my end. It's a bit quiet. I could probably turn it up. It's close to me. I can turn it up a little bit here. Hello. Hopefully I'm not blowing you up. Maybe I bumped it. Hello, DeShippu. Hello, Theodorus. Hello, Electronic Enigma Zone. Is that too loud? Hello, David. Hello, Paul. And hello, Biana. And YouTube. I didn't get as much sleep as I normally get last night because I got up a little early. So we'll see what my brain does. But I guess we, a bit too loud. There. I turned it down a little bit. Hello, Cedar Rove. Hello, Dylan. Get used to no sleep. I tell myself that every night I don't sleep very well that it's only a matter of time before I really don't sleep well. For a much better reason than not getting to bed soon enough, though. It's under my control right now, so I don't really have a good excuse. Hello, Xmicron. Hello, Charles. Audio's perfect now. That's good. Okay. You know what? I'm gonna, I'm getting a bad glare. I'm gonna put these down. Like, I don't need to spend my whole time squinting any more than I'm already going to. My Discord chat is not scrolling. Hmm. Let me see what I can do to that. Ping the chat. Hello, King of North. Hello, Thomas. Looks like something came up. I think I, I think I got it. I think. One of those plants looks like a Pothos right, but what's the second one? My partner would know. She, she put those there. I'm not sure what they are. Um, and I'm confusing the camera because it's bright in here and I've got a black shirt on, so you know. Let's see how that goes. All right. Looks like it's scrolling. They look great and happy regardless. Yeah, she takes care of them. We have, she's gotten a lot of plants around the house. We'll see how, how it goes when we have a kiddo running around too or not running around. Um, all right. I'm six minutes in and I haven't done housekeeping yet, so let's start there. So, hello everyone. If you're new here, welcome. My name is Scott and I work on Circuit Python for Adafruit. You don't know what those things are. Circuit Python is a version of Python designed for microcontrollers, which are a little tiny and I always have them on my desk. Here's a cutie pie. So, here's a really tiny board here. Um, and the microcontroller is actually on the back and sorry for the, I should maybe make it brighter. So, there's a little chip here that has a full computer kind of all in one, which is super cool called microcontrollers. They're really inexpensive, which makes them a great way to learn how to program and how to interact with the outside world. Minnesota Mentat says excellent autofocus. Yeah, if you put it in the right spot and cover your face, it's not too bad. I can also put it on product showcase mode and it's, it's better there too. But yeah, it's still very happy with this camera. It was, it was a good call to do it. Um, if you don't know who Adafruit is, I work for them. They are an open source software and hardware company based out in New York City and they kind of specialize in designing stuff for, uh, beginners and hobbyists and getting people to learn, uh, or teaching people how to use electronics to do things that they want to do. Um, if you want to support me, uh, you can do that by supporting Adafruit. Um, by going to the URL, A-B-A-F-R-U-I-T dot com, Adafruit dot com. Um, and if you want to join our Discord server, which is the URL I almost told you, uh, that's the middle box here. Um, that's the Discord server. Uh, you can go to the URL, uh, A-B-A-F-R-U dot I-T slash Discord to join us in the Discord there. And the great thing about Discord is that it's a chat room that lasts all week long. It's not just with a particular stream. Um, so yeah, that's the Discord. That's the Discord that's chat. Uh, I'm there as Tan New. Um, this is a deep dive. It happened every week. Um, only a few more weeks for me. Um, there are normally Fridays at 2 p.m. Pacific. Uh, if you're also new here, I'm expecting our first, my wife and I are expecting our first kid at the end of next month. So I'm only planning on streaming for a few more weeks. Um, and then FOMI guy is the plan is for FOMI guy to start streaming in this slot on Adafruit. So we'll have a place here for folks, uh, as well. Or FOMI guy will carry the deep dive torch, even if it's not called deep dive. Uh, these go for typically two hours or more. Uh, and questions are welcome. We've got tons of time to cover questions. So if you have questions, I'll try to answer them. The other folks in the chat will, uh, as well. And we'll hopefully get you, uh, your answers, your questions answered. Um, so that's a deep dive. Uh, last, uh, next week is going to be on Friday as well. And then, um, all the notes for these deep dives that, uh, David is so gracious and kind of take, uh, they're available in a repo on GitHub, which is github.com slash Adafruit slash deep dash dive dash notes. It's a great place to search. And, uh, if you want to find a particular topic that I've covered, uh, you can kind of jump into the videos, uh, for that. So thanks to Patrick for, uh, curating all of those notes. And thank you for David, DCD for, for making and maintaining or taking those notes. I really appreciate it. So if folks have questions, um, go ahead and drop those in the chat. Uh, this is a very informal stream, uh, as those of you may know. Um, the other thing I was thinking of, and there's the link to the notes. The other thing is, uh, forget what the other thing is. Let me take a pause and drink some water. So I thought I'd start with a mail bag because I did get an Adafruit order, uh, today. So I work remotely for them. I live in Seattle. They work there in New York. And if I need to get stuff for the work that I'm doing, I make a free order off Adafruit and they ship me stuff. Um, and I got one this morning. I had almost forgotten about it. I like have a habit of checking for packages and, and found it out back. Uh, so I was like, Oh yeah, that's coming today. So I figured I'd start there. And then, um, I want to kind of wrap up talking about ESP, BLEE stuff. Um, I want to talk about kind of where I want to do some USB host stuff after that, hopefully. And then, um, I'll wrap up with not talking about Adafruit stuff, but Patrick had requested an update on my like civic world, um, which is the broadband advocacy stuff that I've been doing. Um, but first, before we get to mailbag, we have a question and sorry, David, for, for, uh, taking time for mailbag and then not actually getting there. Um, Zarnlyn asks this, or says, this is not an ESP 32 question, but about your work with the Raspberry Pi Zero, uh, W2. I installed circuit Python 711 on a Raspberry Pi W2 using multiple SD cards and hooked to multiple USB host controllers. My motherboard has four host controllers to choose from. I encountered three problems. When the circuit Pi drive is created, it's taking a long time and fails a lot. Uh, lots of USB disconnects in this world's results and lots of right read write errors. Change cables and Raspberry Pis. When you were working on this, did you encounter the same issues? Um, first and foremost, don't use 711. Um, 711 is pretty old for the Raspberry Pi stuff. So with the Raspberry Pi stuff, I recommend just using the absolute newest. Um, although Dan did just do a 720 Alpha 2 release. That's another place to start, but 711 is pretty old. So first try a newer version. Um, I did see that it takes a while and I think it takes a while because, uh, like the very first time it has to format the file system and I think it does, the time that takes does scale a bit with how big your SD card is. Yeah, so try the newest. It is still flaky. It's not perfect. Um, but I kind of like ran up against the wall as to fixing all the bugs that I was finding. I couldn't just, I couldn't figure them out. So, um, it's not perfect. We still mark it as Alpha. That's part of the reason. So, um, but yeah, try the newest. The 711 is pretty old. Um, I think I'll, and this is something that we're kind of in this hole right now is like, a lot of people do default to using the stable version, but there's a lot more subtlety to that because particularly new work, uh, goes into the newer stuff and the newer stuff is therefore works better. So if, if the stable version always, or if the stable version doesn't work, always try the, the newest ones. Like the only versions I ever use are the new ones. I don't, I don't really use the stable ones. Um, and we recognize that it's been a while since we've done a stable release. So we're going to try to get a 7.2 out. Um, we'll see about that. Dan, Dan was thinking of that and did the Alpha release. So that's a good, a good start. I think the Alpha release, we, we call it an Alpha really because we don't have a good handle on, um, what the major issues with it are. Like we haven't really kind of prioritized or talked about which issues are the ones that we want to fix before a stable release. Um, I know we've had a lot of churn on the ESB side. So that's probably the, going to be the source of the bugs that we want to fix before a stable release. Um, and that's all for the S3 and C3 support. Okay. Yeah, that's what Neridoc's pointing out to. So hopefully I answered your question. It should work better. Yeah. Raspberry Pi should work better with newest, but it, it's not going to be as good as other stuff. It's not going to be as good as other ports even, even then. Badabby says, I'm so used to using the newest version. It didn't occur to me to go back to the stable version when I squared C didn't work on the S2. And unexpected maker says, gotta live on the bleeding edge. All right. Let me switch to overhead and I'll show you the stack of stuff that I've got here. Um, yeah. When is the IDF never updated? Before the S3 stuff, we didn't really update it. It sat for a while. Um, okay. Overhead cats and cat detour. Okay. So here's a stack of what I got. And let me let the camera focus and it's upside down for you and it's upside down for me. So that's right. So if I turn this, it looks right to me and you can see it. So, um, the first thing that I ordered, um, that's kind of gruesome. Tammy says the problem with leading living on the bleeding edge is that blood stains are hard to clean out of the carpet. Yeah. You got to have, you got to be pretty resilient to failures if you're on the, on the bleeding edge. So first and foremost, I got this data cable, which is a, it's a USB-A socket. And then on the other end is just pin headers. And actually this, I got a second one. So, um, I'll show you a bit later that I've already got one. Um, one of these already, but the reason this is useful is because, um, trying to do USB hosts. So this is what you would plug like a USB keyboard into. So by having this on the other end, we can just plug it directly into a breakout board, which is what I'm doing. And we'll talk a little bit more later. Next thing I got is, uh, the, this is a multifunctional USB safety tester, which I found on Adafruit. And one of the interesting things is, yeah, um, one of the interesting things about USB hosts is that you've got to supply enough current to all of the devices that you're, uh, that are plugged into you. And so I thought it would be handy to have, this is like an inline current thing. So this will be able to tell me like how much total current like all my devices are pulling, which I thought would just be handy. I do have like a power monitor thing, but I really don't care for that fine grained of information. I just want a, an easy way of just seeing like what ballpark I'm in. And thank you, David. David has said putting links to the stuff that I'm showing here, which will work for a little while, but unexpected maker caught a glimpse of, of some of the other stuff that I got here. So yeah, the, the, I got some unexpected maker new stuff here that I haven't even looked at. But the last thing that I got that's in the store is this CP 2102. So this is just a USB to serial converter. And the reason that I have one of these already, but, uh, I, it took me a while to find it last time I needed it. And therefore I was like, I should probably have a second one. So I got a second one. They're really handy, especially for D get debugging the Raspberry Pi where you have just like a UART that's spitting stuff out. So I just snag the second one just to have. So that's, that's the stuff that's in the store. And then I was going to get that USB A thing because I was wanting to work on USB host. And Phil also mentioned that unexpected maker had sent some goodies to Adafruit before sending enough to sell so that they would, they would have a copy and I would have a copy. So thank you unexpected maker. I did not purchase these. So take, take everything I say with a grain of salt, I guess. But what we've got here is a feather S3, a tiny S3 and a pro S3. So I figured we'd just open these up and take a look at them. So let's take a look. So I've been doing a lot of S3 work and this, this will dovetail nicely. I'll talk about the S3, the work that I've been doing. And I have a demo that I think I want to try too. So here's a rundown of it. And that's right unexpected maker doesn't tend to use, it would desiccate it back in. Right. So unexpected maker doesn't use modules, which is interesting. So these are with regular chips. And so I was going to say, oh, it's just this module. So what do we have here? We've got the dual core. So this is a ESP32 S3, which is dual core 240 megahertz, run circuit Python, obviously, Wi-Fi, BLE, 16 megs flash, 8 megs PS RAM, USB, USB C, and power protection, two regulators, RGB LED, ambient light sensor, VBAT and five volt sense pins, lipo charging, lipo connector, and optimized for low power, which is super neat. And it's one thing I'm excited about is that it's got the Stemacutee port, which I do not, the expressive deadboards do not have. So this will be nice for that. Make something unexpected. And then I guess I could do, let me just show it on this camera as well. Let's showcase the product, shall we, since we like these focuses. Is that better? I think it's too close. It's all dark, pretty dark in here. These cameras. The black shirt confuses it. So that's the Feather S3. It's Feather Form Factor. That's one of the three boards. And I think Unexpected Maker said that this is a new series from him. You can go to ESP32S3.com. That's a good, good snag. So that's the Feather. Actually, let me leave the board itself out. I'm sure Unexpected Maker has shown them off next to each other before, but I'll do that too. I don't know if I actually have all of the form factors from Unexpected Maker. Oh, two Stemic Connectors, one for each regulator. So the second one has user-controlled power. Interesting. That's the first board I know that has two. Okay, so here's the tiny one. I'm not going to, oh, it's 8 megs flash instead of 16, according to the breakout thing. Oh, and it's got a, so here's what it's got. So that's a tiny S3. And then one thing that's interesting is that it's also got a battery connector that you can solder on if you want that would go here. So if you do want a battery power it, then you can do that. And that's 8 megs flash instead of 16, but it is 8 megs ram as well. Hey, Michael. Hey, Johnny. Hey, Bruce. And hi, Anessa. Todd Bot says, USB host in the title, oh my. We're not there yet. Not there yet, no. Okay, that's the tiny one. And then the pro one. So this is, I just got these today, so I haven't actually set up any demos from yet. Oh, and of course, I'm not on the right screen. Pin headers for size. So there's the feather, tiny, which my cable's out of the way. First thing I see is a spammer. I will, I'm ready to block people if need be. Mailbags are so funny. Yeah, thank you for commenting that overhead is off. Okay, so the last one that I got is this pro S3, which I'm not actually particularly familiar with what makes a pro a pro. So let's take a look. So it's like skinnier than a feather. It's equal pin headers along the side and it's cast-related. So you'd be able to put it down. There's nothing on the bottom. USB-C again, which is neat. There's a battery cable, but the battery cable has a bigger plug on one end than the other. So that's probably like a way to make it a bit smaller. Pretty standard pinout stuff. And then this is 16 megs of flash again. Microblade, lipo, connector, cast-related headers. And look at that. Circuit Python. Neat. So there's the three unexpected maker S3 boards. Thank you, Seon, for sending those to me. Um, I have no excuse to not fix any bugs that come up about that. These might be the first boards that I have with 16 megs flash. So I assume you, I know you've tested them as well, but those are the sort of things that are actually quite handy for me for testing if I need to. Umut says, can I follow this stream for USB host on PyPico as well? Uh, yes, that's what I want to talk about later. Um, but I was going to talk about the USB BLE stuff too. Or the, the ESP BLE stuff first before I get to the USB host on PyPico. The ubiquitous bananas needed. I don't have bananas, but I do have a box of cookies. And it's way bigger. Should I, should I compare it to a cookie? These are kind of small cookies. I don't think they're a good reference. Um, Zarnlin says, I got some of the Citroen Nano RP2040 boards, which are really cool too. Pro has ESD protection as well. Um, Kraton says, hello, says recently bought the Pico from Adafruit. Love the little thing. And then immediately regretted not seeing the RP2040 feather will definitely buy when I figure out what to do with the Pico's. Yep, I feel ya. I'm definitely more of a, definitely more of a feather person, which we'll see a little bit later. Umut, let me know if you can't watch the whole thing and we could skip ahead, but I thought I would show some of the BLE work off first. And perfect. This will be my, should I arrange these real nice so I can use them as my thumbnail? That could be one of my thumbnails. Cool. So those will go in my giant collection for, um, giant board collection. I split them up by, like, product. Generally, don't send me dev boards, but unexpected maker is always out in the front with them. Too many good boards is a good problem to have. I only have so much space to store them all though. I'll tell you that much. Okay. So next, where is unexpected maker? Unexpected maker is in the Discord chat. Um, maybe not on, maybe not on YouTube. All right. Like all, like all my, uh, mail bags, I've successfully thrown everything on the floor. Uh, okay. What else do I, I have for my demo. So I was kind of in the weeds of BLE last week and I, wanted to show off that I, what, it wasn't last week. It might have been the week before, or even the week before that I was doing, I had started converting the, the broadcast net bridge code over to, uh, CircuitPython native. And so what broadcast net is, is it's a, it was a very simple, I like sensor data collection framework that just uses, send you a new storage box as well. I don't need, I've got storage boxes. It's fine. Um, the main thing is like packaging. Like, I had a ton of digi-key stuff that was in bags and reels and stuff and getting all of that stuff out of the packaging into smaller containers was like a huge difference. Um, okay. So I wanted to show this BLE broadcast net demo off. So broadcast net is, uh, BLE uses BLE advertising to transmit sensor data. Um, it's unencrypted, so it's like not secure. So don't use it for anything sensitive, but if you're just emitting a temperature reading, like I don't think it needs to be secure. Um, there's no like control aspect to it. It's simply just broadcasting data. So, um, the way that it used to work is you'd use NRF 52 boards and, um, you would have them read a sensor and then broadcast out. And then there's a bridge that's involved. And the original bridge was a Raspberry Pi running Linux, which would do, uh, BLE scans. And then when it heard the advertisements that have sensor data, it would automatically, um, it would automatically then like write those to Adafruit IO feeds. Um, that's really hard to maintain. Like I'm letting a full Linux stack is hard to maintain. And it's kind of hard to know that it's working. So, uh, a few weeks ago, I don't remember exactly when I was like, oh, you know, once, oh, once we got BLE scanning working on the ESP 32 S3, not the S2, but the S3, um, I was like, okay, great. Now we have enough working that we can actually do this bridge stuff in an ESP, which is way simpler. Um, so I wrote that code. There's a pull request for it. Let me switch to the desktop here quickly. Um, I think if we just look at, I have a new keyboard, which I should talk about as well. Um, the bridge example. So here's a new thing. So Daniel says, can an iPhone work as a BLE key for our IoT devices? Key like authentication key. I think that's an interesting question. I don't know exactly what your, what problem you're trying to solve. Um, but generally like if you need some sort of authentication, yeah, the keyboard sounds mechanical. It's definitely a mechanical keyboard. I've shown it off before, but I actually started using it the last couple of days. But yeah, you should be able to, you should be able to use an iPhone to like get a security key onto a BLE device. But in this case, that's not what I'm doing. So this is the BroadcastNet bridge stuff. So it's in a PR if you want to follow along. I don't know if folks have actually done the BroadcastNet thing. It was kind of a pain with the Raspberry Pi. So it's a lot simpler now. So oh, for example, unlock your house. Tend, it tends to not be BLE. There's also a technology called NFC, which is usually used for like tap to pay is usually NFC not BLE. I'm not a great person. I don't know a whole lot about that. By the sound I would guess cherry blue. That is not true. These are their browns. But we're getting ahead of ourselves. We're not talking keyboards right now. What do I want to pull up? Do I want to also pull up? Oh yeah, you can see all my keyboard stuff here. I think I can log into my feeds. So let's just view all my feeds. And you can see that there are some feeds here that were 22 and 23 hours ago. And actually let me switch over to this. Let me say some hello's. Crotone says, any idea what's going on with Raspberry Pi and the stock shortage that seems to have created 50 plus dollars Pi zero a thing? That's I, Adafruit doesn't really have a lot of insight into Raspberry Pi stock supply. It's kind of basically when we get them, we sell them. So I think that's better to ask of Raspberry Pi folks. Johnny's S3s are in the mail. And Mr. Align says, great seeing you. Hello. You did the BLE bridge with AIO BLE or similar or all async IO. It's not AIO BLE. It's not it's not MicroPython stuff. And it's not async IO. But are the BLE IO library is actually kind of asynchronous already. Let me just show you the details since I haven't pulled up. So if you look in the code here, there's some helper functions. But the core scanning stuff is a let me close this and make it bigger. So the core of this bridge is this start scan. And what start scan does is it actually it returns an iterator. So it's asynchronous in the sense that like, it will just yield you measurements as you go along. So it's not either of those things, but it is kind of async still like scanning and advertising still happens in the background. We have start calls and stop calls. And you can get data from that. So like scan, start scan here will return a scan results object, which is an iterator, which will give you like individual things. But there's more to it because it's doing measurements. Anyway, it is asynchronous in the sense that you can like process things as you get things in. So let's start it up. And so many different things. So many different things. Okay, so let's plug in this one. Don't flip over on me. So let's connect to that serial usb, Espresso. And I'll just hit reset so that we can see the, or I guess it controls it. Control D is really slow on this. And I don't it's weird. So this is what I'll tell you it says like, Oh, this is my IP. This is my bridge address. So it's like seven CD. And then it knows what feeds were already created on Adafruit IO. So if we pull up Adafruit IO here, we can see that there's this group called seven CD. So this is a group of measurements we got from a particular sensor. And these haven't been seen for a while, but I've actually got them on my desk. So let me plug them in. So I've got this blue fruit here that is just reading the core temperature and broadcasting it out. So that's this FAB. So if I plug this in should turn on and I don't this USB. So now it's purple. I don't know if you could, I don't know how well that showed up. I've got my LED plastic if I need to put it on there. And it didn't ought to refresh here. But if we refresh, we can see that now this has been less than a minute ago. So if we have temperature, you can see this is yesterday. And then this is the sample that it just broadcast out. So the the NRF that I just showed is broadcasting, Hey, here's my temperature. The ESP is listening for that. And then it's logging it to logging it to Adafruit IO. And this should what I have this doing is that the the Neopixel blinks when it hears an advertisement and and then reports it up to Adafruit IO. So it's not like super fast. But as it's doing that stuff, it still will be scanning. At least it should be. So there's one. And then I have this is a ESP 32S3 that if I find I've got too much stuff on my desk, there's another power plug. Come on. That's USB C. Let's see. Oh, here we go. Here's a B. Okay, so I'm plugging in this one. And let me I don't know why this USB cable insists on being flipped over. But I have a solution. So if you don't know one thing, another thing that Adafruit carries is called this. It's like LED plastic. So it's like suit for like pretty opaque. And it's great for Neopixels on camera or LEDs on camera. So I'm going to flip it over. And then I'm just going to put this on it. And hopefully it'll hold it down. So you can't see the board. But you should be able to see the blinks. Yeah, see, so there's a purple. And so that was hearing a report from this purple guy from the nrf. And I'll just put my hands on it. And it's running code right now that only as temperatures change will it actually broadcast. It's meant to like save power. So what I'm doing here is I'm holding it with my hand to try to heat it up so you can see it's broadcasting a lot. And then let me plug in this ESP that I just showed and it's got just it just sends it just sends the temperature value 40 over and over and over again. So hopefully we'll see a different color blank here if that code's working. Which maybe I was using it for something some other day. Doesn't look like it's working. Maybe it loaded something else on it. Or I broke it. It blinked okay. And it showed up. Oh, I missed it. So this is the output of the bridge. So it will tell you what it logged. Yeah, there's a green blink. So correct. So unexpected makers says sorry I was at the pick in place. So the background Billy scans are non blocking. So circuit Python user code is not interrupted. Correct. And the results of the scan are buffered. So there's a like a primitive first filter pass based on the contents of the advertisement. And if it passes that filter then it will be queued so that you can go through it later. You know a lot of what circuit Python native code is all about is is about making it so that you don't have to worry about timing and Python. It does all of the like buffering for you. Which has the converse effect that it's like not particularly good for doing timing sensitive stuff. Hi Bjarke says I just finished making a home VPN. Good work. Okay, the one thing I wanted to point out I thought this was a really interesting use. So I just wanted to call this out. What you what you see here is that we're kind of blinking two different colors. And this is what I wanted to be able to have different colors to know like which sensor I was hearing. And one thing I had a problem with with the Raspberry Pi version of this is I couldn't tell whether it was working or anything was going on without pulling it up on my on my computer like the charts on my computer. So the nice thing here is that like because I have things broadcasting and like a semi regular interval it like kind of tells me that things are still working by just by the blinks. And I thought it would be cool if like automatically it would blink a different color per sensor so you could kind of get an idea of which sensors it was working with. So I didn't hard code these colors. I thought of this neat trick that I thought I should share with you all so here you can see that we're starting to get more stuff into our feed here. I don't know how to I don't know if there's a way to tell it. I found this hilarious because it like live loads you can actually get like more than 100% loaded. It says 129% loaded because it started a particular amount and then it adds the new ones to go over 100% which I thought was kind of cool. So the trick I did for for picking the color I thought was really clever and clever is not always a good thing but here's what I did. So circuit python now has rainbow IO as a native module and typically this is used for LED animations where you see like the color swirl like the classic color swirl and so we have rainbow IO and then dot color wheel and what you can give it is you can give it just a number and it will produce a color for you and it changes every it repeats kind of every 256 values but so what I'm doing is I'm just taking the bealy sensor address which is what reversed addresses and then I'm just adding them all up and then passing that number into color wheel to get a color and then I'm setting the status neopixel to that. Yeah making sure it's an int. I don't actually make sure it's an int. I don't know if it's you can fully appreciate how cool this idea is but the thing I did first was actually I took like it's six bytes and I took like certain bits out of those six bytes and I just like smushed them together to get an RGB value but the problem is that it was really hard to distinguish the two values because inevitably three components end up being like kind of all the same so it's what the what the neopixel ends up looking like is more like a color white like different shades of white because you're always getting three of the components and so this is a really neat way using color wheel which is built in so it's not a new library so given just a value that is hopefully unique but may not be you can get a color that's like reasonably easy to distinguish from other colors so I was pretty happy with how that worked and because these addresses are stable the colors are the same like every time you open it up because the sum will actually be the same thing of course if you don't keep a consistent address it'll still work their colors will just change so I thought that was a pretty interesting like color wheel is so commonly used just for animations that I thought this was a really neat really neat use of it as a way of like encoding like unique devices talking to a central thing yeah so this is the native bridge is now in it's not in the library yet but it's a pull request so if broadcast net is something interesting to you there's a learn guide for it as well that john park did but it's like I said it's pretty complicated given that you have to use a raspberry pi as is built to code says neat visual representation of a hash code yeah and dinglebird just sent a rainbow which is perfect um yeah let me see if I can't I don't know how often it's been blinking here but you're watching it not me gamma game says color wheel is handy I used it for time dot monotonic nanoseconds to get a nice rainbow loop and processing audio there you go and that's what Todd bat was talking about too Todd bat was using it with time nanoseconds or time monotonic not even the nanosecond version um there was a green one so yeah I was like what I'm trying to do is wrap up all this be least stuff so that I can move on because it's been kind of a slog one of those not getting purple ones in that's the other problem but at least you know you could see it did just get one actually um yeah so I just wanted to show that off this is the guide for it this beley sensor nodes thing um and like it's really complicated like if you look at these instructions to get the pride bridge going like because so the esp 32 s3 is the first circuit python native board that has both beley and wi-fi I think this is one of the reasons I was really excited about it before then we had to use a raspberry pi which is not simple which is what these instructions are so making an i'm alive led that's a great idea um so yeah hopefully we'll update this guide with this simpler bridge once it's committed and once we have an s3 in the shop I guess we have the expressive dev boards in there but we'll see um so that's a piece of it another piece of it is it I did get packet buffer working so if you look at um it if it beley I have a pull request for packet buffer test examples and let me talk about this a little bit um so here's the client so so we have like I talked about earlier circuit python really tries to be a let me switch to circuit python really wants to insulate your python code from having to be uh time sensitive and with beley we do like we provide kind of two primitives to do that well three the first one is regular characteristics where you can just get whatever value was was uh most recently set and so that's kind of like a buffer of one where you're always just getting the latest value but then there's tricks that people have played with uh with beley where they actually send a stream of values and you want to kind of buffer the whole stream think of it a lot like a u art um and so that is a we have a characteristic buffer uh which kind of like smashes all the characters it gets together and just treats it like a u art um and then lastly we have packet buffer which uh does the same thing as characteristic buffer except it keeps the boundaries of the packets in case like packets are defined as like different positions matter differently um so packet buffer is useful for that um okay unexpected baker has a couple questions um do you have wi-fi always on and connected to the router and do you know your current use when you're current use when you're scanning and sending with wi-fi um I do have I'm not doing anything fancy with the wi-fi so it is always connected and I don't know the current um I don't really care because I'm assuming that this bridge is powered I wouldn't necessarily assume that about the nodes that are advertising but like I'm coming from a world where it was a raspberry pi so I'm expecting that the bridge is uh I'm expecting that the bridge is powered so no I haven't looked at it I'm not doing any sort of code changes to to reduce power use um heartbeat slash watt dot watchdog indicators are always a good idea for almost every project I'm a fan of tacking at p8 so under the fpu board too um yeah so packet buffer is actually really handy uh for uh scenarios where you're like potentially getting a stream of packets that are like very variable size buffers or you just need to make sure that you kind of keep them all together so packet buffer I think is used in um beally midi I think it's one thing that packet buffer is used for I think that's the primary reason I added it so I wanted to add client support for that so let's just quickly go over the code here um we can see there's an outer while true loop we've got this buffer um so first we say oh if we're connected to anything and any of the connections has a packet buffer service in the connection um then we know we're connected to something that can do what we want we look through the connections again and find the one if it doesn't have packet buffer we don't care and then we print echo and then we find the service so this is how you get with beally IO this is how you get a service object for a to be a client of it so you could say oh connection do this like dictionary style thing um it's a little funny that this is this the key is actually the class itself but it's actually really handy trick um because we actually use this to like instantiate it I think um so that gives us pb is now a packet buffer service object that's related to the service on the other end of the connection and we can just call dot write with a write buffer so this is sending the three four characters echo um all together is one and then we read into a buffer uh that packet back and print it off and we use read into so that we minimize our memory allocations and so we have to give you back how much we actually read into the buffer which is why we're checking it here and then also this is actually a memory allocation here I did all that work only to print it out again but you don't always need to print out just the the buffer so that's kind of half of what this client example does so if you're connected that's what you that's how you connect to a service and then the other half is if you're not connected what you do is you do a scan so this is like very similar to what we did before but um I should have said that what we do is we you provide the advertisement type that you care about and that means that the bealy io inner workings will only buffer advertisements that match that type of advertisement um which is a great way to just ignore a bunch of stuff because there's a lot of bealy advertising that are that's happening all around you that I if you've never looked at it it's kind of wild maybe I should just show you so uh I think I've covered this before ages ago but let me just emphasize that fact so um here's my phone let me switch to you overhead and maybe I should use circuit Python for this anyway but here's my phone and this is the nrf app and I just pulled up to refresh so it's scanning right now and you can just see so udm is like my wi-fi router eave energy is like a power monitor thing I don't own a samsung tv but somebody's samsung tv is broadcasting out there's eave energy this lyws thing is like this temperature sensor here there's something google there's another eave energy my ipad like another uh samsung monitor another sensor hatch baby grow which is like my sound my headphones which are sitting here my apple tv like bealy advertising a circuit python device so this is actually this is interesting this is um this is the broadcast net advertisements that my phone is picking up as well so they have manufacturer data that encode all of the temperature stuff so you can actually have multiple things listening for it so point being there's a lot of stuff that's that's going on uh in bealy scanning world and so having that first pass uh that start scan does for you is really handy um so you don't have to buffer a whole bunch of stuff that you're just going to ignore um you can do you can do a first pass which is great um so that's what this is and then again you skip all the advertisements so this is getting more detailed so if the services that are provided are not the ones we care about we continue otherwise we try to connect uh to the advertisement uh or to the thing that advertised that then we say connected and we go around the loop we stop scanning in the go around the loop so that's the client code i thought i would talk about um i don't know if i've ever covered this and i should write a guide for it but i don't really write guides very well so i thought i'd cover it here um and the question is how do you make a custom bealy service uh and it's really kind of weird how we do it in bealy i o but i like it um and this kind of made me revisit it again so first and foremost 10 what you tend to do is you have a kind of base uu id so uu ids are are unique identifiers that are associated with a service a characteristic and descriptors for it um what i like to do is i like to use a d a f o a d a f as a prefix and then these two zeros here um are where you put a unique number and then i encoded the rest that says packet buffer so that's my unique id they say you should actually use random numbers but i kind of enjoy making it words um so first i have this packet buffer uu id that just takes the 16 bits that are going to be unique and the rest are the shared across everything so that's kind of your framework for unique ids and then um packet buffer is weird in the sense that you can't just read and write it directly you actually want like this object to to fit in here so a packet buffer characteristic is a complex characteristic which means that when it's created you learn stuff about it but then it gets bound to a particular service uh kind of the first time you access it or at some point so it kind of gets replaced and what do i mean that so so here's the service itself and this is why this api is weird but i like it so the idea is that you have one object that can work in both ways as both a client and a server and those details between those two things are like we try to hide them all from you so first we give it a unique id which is just by setting this top-level property or attribute of uu id so we instantiate our packet buffer uu id with the zero one uh 16 bits in the middle and then we're going to make a second entry that's packets which is a packet buffer characteristic um and then we give it the zero one zero one uu id and then you so that's so these constructors actually get called when the class itself is created which is kind of weird so this is using a thing in python called data descriptors and it's a weird way of if you've ever used properties to say like at property call this function for this thing it's a way of factoring out those kind of functions further and in reality that's what property actually does as well so when the class is created these constructors are are made and then these things are set and then what service will do is when you create an instance of it so so that's like the dunder init it will actually so complex characteristics like packets the object that saved the packets is actually replaced this packet buffer characteristic is replaced by the packet buffer object itself which then you can so you can do self dot packets read into and write which is the api for packet buffer so i know that's complicated i don't know if anybody's following along and has questions um but the the goal with this this kind of weird api is that you declare kind of what your service is and then it's like pretty straightforward to to use it um simpler cases are where like if you would just say like packets equals a string characteristic you'd be able to then just say like packets equals string or like print packets and that would tell you what the string was at the time but this is a complex characteristic which means it gets replaced by a separate object um and then on i guess i should for completeness so this is the server side so you say oh i want the radio and oh i want to i want to provide this service to everybody who connects to me um and i want to advertise that so i'm saying i'm going to advertise that i have this packet buffer service um i'm storing a buffer array so i start advertising and then i just wait until i'm connected and connections will just stop advertisements and so by the time we pass here we know that we're connected and what we do is we just read the next packet and then if it's greater than zero we uh create the new packet and write it back print it out and write it back and we just keep doing that while we're connected so that's the server side of packet buffer service so i thought this was kind of a good like self-contained example but it's not a it's more complicated complicated than a simple example would be because of uh the complex characteristic okay so that's Billy um um and i can clearly see that people are all very enthused by that and this is still going which is cool is that character this for characteristics so this complex characteristic is a thing that is done by the billy library they're all characteristics under the hood so if we look at billy and we go in a fruit billy characteristics and a knit we have this this python world characteristic which kind of wraps around the done the underscore billy i o characteristic you can see it actually stores one i was right i was up i was with you up until right after you said hi i'm scott yeah it's a deep dive for a reason you don't have to feel bad for not being able to follow along um yeah so this is the billy i o version it does fancy binding stuff that generally just works the data descriptor part is this getter so if it's a basic characteristic like this would be what it does is it says like oh let me get the value with the given service and then it can get it from the underlying thing so it just does like the david the characteristics api you link to allows you to just do this dot value and the dot value right uh but complex characteristic is does the binding a different way um so the getter says like if service is none then we return ourselves otherwise we bind to we call bind on our subclass and then we set the attribute of the service given the field name back to that thing it's a lot of python magic i will give you that but you don't necessarily need to know how it works to use it and it works pretty well i think like the the code is really clean being able to just say like all right now i want packet buffer so then you can do things like we have struck characteristic where you can just say like here's the struck format and it packs and unpacks the value reads um by overwriting get and set here and then if you look here we have like basic int ones as well so we have int characteristic we've got int 8 u and a int 16 so you can make make it really concise to declare things so if we if you look actually look in services and then standard this device info is much more basic where you can see the device info service is just a bunch of fixed strings so on this service you can just say model number equals or read model number and it just works which is kind of wild i think i think it's kind of wild um zonlund says i download the two files from the s3 the uf2 and the bin i need to write the bin first to the s3 when it should boot with a bootloader directory where i drop the uf2 file in is that correct um i'm not sure i'm not sure if the s3 has uf2s on it i've been loading it using make the make file i bet that unexpected makers boards have uf2 on them already the way to get in that is if you hit reset and then hit boot so if you hit reset and it's purple for a little while that's when the the bootloader is waiting for you to get into it um that abby says is there an example of of this being used uh yes yes maybe there are examples in in this beli library there's examples um if you just look in examples here like if you want to see how to use device info service there's this so and this use this actually does both sides of device info service i just added this to be fair um because somebody was asking about it so you can say here's my info construct it tell it what my manufacturer name is and model number and then um once you're connected so anything can connect you to here once you're connected you can get the other devices device info service and print out its manufacturer model number um somebody was asking about being able to determine what's connected on the other end of it i this is thomas was asking for this we're like i want to know whether i'm connected to an iphone or an ipad for example this example will the model number is different so it will tell you whether what you're connected to um i'm looking for where to learn more what are some other python search words so this the the term for the complicated get and dunder get dunder set is called a data descriptor um it is definitely the kind of weird corner of python um this is probably what you want to look at uh wrong i can't decide where i want control versus delete which has caused some problems for me so there's there's that yeah so and then like all of our bili libraries are built on top of this fancy stuff um so yeah i would i would look at the bili libraries i don't think that there's been enough people like a lot of people haven't kind of built on top of it because i haven't done a great job actually documenting it um kevin is there a way to make the raspberry pi zero run circuit python the same way the pico does i'm trying to use usb hid on the zero but it won't work and pico runs too slow you're in luck it's not super reliable so that's the caveat but if you go to learn.com learn.adoford.com and do raspberry pi very pi not this this involves linux but i wrote a guide uh how do i find it i know i said no os there we go circuit python and raspberry pi no os um we do build regular circuit python for um proper raspberry pies it's early it may not work but if it does work the hid stuff should work as well um and the pi zero pi zero or the zero zero two are probably the best platforms for that oh complex characteristics is a bili library thing it is not a bili spec thing it's like something i came up with um yes zarlane if you want the u of two bootloader you do want the usb connector but i'm not sure whether the board that you have that you have has it installed already because it's not baked in but yeah complex characteristics is a concept for the bili library only that i came up with all right well we have lots of topics today let me we i wanted to get to the bili do i want to talk to usb host let's talk about usb host um let's do that first so let me zoom the overhead out and show you the setup that i've got here i'm going to unplug this thing that that insists on being there so let's go to the overhead oh wait let's go here first so this is all my keyboard stuff so there's this really cool thing that somebody did they got um they got the raspberry pi pico doing usb host using pio so there's been a few examples of doing usb host from the usb peripheral on the on the raspberry pi itself um but this person managed to get it working um without using the usb peripheral which the reason that's so cool is that you can tim says tab groups for the win a hundred percent um i guess i i do use tab groups but i turned off i turned off i this is kind of like a small screen for me so i turned off the the tab hierarchy thing um tab groups might be something separate anyway so this person uh secigum gonok uh not sure that's right um did this really cool thing so let me just play this quick video um there's no audio so you're not missing that so this is a raspberry pi pico that's acting as a keyboard and then they're plugging in another one of the same thing and so the first one is acting as a usb host for the second one and then they had a third one and the third one acts as a usb host for the third one triple slit keyboard and then they put a trackball on it with a this receiver here so like this is really neat um this is really cool it's a usb host as a second usb kind of peripheral for the raspberry pi and i should say thank you to 18 makers for pointing this out i think we had seen it before that but it's always good to hear like see if multiple people like recognize cool stuff like this so um so this is really neat um you know a lot of what circuit python does is all about usb and so being able to be a usb host would be really cool we talked about this a little bit prior um when we were talking about broadcom like the raspberry pi and being able to do uh usb host so that we could kind of take keyboard input directly into circuit python and have a standalone experience so i've been thinking about how to do that um i've been thinking a lot about keyboards um which we'll talk about we can talk about too um but usb host kind of dovetails right into that uh figuring it figuring it out so i just wanted let me just show and here i have like a key puller as my that i'm fidgeting with um let me i got this working so that that was my goal kind of this week not this week today my goal today before next week was to start i don't like to get into huge projects on fridays um but i i can like do pre-work so here's what i've got go to the overhead oh and you can't buy usb host i see is at the moment interesting i'm not aware too aware of what you can or can't buy uh overhead i'm not used to doing overhead let me hit this button to get it focused hopefully did that focus better oh wow look the color change because of the window okay so here's what i've got i've got a feather rp 2040 this is the copy of the this is the thing i showed earlier that has a usb a on one side and then i've got it plugged just directly into the feather here where i'm taking red is power so that's power from the usb so that's five volts i've got ground and then white and green are plus and minus which i don't remember which is which so don't take my word for it uh or like check your work before you do that so i've got this thing uh let me switch to desktop overhead and see if i've got yep i've got this is where i restarted so everything's been messed up dev serial by id and we want the raspberry pi pico because it doesn't know it's a feather i guess i don't have a pico on my desk so it's certainly not that um and then what i've got here and the reason that i'm having trouble finding everything is i've got just a oh you can't see i've got a mouse i've got this old microsoft mouse it's still optical it's not not super super old and what i'm gonna do is i'm just gonna take that and i'm gonna plug it in and we can see here that we got a root zero connected device zero there are some failures but then some control stuff worked it got a report descriptor and i think if i yeah so i'm clicking the button and we can see the reports i can do the scroll wheel backwards and forwards or whatever the other button this button and then i can actually move the mouse as well so this is the example for that repo of just dumping the the usb information which is very very cool i did make the mistake it might be a mistake of i have a usb logic analyzer this beagle 480 and it can keep track of what's going on through it and there was a lot of errors unfortunately i think it might be because this demo is doing so much printing that might be the problem so so one thing that's interesting to lady aida is having the ability for us to do this from circuit python it's super early and i make no promises but it could be really cool i've thought about how you take keyboard input and what you do um could that be used as a usb diagnostic tool i don't know i don't know if you want it to be a usb diagnostic tool because you're you're like reading all the data and passing it back through data plus and minus wires go to the ur tx rx pins or any pins so this is using um this is using pio so the the constraint here is that the the plus and minus have to be next to each other um so in order um and that's that's a that's a pio constraint where pio can address like pins next to each other it's not related to ur tx and rx so it doesn't matter for ur it only matters for the pio so they have to be next to each other so for example here i have them on 11 and 12 and there's just settings in the code that you can change that for um but yeah they have to be next to each other but besides that there's not really a constraint and it takes like two two pios and three state machines i think where there's like yeah i'm not i haven't dug super into it yet that's going to be what next week's about i'm really learning host and so what i my first step that i want to do for this is i want to get this code running in um tiny usb so tiny usb does have a host stack that i think it would be great to to make even a more awesome um so this this code here kind of does it itself but i i want to be able to do uh i want to first get the tiny usb host examples working in this way um which i think would be really neat this is pretty timing sensitive so this this demo is actually using the second core of the raspberry pot of the rp20 40 to do all of the timing sensitive stuff um um david asks just wondering but why not use the rp20 40 usb host hardware uh because we want to still use the the regular usb hardware for device uh that's why we we actually do want to be able to do hosts and device at the same time uh this person who wrote this code uh uses it is very much into mechanical keyboards and they're using it as a way to do like remapping of existing devices so you can take a stock keyboard and decide that your keys are going to matter going to mean something else to the computer um which is one cool case the other case so if you want to follow along let me advertise this um we've got a couple new issues on the circuit python repo um you can get issues and then support usb host on the rp2 so issue 5986 so if you want to follow along this is where the updates will go you can see the 18 makers bill pointed out this stuff and then um 80 makers is pointing out that we have a number of conversion projects that take old equipment and convert them to current standards um one example of this is also being able to do like uh the remapping keys is one but potentially this is a bad example because rp20 40 does not have bluetooth but you could imagine a world where you want usb host and then to switch to bluetooth so that you can connect to like an ipad or an iphone um but yeah i think that they but yeah for right now they're they're doing like usb host and arduino out to your that goes to a trinket that's running circuit python or something um so yeah it's uh something that's really interesting and it dovetails nicely because i would like to learn a lot more about usb host for the raspberry pi the proper raspberry pi because i really still would love to have the the keyboard on the rp are on the pi 400 working so i was like starting to read the xhci spec and trying to figure out kind of what my game plan here is um first step i think is to get um tiny usb running this code um perfect topic i've been experience experimenting with the easy dock but i can't make the switch you can't make the switch why not so let me show you what i've switched to let's dovetail into this other topic um so one thing that keyboards actually do a lot of is converting from one thing to another so you may have seen that i've got this colmak website up and i've got this qmk configurator um so this allows you to change what happens when you press a key so this is my current setup um i don't know the best way to show you so if i just go to the overhead i don't think i have range let me just tilt it up and hopefully so there's this is my setup here um you're looking like sideways um let me move my phone out in case something comes up kraton says still learning usb comms using tiny usb question in order to have a pico or esb 32 communicated with a user space program is serial com the only option serial com is a good option serial communications is a good option because you really want to think about what the host has drivers for um and yeah it's it's really important what the host has driver for has drivers for and all of the major operating systems have cdc cdc support which is serial support by default so i that's what i recommend um kevin says so i follow the guide and have circuit pi then installed no i saw the raspberry pi zero two but it doesn't seem to work um yeah it's flaky sorry um the discord's a great place to join um i'm almost done for the week but maybe next week i can maybe i'll circle back and try to fix some stuff um make sure that you have hdmi plug then because hdmi will tell you a little bit more information about how far it's getting somebody else got it hung up where it was just on the like rainbow screen and then uh you can do debug builds and get your output that might tell you more too emote says what i'm really interested in is making you a midi usb host i hope it's not so different than what we're doing here so tiny usb has you a midi host support already i think um which is the why i want to like port it to tiny usb um so usb really is and tiny usb is great because there's like a very relatively small api bull like at the bottom that's just like about sending packets to and from and then on top of that is a matter of like different classes and stuff and that's all shared usually um niko says hi scott would you have an eta of usb 2.0 host support for high speed devices and tiny usb for the original pi zero only the ttc 4 chip has both supported for now i have i don't do eta's um the best i can do is for eta's is just a matter of if somebody's working on it or not um you never know how long something's going to take until you're done with it so i don't do eta's nobody is working on host support for the bcm 2835 um it's probably easy it might work it might work um i think we might have support in tiny usb for the usb peripheral but is currently being used in the 2835 um what i'm interested in is host support over the xhci chip on the pi 4 and the and the pi 400 which is different um only the ttc 4 has support for now has both supported for now yeah and in circuit python we don't do any host stuff yet um flashing rainbow on hb hgmi what does that mean flashing is interesting but the rainbow thing it's circuit python getting stuck and i'm not sure why it's getting stuck i saw this with somebody else i haven't touched it for a few weeks which is kind of unfortunate but i'm just not working on it right now so i can't really help you i i don't have a lot more to say i would get a usb serial converter to see if there's anything coming out of the ur but okay thank you welcome yeah and join the discord um there's lots more awesome helpful people on the discord so it's uh i'll just type it in so let me show you how i type um okay so here's what i've got yes tiny usb has usb host support for h id and there's a pr for midi but that's it i think it has cdc as well okay so here's here's my setup here so i've got this trackball this is a ploopy trackball it's open source which is pretty neat um but it's a it's a eight-bit micro it's not a 32 bit unfortunately and then what you can't see here is this is a touch sensor um that i have it's just just a little off camera there's this is a cutie pie and if i put my hand on my trackball you can see the light turns red so that's it detecting that my hand is on my trackball that goes into here so this which is what is the keyboard can uh detect when and pretend that i've pressed a button when my hand's on my trackball so if i want to click a mouse button i can put my hand on my trackball and then on my right hand i actually have uh keys so i don't know i don't know what's more useful like this is my left mouse button and like i've got a setup here and i i guess let me do desktop overhead um if we look at the qmk setup i've got layer four here oh this is not mine this is not my setup so one thing you can do is you can load it so let me upload the most recent one i've been iterating at 12 iterations so this is a cool editor and this is my fourth layer so this is the layer that's active i'm not actually a lefty i'm right handed but i had a pain in my right hand from mousing so much that i actually switched my left hand so i have a left-handed mouser now um so this is what this is what the keyboard setup won my hands on my trackball um page up page down which i was doing a scroll wheel and i might actually switch back to scroll wheel page up page downs really nice in most cases but there are a few cases that don't respond to it which is annoying um and then three mouse buttons so i can do that all for my right hand here um and then if i lift my hand up and let me click here first or am i running k m k or q m k i'm running neither i have my own code because i like that one thing i did want is and k m k can't do this as far as i know is like i wanted to be able to iterate with this nice editor so layer three doesn't do anything but um if i if i do my my pinky here it goes into arrow key mode which is nice um and generally then i just do col max so this looks like clarity but my computer is doing col mac based on this um so this mode two this is the thing that switches it uh to the arrow keys and then this mode four right now is is what pretends to be the mouse and switch it over um dylan says interesting how long did it take you to make the switch it uh it took me a while to go from query t to col mac but it's worth it in my opinion i like i did notice that i i could type a lot more words using home road than i could with query t which is really neat um so i was watching a youtube video about this yesterday or the day before and that person basically said like oh you want to do um pier i'll show my code in just a second um i'll show you what i'm doing i'm thinking about it a lot um the other video i was watching basically said if you want more ergonomic keyboards just don't use query like pick whatever you want and and do query t so i picked col mac um at the time when i switched i was on mac and mac has native support for col mac um which is nice so um that's kind of what got me switching to col mac there's a version of col mac that is um col mac dh which has a couple other switches so col mac i picked because mac already had support for it but it's also been designed more recently so it's it's designed for people coming from query t so there's only like one or two letters where the letter is on the other hand which is kind of like one thing that makes it easier it makes it it's easier to have things on the same hand um but then it yeah it's it's pretty cool i just got these keycaps so i don't know maybe let me show you just so split keyboards are the way to go in my opinion because you can have them wider out um let me just show you so these are actually clear i i don't have the right neopixels for these but i'm going to be soldering neopixels um they're browns you can kind of see the brown through the clear keycap and then there's a knob here that i don't have working yet but i want to make it scroll because i like sit back and um um i i like to like browse and read stuff and i don't want to have to have all like my hands on the keyboard the whole time so one thing so i switched from i am definitely a keyboard person i should have warned you so what i had before was that it's kind of much cat hair on it but this is the keyboard i had half of the keyboard i had before this is the keyboard model one and i liked it a lot it was i think it was my first split it's got like custom keys and don't look too closely there's a lot of cat hair in here um my the reason i want to switch away from it is one i can't program this directly in circuit python because it's an 8-bit micro the other reason i i think i want to move away from this is that i can't place it at the edge of my desk so this is like the edge of my desk and you can see that even at the edge of my desk my hands like a whole hand width in and um because because it is um yeah because i have cats i very i don't often sit with my my legs under my desk and so it means that like i need my to get my keyboard like closest to me i have to really have it at the edge of my desk anyway so yeah and folks are pointing out that yeah this ship who says qmk supports rp2040 now as well you can probably replace that pro micro with the eight of fruit board so these are um kb2040s on this um so they're already running rp2040s but i kind of see them as kind of giant software projects and i mean i'm hugely biased right like i'm a circuit python person and keyboards are not that complex complicated so i'll just show you all right this will this will we talked about usb host stuff we're talking keyboards patrick asked for an update on the broadband advocacy stuff so we'll go over that too which is not eight of fruit related but that's okay um an s3 that's a drop-in replacement for a pro micro yeah these are older versions i don't have the pink ones i just saw that oh they have pink ones now um so i don't have the rotary encoders working um i did add the ur so pio ur is transmitting from the right side to the left side um because these these are the softle soful designs and they don't um they don't flip you can't see me they don't flip the wires so you have to be able to use like yeah you have to be able to basically software do ur or or pio ur i'm totally thinking that too i'm getting into this recently as i'm having tennis elbow yeah i just i i kind of like constantly constantly have issues um and i think that's part of the reason that i like switching from keyboard to keyboard is that like not doing the same thing over and over again helps um but one thing i i've been using this this week um i was using this other keyboard before and it's got those hand rests and i find i lean on them a lot too so another forcing function for these is that there's no place to put my palms on my hands and so i'm forced to float my my hands over and i think my hands my hands have actually been quite happy this week um i've not been hitting the right keys all the time but generally my hands have been pretty happy with me um so i'm really liking this i just got these clear keycaps i had other dsa keycaps which i don't have within arms reach of me but i'm actually really happy with this profile instead um if you don't know what i'm talking about crow like foxes i wonder what i joined in on looks kind of cool we're talking keyboards um there's this thing called pit my keyboard um they're actually in washington state here and this is where you can get all sorts of keycaps that you want ate a fruit carries keycaps some keycaps as well but these are the go-to folks i think yeah deep keys um these are this dcs clear set is what i what i have here i didn't realize the thing that i got didn't have homing bumps so i actually ordered then some i did another order uh and they're coming today because a lot of the trouble i've actually been having typing this week is just not having my hands on the right position like i've been shifted a row and then i type and i get all the wrong letters so um these keys they're like index finger and the pinkies can have bumps on them so you can tell that you're in the right spot um and those keys are being delivered today which i'm very excited about what i was going to show on here though is that they've got guides yeah it's nice i ordered those key bumps via ups usps like yesterday or the day before and they're they're close so they're coming they're out for delivery um keycap family specs this is a kind of a good way to see it um it it kind of shows you the profile um clear orange keycaps i haven't seen any clear orange the only clears i saw were these although in the comments for these somebody talked about dyeing these to have like a tint so maybe you could make clear orange um anyway so these are kind of standard keycap profiles so dsa is what i was using and they were kind of like a little light kind of tintsy um and i got dcs which is like more typical and they feel a little chunkier they're a little clickier and i'm liking them a lot they've also got i keep talking like you can see me they also the keys have a little bit of like a curve to them to kind of keep your finger kind of in line one thing that that folks new to keyboards don't always kind of blows their mind too is that these are ortho linear is the term so all of the keys in a particular row are like lined up whereas on a like a classic keyboard they they're not actually lined up they're staggered um but ortho linear is the idea that your your finger just moves like in one direction so yeah i i've learned that i like dcs over dsa and essays are just kind of gigantic um i've got some of those too and then low profile is kind of a thing that people like too i do wonder about dss but um i don't really i didn't really want low profile profile i'm pretty happy with this now um so that's all about my keyboard let me just do a quick because pierce maybe still on here so it's all circuit python let me unplug i've got lots of circuit python devices here oh so i have my keyboard set up that it's only a keyboard or it's only an hid device by default um but what i can do is i can hit i can hit reset and hold the key and boot top pie reads to see if a key is down and if a key is down and then then it'll allow me to do circuit pi which is quite handy so uh what you can see here is that i've got this uh the json file which is exported from that configuration thing and then i'll show you my code it's like 150 lines of code and i've been thinking a lot about how i think this should be structured one thing that is a major gripe of mine is when i see libraries that just have you call run at the bottom it's like kind of like not i like to kind of expose the loop part because i think it makes it clearer what's going on um let me know if you want to see my my hands i don't type enough to suffer from any hand arm elbow issues you've got plenty of years ahead of you to get to that point um okay so a bunch of imports i've abstracted away some of the aspects of the keyboard into this softball module i don't know how to say it um standard standard usb h ad stuff for circuit python i created a keyboard and i created a mouse because i'm sending mouse keys i release all the keys in case some were pressed down uh which is kind of the worst failure mode uh i'm loading the json in i say i loaded it and then this uart stuff is like whether i'm receiving or sending key codes i have to do a little fanciness because the the numbering in the layout doesn't quite match the the scan matrix which is unfortunate but that's what this is doing so this is going from kind of key number in the matrix into the the index in the layout um this is the the line i'm using a stem a qt connector but i'm not using it for isquared c um expose the loop sounds like an awesome book title nice yeah i mean i i like trying to design apis where you can write what you want in like 20 lines so that you can see the the the loop and all of the things it's doing in the loop i haven't gotten there yet with this code but i'm thinking about it um so this is the lat the mouse checker so the first stage here that i want to factor out is there's kind of three ways that i'm going to generate a key event um one is i check the value of that mouse line it's just like higher low um that's for the touch sensor on on my left hand if that's the same then we check for a key event which we get from which actually this is a bug we shouldn't do this because we won't handle it otherwise yeah that's bad like we should say else see if we do key event and the mouse thing's a problem that might be that might explain why i've been having some problems with it okay so that looks more right so this is a hugely risky thing editing your keyboard code from your keyboard is a bad idea but i do have backups of this code um because if you make a mistake then your keyboard starts stops working which is why i have an apple keyboard on the floor here to rescue me but maybe i won't save this so there's kind of three ways we can get events the third way is to get events from the other side via the ur and then once we have the event we're saying oh if we didn't actually get an event we're done we go through the loop again um but then we map the key number to a layout index and then we look in the json file um for the current layer that we're on and get the qmk qmk code and then we do this layer search so um if we're on a layer and it's marked as transparent then we kind of go down the last save it what's the worst thing that could happen yeah the shippu says stopping working is not the worst that happens it can get stuck with some keys pressed permanently true especially if you're hitting ctrl s which is how i usually save yeah been there okay um so this is doing like the layer search and then uh if the qmk code starts with m o then we're switching to a different layer if it starts with k c button then we're doing a mouse button if we're doing w h it's a wheel otherwise what we're doing is qmk code to a key code and then we press or release it and so that's all in 128 lines plus one custom module so pretty clear pretty straightforward and very much heavily relying on the on the json mapping file which has been really nice because I can then edit it um there's another standard standard called via and vial is the open source version and it's pretty handy to do that as well almost says I have a question is Adafruit going to make a diy vr controller as they have made a vr headset and I have it but I'm using terrible controllers and I was wondering if you would make some um we've not made a vr headset that I know of um I I don't know I don't think we'll do any guides with um I don't know how you would hook those up so Alma my answer would be probably probably not um but you might be able to find ways of making your own controller if you want to use something else but I think if your controller is trying to figure out where you are in 3d space it's like pretty hard it's not easy not an easy thing to do yeah pierce says I love how you load the json from the qmk edit yeah that's like that was one of my requirements is like being able to tweak it is really handy oh just shippu points out there might have been something like google cardboard in the Adafruit store at some point maybe yeah perhaps we're not doing anything with vr right now I'll tell you that much okay so that's my keyboard firmware it's not currently in a repo so if you do want a copy of this just let me know and I'll I'll send it to you Eva is doing a split keyboard guide and might actually use it we'll see but one thing that I've been thinking a lot about and this goes back to usb host as well it's kind of coming up really defining in my mind those stages so you go from like the key matrix press into I think really what you want to do is you want to map that to kind of standard key codes which is like the default mapping for qwerty and then I think what you do there is from the qwerty mapping you go to the custom mapping so that's the phase that I would do like colmak and then there's also kind of like a phase where you're determining what layer you're on um so I think and then like depending on what layer you're on you do different mappings as well um here you can have this code it's fine I don't think it's all that much stuff but yeah just ping me on discord and all I'm happy to send it to you I just don't I haven't put it in a repo but so I'm thinking about the primitives that we have to map from like key codes all the way to usb presses but then I'm also thinking about usb host where usb host is going to give you key presses in like usb key presses but you may want to transform it again um another transformation that you may want to do is actually key code to serial um so like if you're in circuit python terminal you may want to like change a backspace key press to the actual thing that deletes the last character so there's another like transformation layer there from us like from usb key code to serial input as well um so I think it's it's kind of like this whole stage thing and k m k and kim k have these these things and you just say like do these in stage and they kind of hide how they go from one to another but I would like to try to come up with like primitives where you're actually doing it in the loop at the top level so that the nice thing about that is you can see that it's doing a loop and you can see the different stages of it and theoretically print out what is is this state between any part of that loop if that makes sense so you can see the process of how it goes from key codes all the way to usb or even serial input um and then I've also the other factor of that is like if we do usb host then we want to be able to ingest that straight into circuit python so that's kind of the transformation of like how do I get from key codes all the way into serial input into circuit python um so that's pretty well I could try to I can make a repo for it after the stream I do have really old this is not the first time I've written key keyboard code like I made a keyboard five years ago with circuit python and did the key scanning from python as well like that's up in my repos in a repo somewhere as well if anybody has an idea for what to name this let me know could be like scott's keyboard um on mac os you can screenshot the code editor in the stream and then copy and paste the code that's pretty neat um okay so we're kind of at time if folks have questions let me let me know I think patrick asked for a broadband update so let's just uh wander away from Adafruit stuff for a little while um and no folks kind of tend to trickle off after four o'clock as well so if you have questions I'm happy to answer them but let me just go a little over the broadband stuff that's going on um so I was I've been trying to figure out the best way to advocate for more broadband access here in Washington State in particular if you don't know in the U.S. we have a lot of money that the federal government has allocated for broadband so that kind of expecting about a billion dollars per state it's going to fluctuate a little bit but in the next few years we're going to get a lot of money towards broadband deployment um and people are always very careful to make sure that the rules don't say it's just fiber but it should just be fiber in my mind um cat kb maybe um so the main thing that I've been doing is actually the site called walla I think I showed an older version of this that was like a git lab instance um but a lot of the interesting stuff that I've been doing in the last month or two it's been around the the current legislative session here in washington state um and tracking all of the related broadband bills so uh I have this site here and I think I showed this before at some point but what you can do is you can click in so bills are done by biennium which is two years at a time so we're in the second year of um of our biennium so it's a short session which means 60 days we've got like four weeks left or something um so just to see like where all of the bills are you can click into this page and you can see that here's in the senate for the second reading and I'm pulling data from when public hearings happen people sign in pro con or other and so what I've done is I've pulled all of the data about whether people are signing in pro or con or con or other on a per bill basis um have a good weekend pierre um so this is a kind of a cool way to see what the hot topics of the legislative session are and I'm also pulling in calendar information so you can see when public hearings are happening or executive sessions um um so that's kind of neat and then more broadband specifically um we can do so one thing we're doing is there's a change to the definition of broadband which I don't I thought they revised it but it's changing the minimum from 25 three to 100 down 20 up which is generally a good thing um the words here were a little bit tweets but I think generally we're we're for it so that means that state subsidies can go to more places uh which is good um and then there's also a right to repair bills the other one that we've been following which is this electronics repair you could see a lot of people signed in pro only a few con and those tend to be lobbyists so those are big thumbs downs that that impact stuff a lot and you can see it's been substituted um but this is a cool thing too and it is making progress still uh which is good so that's kind of where I'm at on the broadband stuff um I haven't been working on this I'm keeping it up to date so I run an update thing every every week every night um you can see it's all hosted on github so it's just wala.org tanay.com says wala we is the royal weir is their group maybe something we can donate to so um I'm on a I'm on a slack for a group called share the cities which does kind of activism stuff housing related stuff but also um broadband right to repair stuff as well so I'm I'm kind of like plugged in via that group but this site has almost been me but there's one other person that's done a few prs as well um for night mode and uh titles and stuff so James Wu here is has contributed a couple stuff as well which is neat but yeah thank you github for doing free free hosting because there's like 15 000 files in this repo it's not small but yeah that's a quick update on where I'm on the non-aid-a-fruit side of things will there be a way for us to see updates after this spring what do you mean like the laws aren't going to change if there's no um the laws aren't really going to change if there's no current session the next session unless the governor calls a new session it won't be till next um next spring next january it's the next session the next regular session um but it's still going on lots is happening but yeah if you want to know more I'm happy to talk more but I think we should wrap this up because I know folks are leaving um and I can connect you into this group that they're looking at too but right to repair is one of the more interesting tech sides of this um mostly once you've got parental responsibilities where they'll be always keep following keep following along on what like the law stuff I'm I'm not I'll plan on just auto update I'll manually updating it through the end of this session and then I probably could do a github actions to automatically update it but um um I don't know if it's worth it I have analytics on it and not a lot of people are are looking at it so all right let me pull up my notes and wrap us up oh you know what every minute is right here it needs marketing to get the word out I actually got mentioned in the stranger a few weeks so I have nice spikes when the stranger mentioned it um but it's kind of after those spikes it's kind of dropped down to the normal level and people are still sharing people are still sharing the normal or the the direct links to the the legislative website oh dylan yeah internet upload speed is sad 100% so yeah if you I know a lot about broadband in washington state so please let me let me know if you're interested in that a lot of what I've been trying to do with this while a lot of things is just figure out if there's something that I that really catches people and like gives them the motivation to actually come back which I don't think we've actually found yet um but people were interested about the thumbs up and down stuff um okay camera thank you all for joining me for yet another deep dive thanks for hanging in there towards the end through this uh washington state specific stuff um uh yeah keep an eye out for usb host um I'm around the next few weeks I am planning on kind of like stopping streaming before the baby comes in the next few weeks so uh we're a limited time left um but uh foamy guy is going to take the spot and so somebody will be streaming on adafruit around this time um as always I'm sponsored by adafruit to work on circuit python uh so you can support them by going to adafruit.com and purchasing some of the stuff you saw here um if you want to chat with me and a lot of others outside of the space of a stream and like you're watching this after the fact and somehow you watched all of it um and you want to come chat with us you can find us on discord by going to the url adafru.it slash discord um me and a lot of great other great folks are there as well um deep dies happen every week at least with me for the next few weeks um normally is at fridays at 2 p.m next week will be friday as well um and typically typically goes for about two hours um this is actually a little bit long um all notes are available on github thank you to patrick and david for david for taking them patrick for curating them um they're available on github github.com slash adafruit slash deep dash dive dash notes and they have time codes there so if you ever want to find like when did scott talk about this one thing um that's a great way to find it and then jump into the video where I actually talk about it um so thanks to folks for that and I'll take my mic off and pet the kitty as I always do at the end um and after the stream I'll try to get this python keyboard code just dumped into a repo for folks to look at and then next week I'll be trying to really dig into usb host and see how far I can get with getting pio usb host in tiny usb next week um so I'll be around next week for an update on that and then maybe a week or two after that I haven't worked out with foamy guy exactly where we're going to swap over but soon soon time is going by fast it's like almost the middle of February already which is wild um anyway I'll get over to this kitty and uh we can chat more in the in the discord about the broadband stuff too if you're interested all right would you like pets he's been loving the sun today thank you all have a great weekend