 We'll get started here in just a couple minutes after everything gets going The camera is closer, and it's a little weird It's good though. I'll say some hello's while we get going and Pause my videos here. Oh my camera froze You can probably still hear me. Let me unplug and re-plug it back in freeze tube That hasn't happened in a while now I'm moving again. We'll see if it stops It's so cold the camera stopped Hello unexpected maker. Hello the shippu. Hello Greg. Hello Michael. Hello Pierre. Hello Eric. Hello Greg again Hello, Larry. Let me know if my camera stops again, please Ham's lab says great good news in my world. I finally got a job. Congratulations. Hello Charles. Hello Keith Hello Dexter. Hello Anthony. Yeah, hopefully crop cooperates Yeah, not not been a huge huge fan of The weather here. I'll try rain and warm over Cold in the morning cold and foggy in the morning and sunny and not very warm later Hello Michael. Hello Tammy. Hello Megs Hello Paul. Oh, hello Dave All right. Well, that was fun. Hey Thomas. Hello see Grover. What do we think? What do we think see the camera is like well within my arm's reach now? Hello Dinkelberg. Hello, Michael. All right. Let's get going and Yeah, let me know if the camera stops again All right, so Hello everyone. My name is Scott and I work on circuit Python for Adafruit. If you don't know Adafruit is a open-source hardware and software company based out in New York City, but I work remotely for them in Seattle. So here I am in Seattle. The sun is out The cat is enjoying the sun in the corner there And yeah, so they do open source hardware and electronics if you want to support them You can go to Adafruit.com and purchase stuff there They pay me to do these streams and work on circuit Python throughout the the week Circuit Python if you don't know is very sharp image. Good I do I love this camera. So I figured it would just be better I feel like it's a little darker Like it's usually like better lighting than it is now, but you know, oh well So circuit Python is a version of Python, which is an easy to use programming language And we built on micro Python to provide that ease of use on microcontrollers Which are these little tiny computers That are basically in everything here So this is a wi-fi and a bili capable microcontroller here that we're working on and Yeah, so Yeah, so that's what circuit Python is a lot of you are regular. So I'm sure you know that This is a deep dive. It happens every week. Normally Friday's at 2 p.m. Unless I haven't taken the week off And it typically goes for about two hours. So we're going to shoot for two hours I've got plans to play some video games after the stream here with a friend of mine So we're going to shoot for two hours Questions are welcome. We'd be happy to answer try and answer everything I make no promises about my ability to actually answer it And then last up on housekeeping All of the notes for the deep dives because they're so long David is gracious to take notes as we go along so that later on you can look into the video what parts are what So all those notes are available on github. You can go github.com slash eta fruit slash deep dash dive dash notes And patrick has been doing a great job collecting all those there and making them linkable So thank you to both david and patrick for making that happen Um, that's all the housekeeping. So let me just get a little more caught up on chats and then We'll recap stuff Uh Greg says I recently used some of what I am learning in python to navigate a bad router web interface Using the module mechanized to auto reboot it via command line because if I don't it eventually freezes and refuses connections That's clever Is that mechanized does that um Oh, yeah, david's Yeah, mechanized does it it probably uses a browser to actually click stuff And then DCD says if anybody has links that they want in the notes, just put them on the discord david'll put them in the note stock Um Mark tomblin says hey scott just got an amd 5950x and I gotta say great chip after watching you compile code in the blink of an eye I had the snag one. Yeah, I've been very happy with it. I'm I'm starting to realize how uh nice it is to just Have a have a really good computer to work on um, and so Thank you to my github sponsors. I do have github sponsors as well and and I'm kind of treating that as my like Upgrade my computer fund Python module emulates a browser me Uh, yeah, so thank you to all my github sponsors as well for For supporting me Adafritz by far the pays me the most but thank you to sponsors as well. Um All right, I don't actually see any questions. So if you have questions feel free to ask them We can take a quick detour here to cat cam Because dingleberg says the cat cam. Yay. So here's here's full screen cat cam Sun is out, which means that spook is Laying in the window there stretched out because he's hot And then what you can't see is that under that cardboard cat thing. There's a heat vent So it's been cold and sunny, which means the heat's still on so he's been super happy Getting all the warm air blowing right right on his feet While he lays in the in the sun. So It's a good cat life. I'll tell you that much Hello, andrew from cornwall okay, well, let me go to the desktop and One of the things that I wanted to talk about was just to start from where we left off with circuit python 22 Um, I was going to shoot to have this be the last the the last day, but uh, catny hasn't done it yet. And so she's still Uh, gonna do that. So I'll probably do the final post next week sometime when I hear from her and anybody else who's still working on it um But if we go to the blog and do tag I think the last one we talked about was, uh Cats are heat seekers Yeah The camera looks professional. Good. I love this camera I think my lighting could be a little better like This side of my face is a bit dark details, um I think We left off with ken Was it ken or foamy guy? I don't actually remember So, uh, if you missed it last week circuit python 22 is our kind of annual planning chance. So it's our chance to, uh Talk about what we'd like to see for circuit python in the next year um So I did my post and talked about it a couple weeks ago And then we've gotten a number of folks since then so I figured I last last week I recapped everybody else and so I wanted to Just highlight the last few that we got over the week So let's just go through these I think we did talk about circuit oh I think we did that already And then Over the weekend, I think it was foamy guy and shippu But yeah, if folks have questions feel free to ask them to So Uh, I guess I I could say something for foamy guy, too So foamy guy says it was their second year involved and and foamy guys has been doing a lot and Things that they wanted to call out was adding bitmap tools boundary fill Doing automated type issues stuff and the library project screenshot utility So that's like super useful for Updating learn guides to show you like these are the files you should have We actually have an auto generator for that now Things that foamy guy is looking forward to So it's it's excited that exciting that foamy guy is going to be dedicating mondays to working on circuit python So adafruit is paying foamy guy part time For that so that's really exciting Things that foamy guy wants to do is to get more comfortable in the core Um, particularly to make some things that take file objects take file names so that they own the objects Um Continue building out display IO helpers to make it easier to build rich gooey applications gain more knowledge about bus device communication with the aim of being able to write drivers for new and existing breakouts Improve the information available on the board module and the stubs and get involved with working on the bealy workflow for the native android app um Yeah, so hands lab, uh, is there a way for you to submit some suggestions? So generally the way this works is just post it somewhere So if you have a blog you could post it there if you want to just do a github gist You can do it there like what foamy guy did and then just email circuit python 22 at adafruit.com That's a like mailing list internally that will go to phil and i so when i see that i'll post Do a blog post that links other people to it Um, so that they can see that So there's a couple uh interesting things for foamy guys circuit python 22. One is the mention of the android app. We actually just uh Decided to start working on that so, uh the person that we contract for uh a lot of the uh mobile app development antonio I did file glider for ios Is now uh has just started working on a file glider for android So uh that should be cool and we'll hear more when That makes more progress. He's just started this year On that so that's exciting and then the other thing that i i wanted to mention That's tentatively in the cards is that um I mentioned on a few past streams that i'm going to be out a lot this year because i'm expecting my first kid Um, so i'll be out starting in march sometime depending on when the kid comes and uh What we just kind of looked at is that it looks like foamy guy is actually going to start streaming in this spot on this channel um on adafruit so Um, those of you who like this time for deep dives, uh foamy guy looks will be Will be taking the torch for me. Uh, hopefully I don't want to like super commit him to do it, but He's tentatively said yes to it. So we'll get foamy guy in this slot on on streaming for adafruit, which will be awesome as well um While i'm out and then I I I honestly don't know what's going to happen after I come back so May can foamy guy might continue that we'll see so that's foamy guy circuit python 22 Um next Well, we didn't actually touch on keith did we so keith the ee sent this one in today Uh, not this one This one also a gist um And I I thought this was uh neat to see like that sort of projects that keith is working on So a lot of like home automation sorts of things Uh, but then uh, I think keith did a good job of touching on like the community is really awesome Generally our documentation could be A better structured. So there's like really good high level tutorials of learn guides But then there's like the api reference and there's not a lot in between Um So that that is pretty interesting and I think that's a good idea and I'm Keithy ee definitely has a python background. So I'm I'm curious to see where they take like How they bring their python experiences to circuit python Um Ignore my complaining. Oh, I I'm not going to ignore it to shabu. I think you have good points. We'll get there. Um So, uh, another thing that keith pointed out is time date and rtc. So talking about some challenges going from C python world into that Um into circuit pythons timing timekeeping stuff Uh timing sensitive multi-core jet. This is an interesting idea that I'm not exactly sure what it means Um, but the idea of being able to like run things in a in a like real-time way Um, oh and keith's in the discord Uh scientific circuit python. This is not this is not the first keith is not the first person to talk about scientific circuit python. Um I think keith here makes a really good point of like It doesn't need to be bulletproof But like a lot of people can do science if there's like some hand holding for the sensors and stuff and I think that's And and talks about how the strength of circuit python is making it easy for non Like people who don't code primarily uh So, yeah Scientific circuit python micro lab and beyond some more stuff that I don't understand because I don't just I don't know this Uh detailed statistic stuff, but uh, yeah some cool things there Um, we got a question in the chat from dingleberg says when will the floppy disk support be finished for circuit python? Also, congrats on the kid. Thank you for the kid. Um I don't know the status of the floppy disk support jeff and lady aida But jeff and ma more are doing that primarily so i'm not sure What their plan is exactly I asked them about eight inch floppy support because my uncle actually has a bunch of stuff He'd love to try to back up um But they are still working on five and a quarter so I think that There's a floppy i o Is it a pull request still I think it might be a pull request Yeah, there's a draft pull request for adding the floppy i o module So that's if you want to follow along I'd suggest going here and hitting subscribe And then you'll get updated when uh this You'll get updated when when work continues on floppy i o here Um, let's go back to Ha ha tammy points out it depends on your definition of finished. I'm never finished with any I never finished anything I just decided that I'm done with it. So let's see more specifically keith is talking about um scientific in terms of Laura low power heavily used in remote scientific studies A lot of those experiments are designed by folks without an e background I think circumventing could extend a path for data acquisition that Arduino and Raspberry Pis have opened up Yeah, Aiden's floppy. Well, it's like code that he wrote in like the 70s or 80s What's next paper tape and punch cards? I don't know there was somebody doing uh punch cards, I think on the forums Michael says is there a way to get the b lead date time in circuit python? For a recent project of mine, I used Arduino code to update an rtc when connecting the nrf52842 An ios device. Yeah. So what you need to do is it's the The current time service. I think is what it's called on the phone And in fact, I think I saw that I think we do actually have an example of it So all these examples would be in the Adafruit circuit python b lead repository And yeah, there's a b lead current time service and this is reading it not writing it So that's that's what you want Michael is the current time service stuff Punch cards and paper tape could be read via ocr There was somebody trying to do core memory on the thing too Uh Keith says the jit is just a silly idea, but I figured I'd think about it and mull it over It's a flag so the compiler treats the following code differently Which means it'd be a headache and a half just to add to the core It sounds also like if you look at the Like the native decorator and the uh native decorator and the Uh vipre decorator that micro python have where they like do more work to to run it up front Um, okay, let's keep going Let's see. Let's get diship who's out of the way because he's not super excited for me to go over it decorator so let's see what uh diship who says, uh Lots of keyboards has a library called microkey It was cool that we now support caps lock keys and disabled disk keypad module boot modes all that stuff um No software progress on the walking robots Camera breakouts aren't working still Oh, yeah, there's this samd 21 problem that we still haven't fixed There is a Also a bug in the pwm code on samd that makes it hang completely in a loop waiting for a register flag that never gets set I got that far debugging it, but why it never gets set is a mystery to me and nobody seems to be interested in fixing it I worked around it in the stage library by simply setting the backlight pin high not using pwm at all But I got bitten by the same bug recently in the ocarina code Yeah, it's tough. It's tough to prioritize fixing bugs, especially when it's only one person that's hitting it. Um Sorry It's tough There's a yeah, we have like 480 open issues Uh the future Uh fluff bug camera support A new s2 board, but the display is non consecutive 16 bit The cool watch project is the is the cool watch project the one that joey's doing Uh that has a sam l 22 I feel like somebody was working on sam l support and they never got it in I think it might have been uh, maybe the the Electronic cats folks might have been working on sam l 22 actually I know you're not blaming anyone to shippu I do think like and we we've talked about this before like it would be better for us to have a better way of um Doing automated testing so that for things like that we'd know immediately that was a problem I think that's exactly this. Oh, and you know what I did add a an issue flag for regression So maybe we should do that too um Oh sam l 22 can do lcd driving. That's really cool Ha ha Yeah, and I think the s3 is going to be cool too. I know you're talking about the s2, but the s3 is going to be really neat too Hi roi Where is the spammer? Is it hidden because i'm looking at top chat? I try to mod as the stream goes I just see a hello from russia. I don't I don't see any spam Am I missing it? all right, so This is from md roberts 1243 um says I imagine circuit by them becoming very easy to create serious iot sensor nodes um Circulate them with a different sensor breakouts could be used to code the center logic The ability to work over an r toss so that a proper communications stack could be implemented in the background This is successful in the esp series, but I'd like to see stm 32 or Nordic chip support the same for a specific example think of laura wane And then I followed up with md roberts here about like what the best info for for doing laura wane is I think I think I was thinking about this actually as uh, like if we if we had An r toss under circuit python. What would that actually mean? And i'm not exactly sure what it would actually entail like Would we would that allow us to do more async stuff or like We have it like circuit python is Just us chickens um Yeah, so i'm not sure We've talked a lot about doing r toss stuff in circuit python, and i'm not sure what that actually buys us I don't know why we would actually use it um I don't see any spamming yet, so All I saw was a hello Aren't there laura wane feather wings? I think there are I think the laura wane support. I think we do we have laura support just from a library. It's not native at all I'm here to mod if we need it, but we don't need it yet although I YouTube did catch one thing that I blocked Not from that person though from somebody else Okay, let's keep going I think we're we're all on the right track here Um, usually usually the spammers. I see when i'm streaming or on twitch I think you pretty pretty much every week on twitch we get a like pay for followers spammer That that I ban, but all right Let's see molecular molecularist Uh, this has one big wish for a circuit python on 22 um udp I want to see deep sleep spread to all circuit python chips And it's the biggest one is the audio more audio in support. So um having Having uh the ability to do audio input would be really great and that's something we've had an issue for ages before It's just I'm not a huge fan of doing audio work because I I struggle with the signal processing side of things um So yeah, I think You know this person also points out the like audio stuff in teensy and paul's done an amazing job there So I think it's good inspiration But i'm not sure who the right person to really carry that forward is um, so if folks have Ideas and want to work on that we'd love to have it Love to have more stuff in circuit python for audio Just not quite the right person to do it All right, next up we have tammy Who's in the chat? um Handslap says I may do that. I love audio stuff Audio in would enable 64 commoner 64 cussets Yeah, love to see teensy audio. I reported to a circuit python. I looked at it like a little bit like actually just using it, but the problem is it really is built on top of the arduino libraries and I just don't know what that involves um Mark says people always ask for udp support, but never sure if anyone is listening I thought udp worked, but Oh, you know one thing one thing when I was looking at the teensy audio library is it does a lot of buffer allocations at compile time I think I think I looked at that and there was like a lot of static buffers and stuff and That's a problem for circuit python because you don't want to use the You don't want to use the the ram until you know, you're gonna actually use it Hamslap says I'm also going to make an audio featherwing with two inch and Two in and two out and might do balanced inputs if I can fit the connectors and get the chips Yeah I think yeah If you need help getting if anybody needs help getting started hacking the circuit python core, please let me know I'm we're always looking for more folks to contribute Yeah, static buffers. Yeah, that was one of the things is like so much code is written That like you're compiling it because you're going to use it when that's not usually the case Not necessarily the case in circuit python Yeah, that's that's what the udp joke is is that you don't udp does not involve like confirmation that the other person heard it I mean, isn't it like unreliable data packet or something? I may need some help getting set up. Is there a guide? Yes, they're Dan wrote a building circuit python guide So if you want to just get set up building circuit python, that's the place to start Well, that was a big udp is shouting into the void Do you have books? Books you recommend that are helpful books for what? Todd Bout says wait, what's the udp joke? I think I missed it Mark said it I could repeat the joke but still wouldn't be sure if you'd get it Ah canto robo welcome Um never use circuit python seems super interest Super interesting. What do you guys recommend buying to get into this? So somebody on the forums just asked this and there's a guide for circuit python boards Which circuit python board is right for you? It's a good place to start Um, if you have an idea of what you want to do with it Let us know and we can try to point you in the the direction that will take you there Um, but that this guide that catney wrote is one of her many awesome guides that she's written Tammy says this meta humor is too much for my brain on a friday of a week. I've been on the call for work I know right It's fun though. I enjoy it. Okay speaking of Tammy Let's go over Tammy's circuit python 22 before I get too distracted again So Tammy says holy cow The circuit playground blue fruits amazing Has sensors and connectivity in this $25 Circuit python continues to be a game changer. Thank you. Thank you. Thank you Hard to pick boards. Oh, there you go. We just talked about that Things I'd like to work on in 22 Circuit python debit dependency management tools Cirque up is great, but uh, we could have More metadata about the boards in the libraries that are for a given board Something like pie project dot tom will vote for circuit python Uh, twitch maker streaming. I love the fact that twitch has grown beyond video games and Tammy's shooting to Start streaming by the end of february. So I'll post this link In the chat if you want to follow Tammy Tammy's streaming that will be coming later this year Um circuit python for magic. Oh wait, I skipped one circuit by the hardware for music Uh more synth stuff would be great And I know Todd bot and jp would be on board with this and in blitz city or all music folks Um circuit python for magic. I think this is really cool. And I think jp does some of this as well So like using microcontrollers is part of magic tricks, which I think is neat Um getting better with display. I oh um The the kind of de facto Guide that carter did has been hugely helpful, but I agree that there is definitely more More to do there and like the graphics team sort of folks from the community have done a really good job of making widgets and And layouts and stuff like that. So it's come an amazing amount after I basically stopped working on it So that's been really cool Um contribute more to the community. Well, you're here. Thank you. Thank you for joining us, Tammy um I'm hoping to get all the rest of the streaming mechanics figured out this weekend Yeah, and if you have questions feel free to reach out. I Obviously at least have this set up Uh design a circuit python board. Yeah, this is something I've seen a number of people do and uh, it's super It's super fun to design your own board and see the software come up. So Um and keycaps great. I I've just used keycaps 6 a little bit And I just opened it to like open some source files from lady aida and I was really impressed like key cat 6 looks really good I actually need to get back to making something Contorobo says I will read the tutorial and try to make cute robots. I will try to document my journey. Awesome. Yeah And uh, if you're not aware of it aida fruit hosts, uh show and tell Every wednesday where you can come show off your cute robots Um, so that other folks can see it too A books that help with problems you run into With core development Discover that reading through books is one of my preferred learning methods ooh It depends on what you're doing. I really like the If you want to know about cortex microcontrollers One thing is these books Okay, see if I can reach it with that one So here's a couple books that I like if you want to go deep deep deep. Um, there's this book Which is arm cortex m3 and m4 reference Um, you're not going to want to read it end to end but like the intro stuff can be interesting And then another book that I do use kind of as a reference to is usb complete. So if you're doing usb stuff This is the book for you Really really good reference book um But I don't know like software changes so often that Books are not always the best resource But yeah, as somebody pointed out like the discord's a great place So we have the circuit pipe on dev channel if you have questions about core stuff We're we're always happy to get folks going Um David says I'm reading the usb complete right now. It's very good. Yeah, it's a great reference um Tammy says I was super excited to get involved with circuit pipe on in 2019 And then the world blew up and my body tried to assassinate assassinate me last year And I'm excited to get back into the community Well, I'm glad you're on the up and up and I'm glad you're back We're we're here still although I guess I'll be gone some this year But uh, there'll still be lots of other folks in the community. That'll be great Timecode on those books, please Yeah, we can double check here Yeah, david's got it usb complete Uh, okay, so that's I think we recapped tamis circuit pipe on 22 Pierce says I still have to upgrade to key cad six looking forward to all the positive changes they've made The ship who says key cad six is much better, but you still should start with a schematic in it I hope they will improve the schematic list workflow at some point interesting I usually do the schematic first, but I suppose if you're doing something super basic, you don't necessarily need it Oh, I think that was the last one because we already talked about keiths And that that's one this one is too so it sounds like a couple of people want to keep doing this So please try to get it in by like monday next week because I do want to kind of wrap it up and It's good to have a deadline so that people do it Um, and monday monday next week is actually the last day of the month as well. So I think that makes sense Okay Any questions before I talk about the esp 32 s3 and bluetooth and I'll wait for it to echo through the Viber pipes Phil's lab has a key cad tutorial new to me and it's free for a few days I rarely start without a schematic good to know I like to explore which pins best used for what and such before I do the schematic Yeah, I think what I find is that I end up laying out my schematics kind of like the board like I like my symbols to reflect um I like my symbols to reflect the actual layout which I know I think more traditional ees like generally like their schematics to be more abstract Um, but I'm kind of like I kind of want to be able to do that planning from the schematic Will amp be be supported for the esp 32 s3 workflow? I don't know. I don't know why you need to because The s3 at least has um The s3 has native usb. So you don't need it for the c3 Jerry pointed out that amp didn't work But I did a fix last week that so the c3 should work with amp now Oh Those key cad tutorials are no longer available. They ran out Todd bot says I'll have a circuit by them 22 posts, uh, but I'll be done maybe this evening It's really just more audio control. Please that k. Thanks Yeah, I don't know if it's going to do the audio stuff like Jeff is doing A lot of floppy work and Dan is doing the usb stuff right now adding a second drive over usb and Depending on how this be least stuff goes that may not be finished by the time I need to disappear I thought I was going to be pretty good and then I I just ran into some stuff today where it was like Oh, this the nimble stack doesn't support it. So I'm I'm a little bit more worried that I'm gonna I'm gonna run into some like I've got to work on nimble things which Well, I may not I may not actually get to by the time I have to take care of a child Pierce says for the nr 52 840 with few exceptions crystal reset swd and adc any gpi io can do anything Yeah Yeah, they have that full full mox in the 840 Which is pretty neat. They have some constraints about high speed which pins can be doing high frequency stuff to like native relative to where the radio is radio pins are Todd bot says I'm almost able to write native circumfactor libraries now that dig into system resources So maybe I can work on adio stuff. That would be amazing. It would be amazing to have better audio I I took a lot of inspiration from Paul's teensy stuff, even if I didn't copy it directly Like trying to have like functions that take buffers in and out and do stuff But yeah, it's it's it's a little tricky because that like the audio pipeline also wants to be able to handle like Looping so you could say like oh, I want to loop this sample and and You have it all in memory. You don't need to recompute how you got the sample necessarily Oh Dylan says I'm relatively new to using circuit python and I have had a chance to write a circuit python 22 It's great for the keyboard stuff. I've used it for I'm wanting to try it for some robotics related projects Nice and it's important to note that uh, like you can If you're new to circuit python, a lot of what we want to hear is just what projects you want to work on So that we can make sure that they're doable from circuit python Um Neurodox says an issue with amp is that the latest imports You've been asking to be binary safe Jerry has filed a PR for that I thought we already Didn't we merge that in already? I guess we didn't Tammy says I don't know if I know enough of the low-level stuff to contribute to the audio stuff But it's something I'm interested in too Ham's lab says oh man a looper would be great, especially after a finish report Oh, yeah, I I didn't mean like recording a looper. I think that's primarily what molecular Ist is talking about Mark says I wonder how much of the audio stuff can be done port independent I know a bunch of it ends up port specific which makes the work harder File transfer over i-squared c I haven't thought about file transfer over i-squared c Ron says is there a good book on the esp 32 c 3 Book I don't know of anything that chips pretty new Um, and there is just the data sheet and the technical reference Um But i'm not sure what you're what you want to know about it. Let me just um Try to give a little bit of an audio code tour Because there's a lot of people saying they want to get into it. So maybe I can just Be like because I'm pretty sure so here's the gab repo And I'm pretty sure most of it's and so Mark is talking about how much of it is port independent and port specific Um, good night kanto Dexter wants a swarm of multi processing circuit python boards Roy says better understanding or guide for k m k software keyboard software maybe an rgb in it I'd ask I I'd recommend asking the k m k folks although Eva's been doing some k m k stuff for circuit python or for eta fruit I found it to be a little complicated I I need to get back to them doing my keyboard because I do want to switch to it um Charles says I hope to see usb hosts soon. Ah me too I don't think that I doubt usb host is going to get anywhere near Like unless dan picks it up like probably not till the end of the year at the earliest Okay, so so quick tour so in shared module. This is where like code is shared amongst things and so you'll see like there's audio core And there's these raw sample sources So getting and setting sample rate channel count and then there's like this Get buffer Get buffer done and then there's get buffer structure. I think this is kind of the core of the audio apis is that there is this like give me a buffer um So it's it's meant to be driven by the outputs, which is why input is not that well supported but this this stuff is meant to be um More about like say you have a sync so something that's outputting audio and it has to request chunks of audio in order to dma it out, right? and so that That request is meant to kind of cascade through kind of an arbitrary set of transformations Which is kind of what the teensy audio library is doing um and so There's this I think it's mainly this like get buffer Get buffer structure thing and the get buffer structure thing tells you like whether Your samples are next to each other or whether it's two different channels that are like alternating um basically like stereo or mono um And you can see that here. It's pretty simple and we have this notion of single buffer So this says like oh by the way like if you get a buffer, you're going to get the same one back Which means that if you did a transformation on it that transformation could be cached basically as well um So that's like raw sample wave file is more complicated because it's going to be reading from the file system But it has I guess reset buffers new But it also has this like get buffer call And then a get buffer structure call still So I think that's so these are the things where like sound originates And then there's audio mixer and there's like The mental model I have for mixer is that you have like Any number of voices or like channels on the mixer and then for each channel you can do something Um It's been a long time since I did this But you can see it has pretty similar like get my sample rate Um Mixed down one voice But there's still this like get buffer call again And then there's a buffer structure as well. So it's kind of like You're building all these objects up and they all have the ability to like get a buffer and output it Depending on the math needed the hard stuff gets into the port specific code Yeah, if you're if you're trying to optimize based on on assembly instructions mixer voice audio pwmio Yeah, so Jeff's Jeff's the last person that was in here But then again, you still have this get buffer Get buffer structure Okay, and then if you're looking for outputs the outputs will be port specific because they'll they'll depend on the board so like if we go into Atmel samd common how and we do audio bus It has pdm in and then i2s out Dexter says kick on voice what zero snare on voice one mixer works pretty well I'm not a math ninja either tammy. I feel you So like here's how i2s out works So It's got this play so you would give it a sample and The sample here is maybe I should make this bigger And make sure I'm showing it So what you would do is you would kind of have like this tree or or network of Audio generation classes and then you would call like i2s out play And then it's going to figure out like what's the sample rate clock the thing that's doing the outputting at that sample rate Figure out how many channels there are Depending on the channels set up the output to be the same amount of channels And then setting up audio dma That might be I think that's shared because the dma on the samd 21 is this Like very like you could use it for multiple ways to output stuff Uh, oh, you know what we can use this I got my invite to Code search on github so Raspberry pi has its version Atmel has its version Here's the implementation. So this is what it looks like on the atmel side Setting up a dma descriptor getting the structure of the buffer. So that's something we saw in the mixers and things We reallocate our two buffers. So like we're doing a double buffering. So we're alternating between them And setting up clocking for it That must be the dma still Trying to find where we actually load the buffer dma callback function dma load next block I know they have this nice There it is If you're zoomed out far enough you can do this search for That and if we find it This is where it's calling the audio sample get buffer So that's calling into things and getting Getting the buffer back out and then dmaing it Hopefully that gives you a little bit of an idea, but obviously it's not something I've worked on recently. So I I don't have a lot and A lot of brain cells dedicated to it at this point Um Ron asks, what do you think about the uh esp32 by bestselling author Eric Bartman? I have not looked at it. So I don't know My resource tends to be uh data sheets and technical references That's usually my the resource that I usually look at IDF the esp IDF has pretty good documentation too Oh, yeah, and pierz a keyboard person so can help with camk Are there keycap parts defined for the feather connectors? I have some somewhere I don't know if they're correct. I don't know what the best way to do it is But if you wanted like 3d models, they're just standard Uh pin headers All right. Well, if anybody wants to take a look at the audio code, I it would be awesome Um, circuit by the on dev on discord is a great place to do that and oh, I didn't say this at I forgot this in housekeeping if you're watching on youtube, but aren't on discord You can join the discord by going to the url adafru dot it slash discord Um, and then the middle box now above me is the the live broadcast chat channel for that And that's great. The great thing about discord is that it's chat That's around all the time And it's been growing and growing and it's a great resource for folks. So I I like replied to multiple issues today being like, are you on the discord? You have questions like that's the best place to ask Okay, so let's go through Give an update on the status ability on the esp and then I might just Try to work on it for the remainder of the of the stream Unless people have requests for what you'd like to see me do Otherwise, uh, maybe I'll I'll try to like Make a little progress. It's really hard for me Okay, well, let me let me not finish that thought and Instead give you the background first So this week, I think it's since last time What do we have? I I added beli scanning and got that checked in yesterday So that's the ability to So beli bluetooth low energy um We've talked about it before because I did a lot of the workflow stuff on the stream, but uh The short of it is that there's really two stages to beli To bluetooth low energy. There's one stage where you're not connected to any other particular device And that's known as gap. I forget what it stands for But it's the process of like discovering other devices around you and then initiating connections to those things And then there's a second stage, which is usually called gat Which is all about once you're connected. How do you figure out what the other device can do and and do the things with the other device? um so gap Is Kind of what i'm working on first because you have to do you have to do the scanning and advertising and connecting parts Before you can get to the part of doing stuff over connections So I got scanning working, which is uh, what's known as the central role, which is the I'm looking at what's around me and I may initiate a connection to something else And then the peripheral role is the opposite and that's advertising that's saying hey, I'm here Hey, I'm here and and this is what I can do or this is the information I have So that's kind of the two main roles and So this week on the s3. I got scanning working I and then I got um advertising working yesterday as well and I woke up to dan having just merged it and Which is great. Uh, it took a the scanning took a little while but the uh Though it took a while for the pr to get finished But the advertising went pretty quickly So the next thing on my list was doing The next thing on my list was doing server support um So once you're connected you basically have two devices that are kind of peers And this is I think something that really confuses people of like When you're in that gap role of finding other things like your, uh One person is the central one is the peripheral But once you're connected either side can disconnect and either side can be Either providing a service or using a service And this generic access protocol. Thank you bruce um And so there's kind of two separate roles then once you're connected Uh, you can have both a client Somebody work operating as a client of another of the other person or as a server So it's a client or server Is the terminology that they use and when I it took me a long time to like understand all these terms um When I was first doing beli, but it does I think I think they ended up with the right terms It's just really not at least it wasn't explained well where I was looking at it um But it really is like one of the more helpful things I think with beli is just separate in your mind that Advertising scanning connecting part from the once we're connected now we can discover Like the service the servers that the other person provide the other device provides and then you can provide services as well And when you're the person providing a service, it's called being a server And then the client of that server is interacting with service There will be a pop quiz at the end of the stream So yeah, that was the main thing that I was working on you can see that these other prs that I did were seven days ago And pr confirmed that it can be confusing Oh and bruce linked to a punch through Let's see what this is um The general topology of the network stack Yeah refers to how data is transferred Oh, yeah, they even split up peripheral and central broadcaster versus observer So I think I think in terms of beli and and I thought that's kind of from the point that I was working on it is The power of beli advertising and scanning being a broadcaster or reserve observer is like Underrated like people don't fully use it. I did this project um a while back when I was doing Earlier called broadcast net And this is what it's called here, but JP wrote it up as a guide and The idea was that you would just have one One or more devices that were just actively listening for kind of standard advertised standard standard packets of like iot data that Not sensitive could just be like temperature in your house and the idea was is that when you need to uh It would just listen for any of these packets and then it would Send them up to ate a fruit i o automatically And if you wanted to add a new sensor, you wouldn't have to change that piece at all Just when you turn the sensor on the the listening piece then automatically creates new feeds and stuff and sends it up um So I think that would be Yeah, that was Pretty cool, but the problem was is that at Still they're the only thing that can Can really do like the what the net networking side and beli side is like a raspberry pi So this this guide uses a raspberry pi to do the beli scanning and then writing to Whatever web thing that you want So one thing i'm very excited about and could actually do now Is run the like bridge Uh using the esp 32 s3 So it would be listening for beli And then do a wi-fi network call to report it back when when it hears stuff So I think that would be pretty cool Let's see And beli is terrible the terminology and the process they try to make it better by doubling down Unwrap every version on stuff every version Disciples says question about beli keyboards Would it be possible to make a split keyboard so that one of the haves is connected Both to the computer and to the other half I think that is possible the thing that you have to watch out for is usually it's a compile time compile time Configuration for how many connections you can have at once But usually you can have multiple at the same time and pier is confirming that that says That's what everybody that does beli splits do pier says beacons that don't actively get connected to really fit in that terminology I wonder How much more complicated it will be with mesh? Yeah, a lot of the Linux side it particularly like a lot of the uses for Uh beli advertising and scanning is really just to discover a device you want to connect to so it's it's That software is not usually designed for the case where Were you doing like broadcast net where like no, I want to listen to every advertisement I want I want to hear every advertisement because the data is changing and I care about the data that's changing And if you followed any of the coveted Any of the coveted uh proximity what what's the contact tracing stuff that like apple and google did that's all with Um That's all using beli advertisements as well I'm scanning in advertisements That'd be incredibly powerful in so many use cases. Yeah Yeah Yeah, I got what you meant by rap um I don't know I I generally think beli four and five have been pretty good Uh, will the code be interchangeable for beli between esp 32 and the nr 52 840 boards or will it be slight variations? hopefully Hopefully they'll be the same um And yeah, the ship who says that's what nimble thing is for Hopefully they'll be the same The thing that you might run into is there might be things that aren't supported So I'll give you one example that I think we're going to have is that the esp 32 Not the s3 not the c3, but the 32 Can do beli, but it's beli 4.0 Which means that I don't think it can do extended advertising whereas, uh And broadcast net uses extended advertising if it if you're sending enough data um So there might be things that that Although the api will be the same it would raise an exception if you tried to do it because if it was unsupported um so yeah, I like I missed this little like brief thing where I was like getting really into it yesterday And then now it's three o'clock on a friday, and I'm like, uh, I don't really want to get too much into it. Um But we can take a a bit of a look at this I'm guessing beli scanning and advertisements is how apple air tags work too Just yeah, I believe so. I believe air tags are basically this but air tags are basically the same thing as, um The contract tracing stuff and the way that that all that stuff works is there's like you provision encrypted Broadcasting numbers that you're broadcasting based on like from the air tag or your phone for the cove case and those seem like random numbers to most people except if um, you know that the key is something or something like There's a bunch of cryptography around what you're broadcasting um So that like it it's private The the problems that iphone's have been running into that the apple's been running into with the air tag privacy is really when somebody Attaches not not your air tag to to you so that they can track you um ah, so unexpected maker says the the esp 32 can Advertise extended stuff because that's what they're using for the sam But I'm not sure if it can receive extended newer versions of beli are adding parts for like angle tracking and things like that Which is fancy Actually, maybe that's what I should do right now Should I see if I could get this broadcast net bridge going? That might be that might yeah, let's try that Let's just see if we can't get The air tag main issue is in the technology problem. It's a people one Keith, are you saying getting the broadcast net stuff going would be cool? Good night, Dave. Thanks for hanging out. I think that is a good idea It should port so we it uses Beli IO to do it. All right, let's do that. That's a good idea Where's the source? Blinka bridge Oh, it's just in the broadcast net directory Okay, so let's see This is my PS RAM version, so let's start here I do have I actually do use broadcast net here But I think the raspberry pi that I had running the bridge is broken So my sam racks send data to the raspberry pi from the tp nano and micro python using extended advertising So I've got this and This was my my advertising tests. So it actually allow it Advertises as being connectable And then it just prints out when it's connected and disconnected. So I got that far Confirming that I could connect and disconnect. Okay so Let's find this broadcast net stuff. I should say that broadcast net is not As useful as it was at the time because Brent has done a lot of Brent and Lauren have done an awesome amount of work with whipper snapper and these inexpensive Wi-Fi capable like the qt pi s2 would be perfect for this sort of stuff too I don't know what the battery life looks like the battery life differences look like between esp32 and the nrf But it doesn't really matter if you get them both sleeping pretty deeply There is a bug Slash miscommunication of how the way that esp sleep works or sleep works deep sleep works That I filed an issue for and somebody had commented that When circuit by the wakes up from deep sleep, it's on for at least five seconds and That was really weird to me because I thought the policy was that we'd only be on for five seconds the first time To see if you're connected to usb and it turns out the way it's implemented. It's it always does it Which means that you're always awake for at least five seconds Even if you've been trying to deep sleep So I want I filed an issue. I want us to fix that because a lot of the challenge with Low power is just being asleep for as long as you can and when you wake up being on this short as possible time Okay, so broadcast net has some issues. I'm not going to get distracted by that um Let's just I'm just going to download a fresh bundle and snag it from there So I can have the latest version I don't use circup yet. So don't hate me and extract it all So here I am in the bundle And in examples, we're going to want podcast Broadcast net blink a bridge. It's called blink a bridge, but we're going to make a non blink a bridge So we're going to copy that that'll be our code.py And then We also we're going to need the actual library. Let's get the in here tio dev Serial by id usp expressive Oh already got it open there, but let's move it to the bigger one I aspire to that low power lifestyle The circup non-believer get him I just I'm I'm I'm a believer in circup But I just I've done circumvent them for so long without it as Keith eat Keith Keith points out workflows are hard things to change Like fundamentally the way I program by like using the command line and an editor that doesn't do fancy type stuff is like Very much like the way that I started printf debugging is like it's just the way I've always done it I wonder what things I have actually incorporated A lot of it's the same I've been doing python for Almost 20 years I think If your iphone supports ultra wide band and your air tag is nearby You can use precision finding to help find it fancy I've been a Vip Vimmer for decades. Yeah Oh, yeah, I'm expecting maker points out you can you can import ate a fruit's eagle files in the key cad That's actually how I was using it That explains why I couldn't import pdb. Yeah I've just I've never used pdb myself and so that's not something I felt like I've got to have this I did start using f-strings everywhere, which is cool um Okay, let me Rename this code up. Hi. This is my workflow too advertising Simple tests And then I want to use this so I'm going to rename this to code up. Hi See Grover says the footprint is fairly easy to create. I have a few different two layer designs with custom silk layers in key cad not work There's this lag that I don't know where it comes from Sometimes I need to do a sync to get it to write the full file No module name secrets Yeah That's it needs my I don't want to show my ate a fruit IO credentials. That's why I pulled it off the screen Uh, but I might have a copy of the No, it would be on the raspberry pi Let's just not do that right now Didn't key cad 5 have import as well I'm just going to Comment out secrets here I don't actually care to do the ate a fruit IO pieces right now Requests actually we could I could copy requests over though Oh is it it might be importing regular requests import as requests This conversation shows why discord is great ooh Just curious. I haven't looked into this But is there any good libraries for creating and managing sequel light databases on circuit python hardware directly? so Somebody made a micro sequel light for micro python That looks really neat, and I would totally be game to have in circuit python, but I haven't looked into it um So yeah, I would look in micro python land for sequel light stuff And it would be super neat to have it in in circuit python But we don't yet so ate a fruit be oily be oily broadcast net. It's not available Do that. Yeah, I would like this to oh, it must be a single file It would be cool to have this supported name secrets is not defined. So off header Existing feeds. Let's just I just want to print it out Actually, I wonder if there's a simpler Oh, well it started up Scan done Does it have a timeout? I don't think it's supposed to have a timeout Does start scan have a timeout now? I was wondering if I think I have won. Oh, no, you know, I think I I disconnected the sensor downstairs Um, okay, let me update this other Let's get two going And see if we can't get both ends working on a s3 So I've got here Another Or but this is a mini. I think this this is one that doesn't have any ram So I'm gonna have to make sure I load the right thing. I'll do it Um And in fact, I'll do it on the ur that is an n8. Yeah, let's go here And let's not do debug Oh, and Oh, I guess that is real than flash that For recent project I ended up just logging data to a text file on the circuit python hardware Then I made a python script on the computer to parse and append data to a SQLite database That's a good intermediate fix, but it would be cool to support sqlite. I'm a huge fan of sqlite Um, I like that. I don't have to worry about running us a data base primarily All right, so we should be flashing Well, we're building and then we'll flash the ps ram list version of circuit python onto this Second board and we'll do the broadcast net I don't know. Have we hooked up the temperature sensor yet? But we'll get it it broadcasting out and then we'll have one listening as well And the idea the idea with broadcast net is that you don't have to change the bridge or any of the software Um To add new nodes, which is cool And then one of the the other things I was thinking is that When it logs to ater fruit i o it will log to a bridge specific Feed as well. So you can actually if you have reliability problems where like It's a I live in a three-story house. I'm on the second floor If the node is on the other side of the house and I only hear it once in a while I could actually make another bridge closer to it And then they both kind of independently report the the values that they hear So it's like another like You don't have to worry about everything else. You just add another bridge and therefore you get like some redundancy in listening for values um I was I I really think broadcast net is pretty neat, but then again like if you have Wi-Fi you could just all do it with Wi-Fi but I think At the time we did broadcast net bridge and maybe that was pre esp 32 s2 actually When was that guide written? There's three unresolved feedbacks. I'm so bad at that First published 2020 But the esp 32 s2 came out after that, right? March of 2020. I have no idea Feather came out Just recently Mag tag we did a lot of work for It's november of 2020. So yeah, I think I think Throughout 2020 is what we're doing s2 Is that right? Fun houses s2 April of 21 Yeah, that must be it. Yeah, I think most have done broadcast net before we had Wi-Fi What's your standard of work regarding compiler warnings? Uh, generally I fix them, but the compiler warnings you were seeing go by our esp idf ones So I was ignoring those Okay, so we're flashed And now i'm just switching to the other usb port for native usb And I should get a second. Um Second circuit python drive shown up here So let's see. What do we want to put on this? So here it actually shows up as circuit pi one Hey, and you can see my wi-fi password Don't come to my house That's not cool Let's close that and rename it That was the wi-fi test And then let's look in bundles examples Philly broadcast net exponential backoff Simple test. Oh, there's a scan test. That's probably what we should be using Copy there code dot pi And maybe what we do is we split here and we do another to serial by id usb expressive No r I really like this serial by id. It's really nice I don't know why control d is so slow Unexpected maker just did a pr for their new s3 boards for tiny uf2 ha ha ha Really Remember that magic you did on the circuit python repo to not build every board on the On every pr time for that on tiny uf2. I think you could do that Or you could file in file an issue on the tiny uf2 stuff and Point to it. It's not Too hard, but I don't I don't does tiny uf2 split jobs Split board jobs. I don't even know But yeah, I mean I'm excited for your pr for circuit python to support your new s3 boards So we're grabbing the library lead broadcast net copy there Restarted and now needs the b lead library You folks who use cirq up are probably Your heads are exploding right now, aren't they? Not implemented Working on that right now. Yay You need github actions food for the build what changed stuff All right, so let's see what is on line 16 here Oh cpu temperature is not implemented. I could do that First let's just try setting it 40 I'm surprised we don't have cpu temperature actually Yeah, so the way that this works. So the way that broadcast networks is that it has a sensor measurement advertising class where you can set a value on it and then it also I don't include the sequence number But there is a sequence number slot so that you can increment the sequence number And your bridge or your data that's with the bridge can know when you when it misses things So you can get an idea of like how reliable it's transmitting So let's go over here and do scanning broadcasting Yay, it found it. It just crashed Um, I don't know why it's not infinitely scanning Mm-hmm. I have microcontrollers scattered all over my desk I have bins per manufacturer. So I have like I have a giant bin for a sandy and stm's and then I have like a overflowing bin for esp and nrs That's kind of how I and then I have a separate place for ate a fruit specific boards and All different ways of organizing them And a lot are on my desk right now too. All right, so let's Continue trimming this down so that it Missed message counts Fee so this is successfully like broadcasting Every so often it's me completed It should be it should be scanning forever. I thought Oh, there's one It went real fast because it didn't actually log in Um, but here's so here's like the feed name. So it's the MAC address of the It should be the MAC address of the bridge and then the MAC address of the sensor And then here's the different values you have missed message count. So that's based on the sequence number and then you have like like The field the temperature and what the value is um so they have a The the one caveat is that they have the same notion of what the um The fields in the in the ate a fruit sensor measurement are so We have two things we could do in the next 25 minutes One is I could try to get cpu temperature working which i'm surprised does not work Let me just look at that first and then the scanning is the other thing that I would Like to figure out so The cpu temperature is going to be in common. How Microcontroller processor processor get temperature Oh, I'm in nrf. I'm like bluetooth soft device a place expressive Do we really not have cpu temperature? That surprises me processor Oh, if Does the s3 not have the ability to measure it? It's just not implemented Paging unexpected maker Can we read the cpu temperature of the s3? It's really nice to have This is for the c3 Yeah They at least have these um nice caveats that it's really not the external temperature But it is really nice to have A sample source s3 Wi-Fi bluetooth peripherals Not supported IDF 1793 How do we find that? Sensor The isreal defense force. That's not what I mean by IDF. I don't look like it It might not be supported yet. Well, don't they have Issues They have an internal bug tracker too Not sure how to read it Thank you and expect a maker Oh Yeah, that doesn't look like the IDF supports it yet Which means that I'm kind of at a loss We could look and see what the datasheet says But I don't think it's worth it Could just be like hey like we care about this. We'd like to use it. It's great for demos Like this one um For now, let's just take a look at scanning because I thought infinite scanning should work Um, so let's go into bio adapter start scan Oh, there's this, um That's ported in 4.4. I wonder if they added it. I wonder if we could backport it It probably depends on some other stuff bummer All right, thanks for the reference. I don't expect to make her appreciate it All right. Well not implemented error is the right thing to do In that case Let's turn on bili debugging. So in circuit pi Could make is this word in verbose bili So I have some debug statements that are behind this verbose bili flag And then let's add a debug print to Where's the scan event? So here's the unsupported scan event And let's just do scan done To know that that's what's finishing it up And then I thought that I'm out here Well times a thousand a thousand Let's just print it out So let's see. Which one are we talking to? This one's still going This is the one that keeps finishing Just this one I think So I'm not using the uf2 loader at all. I just do the flash thing Oh, I can't see youtube chat Is it probably not looping because the timeout for the scan isn't defined? Yeah, I don't know what the default value is That's something I will look at Because the library could be adding a default value Or Or the native code is So we can look in shared binding this shared bindings to see what the native code does for timeout So boeio adapter Start scan it says Ugh timeout optional float none And then They're not none If timeout is none is not none Get it otherwise It looks it's like it's set to zero It checks to make sure that it's not zero If timeout's not equal to zero make sure that it's less than the interval So I think what we would expect is it to be zero So, okay, we're here. Oh, it didn't work pro tip. If you try to flash from here and it doesn't work. It's because you're um connected Via the serial link Yeah, we could we could backport If if they've added it if if they've added the temperature read in 5.0 We could probably backport the code from there and just like directly into our stuff Yeah, Roy, it sounds like you have a kmk problem. I think that's the conclusion to ship it will come to you If you can use Neopixels straight with your rgb, but they can't with kmk then there's something weird. Okay This process takes a little while flashing to the esp I just put headphones on and i'm just like going when i'm doing this restart this usb is live The bridge heard it Okay, so we got two scan done prints One thing that's interesting is that this The capitalized scan done was printed before the other one The other one is in the callback, which is what I would expect to show up first Let's hit control d To re-run it again and we'll print out the timeout Scan timeout zero So I wonder if it's weird that this scan done happens before the other one Right, so if we look at adapter Scant timeout is zero We should double check that the nimble api Oh, oh, oh, wait. I did capitalize it Okay, so it is doing discovery complete And so we need to figure out whether Be a leak at discovery What happens if we give it a timeout of zero? There might be a different value that we want to indicate forever Um, so the place to look for that is I actually have two text windows open and the second one here is with the nimble api There's one that I've been editing the code high stuff in So there's beli gap h And that's where Discovery call is duration In milliseconds Specify zero to use the stack defaults, right? So we're not doing forever. We're doing Stack defaults. So what we're going to want to do is we're going to want to do this beli hs forever Which I'm curious what the value of that is. Oops Get Rg that In 32 max It's not actually forever. It's just in 32 max. So what we can do here is in our adapter code Now that we know This constraint about zero We can say let's just do Let's call this timeout ms We can even call it duration to match duration ms equals that i'm not going to print it out anymore Good, this will be a nice small fix There and then we can say if duration ms equals zero We mean beli hs forever forever Which let's see how many milliseconds is in 32 max Because that's kind of interesting if if you're meant to like set this set this thing up for a year and just let it run like heavy How long would it run until it actually stops? Because it's in 32 max zero equals forever or at 32 bit max is practically forever. So zero zero is meant to mean forever in circuit python In nimble the beli stack that we're using it it means the default value Which is not forever Just why we're doing this so let's Disconnect again Reload Usually i'm not switching the usb back and forth. I usually have just two of them plugged into the same side Are you asking us to solve the halting problem? No, i'm not trying to determine if it'll halt or not i'm just I guess they could special case it later to mean Like i don't i don't know whether they internally track the timeout or not So i just keep you awake tana. Feel free to sleep on stream. I do some weeks and folks don't even realize It's just friday afternoon. I'll tell you that much What are the units on the timeout value? I think they're microseconds. Yeah Or milliseconds. I think they're milliseconds Microseconds would be us Does cp equal np? Um, and there's computer science people in the audience halting problem and p equal to np That is a long time then. Okay, great friday afternoon yanis 24 days if milliseconds But yeah, that's not that long It is signed as well. So it's 2 to the 31 It's not unsigned It's like almost 80 degrees in here. That's part of the reason why i'm sleepy It's nice and warm All right, let's switch it. This will be a good thing to go out on if it works So we plugged it back in let's switch to here Circuit pie drive showed up I guess I could get the networking stuff going Good night diship you sleep well Sleep well All right We're getting multiple sensor readings in 24 days is forever to the average zoomer But like the myth the the point of this thing is that It's meant to just run forever And that's like thousands of ticktocks And we're just measuring everything in ticktocks now so that the unit we should use for time How many ticktocks? Cool. Well, this is working Uh, I feel like I should show all the i o integration, but I don't really feel like Figuring out what my i o keys are Uh, which is why Oh, I'm gonna get it Sorry As is it's really neat. Thank you Keith. I think I feel like I should While we're talking about it. I should put a while loop Around it. I don't ever want to get to scan done Actually, you know what we did look at we tried to see if it's It's used in examples Like it could be used as a sentinel value In 32 max Yeah, I don't actually uh-oh Something disappeared. I think I'm in safe mode Uh-oh What happened Assertion format not equal null failed I had this I saw this before I was trying. Hmm Not equal null. That doesn't make any sense to me How do I figure out what devices can listen for these advertisements? What version of bluetooth do they need to have? So bluetooth 4.0 should work. Okay um, that's without With without, um Extended advertisements, I think I actually added a thing to Prevent you from going over the limit of extended advertisements because I don't if I remember right the I don't think the raspberry pi Can actually listen for extended advertisements so I think if you try to send too much data, it will actually just do um If you do too much data, then it will actually just do Multiple advertisements to like push out all the data um But yeah version of bluetooth, I think like 4.0 like any bluetooth low energy should work. It's just advertisements and scanning Um C python you can run with dash c1 to turn off assertions. Yeah, this is a debug build. That's part of the reason And I should figure it out because I saw that this is it has to do with printing out an exception. I added this cool thing. Um Yesterday There's this, uh Not insured bindings I added this check nimble error And it uh, oh, you know what I don't know. I don't know what that's from. Um I thought it had to do with this But it it must be a different exception that it's having a problem with Uh, but I came up with this so there's this check nimble error And then it takes file in line number and then I added a macro check nimble error That automatically adds the file in line number It's really for my debugging yesterday. It was really handy So like there's a lot of calls like for doing one thing. There may be like three or four calls to nimble Um in order to make it happen And so you could just say like after each of those calls I say check check the return And in proper circuit python, I'll raise an exception Well, what it does it raises an exception and if it's a debug build the exception string includes the line number And the final number of the exception and the in the error code. So that was really handy Um, Keith says this is exactly a branch of project I can see a lot of labs using first grad students building a coffee monitor And quickly scaling the other small monitoring task. It's so neat how easy it is to set up and get running That's the hope Yeah, so extended is just longer Pierre says I use nrf connect on my phone to see the whole list of what's around me The list is crazy long where I live and I don't even live in a condo tower Yes, that's why I did scanning first. It's because like if scanning is working you get a lot of results um So yeah, you can now use the esp s3 to do scanning stuff as well But yeah, this is this has been super nice And I don't know why this assertion is happening I think it's something separate It is weird that it went into safe mode It would be great to see a back trace of like what is handing in a null format I thought it was The file name thing, but I could be wrong I don't know I think we successfully finished the scan stuff Um So I could just do a quick Oh, I'll just call it. I'll just call it my my toast. It's the weekend for my brain Let's switch over to the camera notes So thank you everyone for another deep dive Uh as a reminder, uh, I'm scott. I'm sponsored by Adafruit to do these streams and work on circuit python If you want to support them go to adafruit.com purchase some hardware there that looks neat to you Uh You could find something that is a project you've always wanted to do there. There's lots of tutorials and stuff um If you'd like to chat with me and a bunch of others working on circuit python and all sorts of different things You can join us on discord at adafruit Adafru.it slash discord. That's our short link Uh for Adafruit Yeah, we're on there and that's what this middle box that I can't point to is that's the discord channel Uh of live broadcast chat We'd love to have you there the the other streams chats disappear at that point. So That's why discord's great. Um deep dives happen every week normally fridays at 2 p.m Pacific unless I take the week off next week should be normal. Uh, so Seven seven days from now one week from now. I will have another deep dive Hopefully I've made a lot of progress on connecting over vealy. That would be great Um, typically it goes for two hours or more Right around two two hours today um We'll take well, I'll look at unexpected makers pr next week. I won't wait for it, but They're they're just about ready. So that's exciting um Last up all notes are available on github at github.com slash adafruit slash deep dash dive dash notes Thank you to dcd david for taking those notes for us And thanks for patrick for automating the scraper and maintaining the scraper and getting All of those uh notes in there and linked up. It's super helpful. So with that I will Thank you all I'll switch to cat cam give the cat a pet and then call it a day Have a great weekend everyone cat cam But the sun's gone More often than not after the stream he gets on my lap because I just got him interested in more pets All right