 All right, good evening everyone. Hopefully we are on the right microphone We'll be registering if those Okay Hopefully the sound is all right. This is showing the wrong one, but I think it Yeah, okay inside OBS. It's set to the right one. So that's why it's able to find it if the If the microphone audio is a bit too low or something like that Let me know I'll try to bump it up some I think if I switch it there I can affect the volume a bit more, but I Will continue on for now. Hopefully it's About like normal let's Pause that pause this this out of the way And chats pulled up over here Let's go and DJ Devon as well as Beata graph over on YouTube for Beata and discord for DJ Devon sounds good. Thank you. Appreciate the heads up there. All right So let's jump right in Hello to everyone. My name is Tim. I go by phoma guy on github and discord This is the deep dive program, which is a weekly live stream program where we are diving into the You know deep into the depths of circuit python Sometimes we are going all the way down into the C code. That is the circuit python core Sometimes we're working on circuit python libraries or projects or infrastructure or debugging or documentation It really just depends from week to week. What is going on? If you are brand new though, and you have no idea what I'm talking about Let's take a step back and just give you a high-level intro for those folks that might be new Circuit python is the main project that we are working with on this stream The main website for it is right here circuit python dot org circuit python Essentially is an implementation of python that is designed to run on tiny computers called microcontrollers There are a bunch of pictures of these devices over here on the downloads page at circuit python dot org essentially all these devices have a You know a relatively small computer built in and that computer Can run circuit python what that means in practical sense is that when you plug these devices into your computer They will show up like a thumb drive on that thumb drive. There will be a python code file You can edit the python code that is in that file and save it and the computer that is built into these microcontrollers Will read that file for you and execute the python code that is inside of it Um circuit python is an open-source project. Anybody is allowed to use it anybody is allowed to You know port It to their own hardware. So if you're a hardware manufacturer, you are allowed to port circuit python to your hardware You don't have to pay anybody to do that. It's all free. It's all open source It is primarily funded by this company. Adafruit. This is their website Adafruit.com Adafruit is the company that is paying the folks who work on circuit python. So like I said, it's free to use it is open source It's available for anyone to do what they Want within our very permissive license Adafruit is the one who pays the team that works on it though There's a team of folks who work on the project full-time That are paid by Adafruit to do so there are other people like me who are paid to work on the project part-time And Adafruit is the one making that possible. So thank you of course to them and then if you would like to help support the project You know in a way. That's not like getting involved in development One of the ways that you can do that is just by heading over to Adafruit.com purchase yourself some hardware there they manufacture electronic devices in New York and they have lots of different microcontrollers like the devices that run circuit python They also have all sorts of other things that you can connect to your microcontrollers to interface with so, you know motors servos buttons beepers buzzers lights rgb's You know pretty much any kind of little electronic doodad that you can imagine They probably will make or if not make sell over on Adafruit.com Many breakouts are designed and manufactured like I said at their factory in New York Some devices are third-party just you know sold through them But the the key thing with all of it is it's all kind of electronical hardware Designed to kind of interact with at the microcontroller level Alright, so With that out of the way Let's look at Let's take a more specific look at what I want to work on tonight So the first thing is going to be check-in on the type annotation PRs over here on the EPD library EPD library that stands for e-paper display. This is the library for interfacing with E-ink devices so if we head on back over to Adafruit here and search up something like E-ink what we're going to find is There's a selection of different E-ink displays that you can connect to your microcontrollers and other devices And if you want to use those with CircuitPython, this would be the library that you are using if it is one of the more basic E-inks like Certainly something like this monochrome that's going to be using the EPD library I would assume the same thing here for this grayscale one The ones that I am less sure of are going to be like the multicolor like this one does red as well as black and white There's a yellow one somewhere as well. I think Looks like this one does red as well. I don't know if those are covered under this library or a different one, but Um, yeah, definitely at least the monochrome perhaps the grayscale as well. Oh also before I do jump straight into that I noticed Over in the youtube chat From a little while ago. Sorry. I don't know exactly how long that got put in the chat Ago, I know it was some time before I actually started streaming, but I'm not sure exactly at what point so over there to Sega Haley Apologies if I have mispronounced your name over there on the youtube chat If you're still around and you are interested They have asked a question in the chat there that says I purchased a one meter neon strips Wondering how I can control the lights Um, yeah, so the thing that you're going to want to do if you if you are still there my friend For one thing If you do head back to Adafruit and you find the product you purchased So i'm assuming you mean something like this like the one meter neon like Strip if this is like, you know, there's a couple of different ones. So whichever one you got find that product page And if you scroll down towards the bottom Let's see here Towards the bottom of the description There's going to be this link here this guide So this is rgb So if it's an analog strip where you have like four wires to connect to it, you know one for red one for green one for blue One for ground then that's going to be the learn guide that you want there If it is a different one that has like neopixels inside of it like this one here Neopixels don't connect with all those same wires You don't need red green and blue what you need is like a power ground and a data wire So there's also a guide at the bottom of this. Um, that's typically the best place to look for whatever Product you did purchase from Adafruit Look at the bottom of the description Sometimes it will be maybe like down here at the bottom of the technical details I have seen that where it's like below the video instead of above the video I'm not sure if there's a rhyme or reason to that or if it just depends or whatever But somewhere towards the end of your description, you should find a link to a learn guide That learn guide is either going to be specific to your product Or it's going to be a more general one like this neopixels one here That's going to tell you generally speaking how to interface with neopixels, which is what this particular strip is here So a long-winded answer But head there get to the learn guide link for your product and that will show you how to hook it up It will depend entirely on which one you got those So I can't just give you like a one size fits all Answer Hopefully that will get you pointed in the right direction. How's it going over there on youtube to uh, james matthew higgs Um, thanks for joining us today my friend buying Adafruit hardware from the website directly is the best way. Yeah for sure Uh, best way to support them. Yeah for the work they do Okay So yeah EPD. This is where we're starting. This is a pull request That's in for the type annotations and I'm thinking we're gonna be having an update. I think on this one So we did a one round of reviews on this. There's been some changes since then and then we've got the new stuff here. So Uh, let's see implemented in this branch merge the other ones now We can view all the files here locally pilot complains No completes without errors On github it complains about the type image Uh, which is part of pil so probably what this means is uh, this person when they're locally running pilot They probably have the pil library installed in their python environment Whereas in github it will not be there automatically. We would have to put that in requirements Although I think for image. I believe maybe we made a uh I think we made a protocol in I don't know if that's the right term But I think we made like an alias or whatever we made a pretend image Inside of the typing library so that we don't actually have to Have pil itself If I recall correctly So let's double check that that's going to be over in circuit python typing It's here reminds me actually I have In the works for a different pr actually a need to submit Um a pr to the typing here to add The color alias That's a different topic though Um PIL indeed. Yeah, we have this pixel access image is a protocol. Okay. It is a protocol So what we want to use is this image here instead of the one from pil So let's take a look at the code Yeah, okay, so they've put that in there pil It can be imported like this Yeah, but that's the tricky part because the truth is I don't know The exact exact syntax for it. So it's going to be like from circuit python typing dot pil Import image. I think But we're going to have to double check that because I don't actually know for sure. It's like this We're going to double check though. So I have a device connected. I'm just going to use What I had to you. Oh, I you know what happened as I closed this pie charm accidentally. That's right I think we don't have typing so I'm going to have to get that Probably not the right name actually Ah, we don't actually have a thing we should put a we should have a sample in there That'd be another thing to submit for a pr to this one It it's a weird place because like Doesn't actually run necessarily doesn't actually do anything Um, but it would be nice to have at least an example showing the syntax for how you import it and how to use it Um, here's what we're going to do Go to the bundle I'm going to go Pretty much this except for i'm going to change this part to say That's going to look through all the libraries all the files and try to find The string that I gave it which was here We found some usages of it in rgb display and sharp memory display I'm going to go look at that Although this tells us right here actually Okay, that should mean that it is actually the circuit as well. I think should actually work. I think Didn't Is it not in the bundle? It's not in the bundle It's an awkward thing because you wouldn't or like you ordinarily you would not put it on your device It doesn't necessarily do you any good on your device Must not have releases. Let's have releases It's impu wide Just download an old school. I've not downloaded a library like this in so long Wait, what? No, I don't want to I take examples And have the code in it Well, that's Having the actual code Okay, leave that there We'll fix that later For now though, what we do then is we just grab the actual code, I guess Guile additions there you go Probably the branch from when they were added Back to main update Just the latest stuff there Grab the library finally we can put that on our device. We're going to go to the lib file folder And to make sure that that import works for us That is really what we're trying to confirm here is that this import is going to work Doesn't but that's because it says it needs typing. It's like the python typing, I think It's actually run it on a device So, in case we run CPython But like this, okay That was a long road, but we made it in the end I'll go ahead and do start review We'll make another quick pass through and see if there's anything else that catches Yeah, although I have been through it, I think a couple of times at this point Although some of them was in the other files. That's right. So We'll see if we find anything ints for widths by A bunch of digital in-outs for all of our pins returning none And as an int, data is an optional byte array Int or byte array returns int Returns probably optional int As it can be none Oops, bunch of nuns indexes int int int for x and y 0 or 1 inverted turns none 5 int int returns none int That's why width height color are all ints Why width height color again full int returns none string for string int int int string for font name Size is an int width height rotation int returns none int int int int Why height color all ints Image is the image Okay And the rest should be more or less duplicates truthfully like most of the rest of this is going to be uh individual drivers for the individual displays which are going to have Like in a knit method and a couple of overridden things that are basically all the same as the one in the base class Just the difference would be the uh in-nit statement. It's different the um They call that sequence a knit sequence It's by a digital announced boolean It's none none none 0 1 returns any Nice to narrow that further than any we have uh We have command typed more specific. Okay command is typed as returning an int Therefore, I think instead of any back down where we were here Just going to go back up and actually just mention here the same for all the other files as well the way I don't have to like I'm going to need to put a comment on each one like it's You have to follow through there And all of these I'm assuming are basically Like actually the same same at this point now everything that we're seeing an item set item That's a different thing actually in mcps ram. I don't know what that is I hope that right s ram that one might be tougher. That could be a SRAM. I don't know what that's reading from I would guess it's probably like gonna be bytes or int or something though instead of any but Spy int what would value even be here erase the past number of bytes? starting at the past address So we get past a number of bytes We get past an address address the length What is value? writing that Oh, I don't know about that interesting This should probably not be called a race right it should be like replace or Something because it's uh, you give it Actually putting data back That's nothing to do with the type annotations though, right? Let's just have this Function was written initially Union zero probably doesn't Union it's like maybe literal or something. It's actually interesting that it is I wonder why it has to be zero for that one This one allows zero or one I guess that other display probably just doesn't allow Oh Okay, maybe it's a monocolor Cut up on that and then this one will fix the It should fix the pylon tissue Didn't mention it in here, but I'm pretty sure this will fix the pylon tissue. It's the wrong one I'm late for EPD You get into how to use buttons on a monochrome Eat ink bonnet Uh, so I can't say as though I know answer to that off the top of my head You could certainly take a quick look though. Is it this thing? Number five these two over here. I'm guessing look at the learn guide. Nope. That's not the learn guide But here we go. This one. It's below the technical details the learn guide Sometimes in a slightly different place Doing is probably pretty easy. It's just going on the header there all display pins There we go a button down button button usage I think this is the uh learn guide you need Pikmin four over on the youtube there looks like those are connected to pins d5 and d6 On the raspberry pi if you're using a standard like blink of You know and stuff like that on the on the raspberry pi with its regular header If you're using a different thing that's not a raspberry pi then those pins may be different for your device Okay, what kind of file to put that into and how to activate it. Have you done anything else with the display yet? um I mean it would go into a python file on Your raspberry pi and then you would run it with like python 3 space And then your file name Really, it would be the same way that you're running the file that is initializing and drawing stuff on the display as well So if you have done that already then it's essentially the same Type of file that you need to create and run If you have not done that already and you're like Just have a plain raspberry pi out of the box and have not done anything else to it yet Probably the first thing that you need to actually do is find the This guide right here circuit python on raspberry pi linux There will be basic setup in here that will get you up and running with blinka Which is the c python compatibility layer that runs on raspberry pi to allow you to use circuit python libraries like e pd Uh for what it's worth. You won't actually need e pd in order to use those two pins. So Um, if you're just trying to get the buttons, you don't need the e pd library You just need to hook up digital in-outs onto those pins You have a btc ticker On the rpi 0w. Okay. Yeah, they're the same. I mean the same way that you're running the file there It should just create a new one with your buttons Or I mean you could add code into that one You've got I guess right and then handle your buttons inside of there You'll just have like if you know button dot value is true Um true or false. It depends if it connects to ground or not whether it will go high or low, but Okay, next thing I want to look at is Built-in sd cards. So I have acquired This device This is an inky frame 5.7. This is a pimeroni device I accidentally hit it and it worked. This is a pimeroni device with a raspberry pi pico w On the back. It's just soldered with the castellated pads or whatever there And then obviously So a couple of things about it. It has a built-in sd card It has a pico w which means it has wi-fi access and then obviously on the front it's got this nice 5.7 inch Seven color e-ink display right now. We're looking at the display showing just black and white with the serial output But it is actually a seven color e-ink display and it can output seven different colors although those seven do include both black and white so You know five colors that are colorful plus black and white Yeah, for sure Let's see here some products Uh, oh, uh, let's see Learn guides are always below the technical details at the bottom of the project page The first one we looked at they were at the bottom of the description. Sometimes I think they're in the description too Videos in between are usually from lady at a jp or colin's lab The actual learn guide of it exists is at the bottom now that first one. I forgot what it was that first Product we look at though. There was a learn guide link at the bottom of the description And projects don't have products don't have the others true flow meters Yeah Yeah, I think the there's a couple of folks like katnie and liz I think are always hard at work on the new learn guides and stuff um okay So this device has a built-in sd card um So I would like to be able to access files on the sd card, right makes sense We don't want this anymore. Let's go back to device workspace this one here so So if the sd card were mounted, we would be able to do something like this and we would be able to see the files that are there Uh, because the sd card is not mounted though. We can't do that. There's code in here that would mount it for us So I could say like import Mount sd in my case because I have this file called mount sd and it has this code in it Uh Yeah, we'll let it do that. No Run that so this will initialize the sd card It will show us all the files on it. So now we can see the files that are there um if we like Get back to here. So I I did control d and then control c It's back to not Back to not initialized And that I think is because the circuit python virtual machine has restarted when I did a control c control d I think I restarted the virtual machine that means that All the stuff that had been initialized is now gone So we could initialize it again, right? I could import it again And then we'd be able to do it what I would like to do though is I would like to see if we can set it up to where The sd card will get initialized inside the core Automatically when the device first boots up and then from then on The user code can just use it without ever initializing it Um, that's pretty much how displays work in circuit python. Sorry. We've got fire trucks or something about to drive by um That's pretty much how the displays work in circuit python like when you mess with a display You know, it's you you find it a built-in display to be more specific Um, you'll find it on board. So you import board. You say board.display And then at some point you could say, you know board.display.show to give it a group or you could call refresh on it Like I'm doing here. You can do whatever you want with it Um, but if you have a built-in display, this is how you access it and you can start drawing stuff on it Quick question. How will I change cards? Change cards. Oh change sd cards Uh I'm not sure. I mean just you you can take it out and swap a new one in I'm not sure if I understand what you mean though change sd cards Oh, like if if it initializes in the in the core. I see what you're saying. I think Yeah, good question. I don't know. Um, the short answer is in my case. I'm not going to change sd cards. So Uh, in my answer or I mean in my case like ultimate use case for this The sd card will get put in and stay in a very good question though. Yeah, we will need to probably handle That so like it will it should attempt should attempt to initialize the sd card If it fails then You know it will go on without Uh Okay, I don't know that seems unrelated Uh, yeah potentially. Yeah. Pie portal has got sd cards built in as well So if we can get this to work, then it could go on that device as well Any device with a built-in sd card? Yeah, good question beata on youtube I had not even really considered it. Definitely a good question We definitely want to make it attempt and then fall back And then we'll also have to work out what happens when you popped sd card out After it has already been initialized, which I don't know the answer to What happens in that case? um But we'll want to make sure nothing bad happens. Yeah, good point um To start with I will plow forward assuming that the sd card both is connected when it boots up and Assuming that the sd card will just stay connected and not ever get changed out It depends on the on the use case Sometimes like for some of the stuff I use sd cards for i'm swapping them sometimes but for other things Yeah, it is more like a hard drive. I just Stuff it in there and the only time I ever change it is if it craps out on me But it depends like sometimes I change them out There's a couple things a couple things I use with sd cards where I'll swap them out Pull it out to get the files off of it. Yeah, that's one thing for sure like in circuit python There's no pass through so we can't look at the files on the sd card um without Taking it out Essentially, so that's one reason why you would be taking it out in circuit python land Um, but yeah, so I want to try I don't even I don't know for sure if it's gonna work Um I don't know what kind of drawbacks there will be as far as like what does happen when you unplug it So there's lots of stuff to figure out, but I want to try to initialize it in there to where When it boots up it will just have the sd card ready to go So I did ask about this and discord the other day and scott mentioned that he thought it would be possible It would go inside board a knit. I think i'm actually gonna pull up what scott said though just so I can make sure Actually, no said Oh, it's not letting me because of this thing that should be a Code and board a knit should be able to okay. So I got a pointer from scott Do here and so this is where it makes total sense because it is Initializing the e-paper display as well So pretty much what we would want to do is just initialize the sd card here as well The tricky bit though is that What's the code to do that? It's gonna look different. So in python The code looks like this So for one thing are these We can't use and so we need to find the gpio like this So for spy we already have the spy We should be able to just reuse the same spy as this That's the good news But the cs sdcs We can't Can't just use board dot So what we need to do is go look in pins and find it There it is. Okay. So that is ampersand pin gpio 22 So we need to create an sd card object by using this function inside sd card i o And we pass that to storage vs That Then we call storage mount So that calls common how display i o e-paper display construct and it Resume is importing from there. I think I can control click through Yeah, if you take it out while it's writing or uh There's like weird file locks or something in place Page aberration constructed files corrupted files So do we find this side of here Maybe though because of this I think that's how we got that board here imported from display i o and knit Inside of display i o and knit imported from display and e-paper display And also some other things optionally down here Which ultimately allowed it to call inside of here common how display i o e-paper display construct So if we go to What's sd card though it was this one But I think this is what we would be calling right because that is calling straight to common how Instruct It's what this is I'm just going to use default Working with sd cards pretty great have 128 gigs on a feather. We'll play music from the sd card. No problem. Nice Cloud writes while you're removing or reinserting okay I wonder if it has a I wonder if there's like a pin you could check or something. I wonder if there's a way you could know It's plugged in At least you could try lister like I did before but I wonder if there's a different way Yeah, I think we would not have self probably here, right? I'm very sure about this part I don't think we're going to want to call itself though sd card itself okay, I Think there's a very good chance that it doesn't work. So i'm going to add some print statements so that we can uh Try to see output from it before and after it happens to see how far we get Uh, except I don't remember That's right. Okay. It was right, but it's not shouty I'm going to do it between all of them Okay, one thing too. Do we want to catch this? Oh, that's where this That's where the self comes in here, okay I was gonna like I was like do we want like sd equals right, but no we don't it's actually it would just be this That's essentially the return in this case I'm understanding right which I may or may not be but there one thing would be like Do we want to put this on board somehow? I mean we need the rest of these as well too though That's part of it is like would we want to also add the board like there's board dot display Would we want board sd card or something? I don't know how to hook that up I'm gonna go on here. Okay, so we have this stuff. We need storage Dot vs fat also before I forget we're gonna need to import All right, how come this doesn't have inside h? The The function This isn't shared bindings Okay, there we go. This is what we want to import third module sd card i o d card dot h Hopefully that'll work. We're also gonna want the storage one This is where it gets tricky. See I think we're gonna have to trace back and forth We need to call storage vs fat Then we're gonna have to call mount afterwards as well Seems like it's creating a Subject And there's no vs fat There are any out of your board so I have an sd card. Pie portal does Pie portal well, it's pie portal titano. I'm not sure about the small one though Where does v Fs fat? No, I'm in storage. Where does that come from? I'm in shared bindings for storage There is no vfs fat So if it's I guess coming from in here Vfs How does the titano do it? How does it I could See it happening for third party board and they Need board sd How does the titano do it? I'm not sure what you mean. How does the titano do? I mean it doesn't do this what we're doing here today. It doesn't do it at all You just have to initialize it in your user code if you want to use the sd card basically Yeah I do not understand where this function comes from we have it looks like we should have storage Dot v f s fat But there's no mention of that in storage shared binding. So I don't understand how it gets pulled in There's this They're maybe related. I don't know. Okay, there's a Woodpecker that has taken an interest in either some part of our house or a tree outside. I'm not sure which Been back like Three or four days in a row now Yeah, I don't know maybe I don't you don't need the object is the thing like Even once you initialize it in code pie there you can't do anything to that object. So there's no like Like if there's a function or if there's a property or if there's like literally anything that you can do with the object then maybe But as far as I know like Literally the only thing you do with this object here is pass it into this function here And then literally the only thing you do with this object here is pass it into this function here And then literally you can just never touch any of these two objects again, and you don't have to use them for anything um If that's the same case then I don't see any reason to put it on board because you can't like They don't do anything Um More than that though I had don't know how to do it. So I definitely will start without it and Maybe we'll go down the road to trying to get it there, but We'll have to see asking super path on dev anybody woodpecker Yeah, I know but it's a little uh a little aggressive sometimes sd card in the core I'm not sure I understand. I guess basically you're saying what it um Yeah, I guess what you're saying more so like The core would keep a reference to it after you initialize it in user code Like it does with displays which it does do with displays like if you initialize your display in user code Then it stays alive Stays initialized is that what you mean? I mean the code there is basically the same code that I've got So it is the code that you run in user code But you're saying I think with your comments you're saying more so like What if it worked this way? Yeah, I'm not sure. I don't know how to find what this is doing xmod vs fat in the right place Which function seeing Make new this one And there's no idea what we would pass for these Is here we just give it sd, right? This says it's looking for type No, no, no object. No, that's type. Yeah, object type for type n r's as a size t n k w as a size t The object t r's I mean, I guess that's it, but I don't know what are those arguments to It's weird to me. There's nothing in here either about that like I still am I need my like basic c Turning honestly, I don't really quite understand h versus c is for Usually I'm used to seeing all the thing like all the functions that are defined in c to be listed in h But that doesn't appear to be the case here Oh, so I had my chat scrolled up. Let's see here Init display and release displays would be another approach In a knit on the spy bus in s e Yes, I'm not sure I'm trying to say is build the basic scaffolding into the core so that vfs survives vm relets I mean that would be cool, but honestly, I don't think I have the ability to do that Yeah That that would be really cool, but I don't I don't think I am probably the one who can do that. Honestly, I'm I'm feeling pretty stuck trying to even just do it this way with it hard-coded honestly Um doing the long-term living and handling inside the vm and all like I don't even know where to look Right, I would not even know how to start beginning to think about giving that a try Fortunately, that's just way Way over my head still at this point to be able to actually do the long live And do it correctly in the vm startups and shutdowns and all that project The method I know that works 100% is putting sd to sleep If you have a button to initiate Well, like you can call can you call unmount on uh You call unmount on one of these or no, I've never actually unmounted it after I mounted it How does this pull through from storage though? I still am very confused by Why in our python code here we write storage dot vfs fat Like the glue between that and vfs fat here. I am You not understand at all It's imported. So I guess that I mean the import has got to be then the thing that's pulling it through There's unmount. Okay Oh, you mount. Excuse me. It's not unmount. It's you mount You mount Get mount race file system Table usb drive Enable usb drive storage module globals table Mount you mount remount Get mount Oh, okay, here we go. Now we got to the We're scrolled down far enough. There we go. Okay. Okay. Okay. If s fat eat rom pointer Okay, this is definitely one of the missing links um That's how it's linked up. But if we we wanted to call it inside the core, how do we do that? I'll call this directly you storage you mount. Yeah, I don't even know about uh you mount Okay This we've we're so close. I feel so Did this come from does this appear anywhere else here? This is a string. It's definitely not this it's definitely coming from this thing which I guess we got From our import there Wait, no, give me that back Now I'm lost. I wish I could see the I wish it would dot dot dot something else Some in the wrong file Anything to open honestly Origin it h close Origin it c paired module close St card close p fat vfs s type external constant Okay V dev in This one takes the right number of arguments at least You Still there on the phone is so aggressive Compared to the pc is like insane It's a new object make the file system This is returning none Okay, so Do we need all of this or would we need just this? mkfs We're gonna pass The thing we make to storage dot mount So does that is that looking for this? I don't get to know because it's object t mp vfs mount t But that's creating it from an object Maybe we don't want this full thing Because that's basically mp vfs mount It's different. This is fs user mount pvfs mount t What is bdev also? I don't know what bdev is Gonna be There's somewhere else that calls this. I'll just make new there Okay, this is why that other thing is allowed allowed to map up with this back here This is mapping to This thing So it actually doesn't well. I mean it passes bdev, but as the last argument Args Scroll down to 508 The mattering is not what I need. It is this one bdev is block device, okay 74 Crazy copy just missing That's returning. So that does return a thing of course Object t Yeah, thank you for the heads up But I let's see You need to include this from somewhere I mean, yes All right, let's see if this builds Or does anything at all I want to use that auto detect function. So it mounts I don't know how to use it. That does sound pretty cool Inside vfs mount would this Would this replace the last call storage that mount does that make it so we don't need to do that? Yeah, I know I'm like totally showing my ignorance about all of this Including c programming and sd cards and file systems and everything else, but I'm basically waiting around in the dark here just kind of Heck in slashing. I don't Should really know what I'm doing Let's go It does build and we're Decent shape. I assume we're not like All the way there, butrupt for the few string q string found a couple hits fs The vfs type calling the type calls it makes a new so lot which is as you must have already found make new Yes, okay Oh, okay. That could be worse. That could be worse Messed up a bunch of these Yeah, yeah, okay, so we're mad because we don't have bdev yet and SD card type we don't have And that's unused also just fine. That one's fine. We don't care about that So we don't have bdev and we don't have SD card type What a thought that would come from here We're not serious Doesn't let me find files this way for real I'm lost again. I don't even know which place I pulled this code from But we need Here's We need this thing Does this come from oh, that's not what I want a copy My usages one of them is mine One of them is in SD card C. One of them is in Nit it's like an SD card C But the thing is we already imported from SD card h good bindings Maybe that's why you need to import from shared bindings SD card h also Maybe only actually I don't know Probably also, right? Let's see if that gets rid of the uh the first error Not having SD card type Yes, actually it did it went super insanely fast. I don't know why or how it went so fast That works so bdev the next thing we need bdev from That's not a good sign. Oh, okay. I'm in the wrong folder. I'm in the wrong folder. That's better um only Use outside of the stuff I'm doing the bottom one is what I'm doing the only use outside of that is in FSC I gotta run to the restroom. Maybe I can just a second Okay Oh dear I mean it has to be one of these things imported, right? but Let's try a grep without the ampersand. Maybe that will give us the It does there's that auto-detect again 39 So inside of here it gets passed in So we need to find something that calls this DFS object Go to three This is at mount Input object has no mount method assume It's a black device and try to auto-detect the file system and create the corresponding vsf entity So it just came from here though in pobjt From po I assume that's positional arguments Zero in which case it's the first one block device Uh Yeah, I don't know how to get that You Is it Is it self? Is it this? I mean, I guess maybe that makes sense, right? Because we pass it SD Is what I said I thought sd self essentially is I guess that makes sense It's a little weird that this function takes Four Arguments, but the python side here only takes the one A neat trick All right, let's see. Does that build? Oh Yeah, hold on. No, that was all kind of stuff that we got through Commodable pointer type Maybe it doesn't want ampersand Void const Void const Might be stuck Expected void const The only place it's called It's vfs.c 174 174 is here And it passes in bdev.obj. So the only place in the core where it calls this It's here Passes bdev.obj with an ampersand Which it got passed here The obj.t And then we go up one because this just gets passed in Has this stuff actually Is this auto detect? Is that part of the api? I don't recall ever seeing auto detect before I don't really get what it does Or if it didn't find anything This is called from two places Well, no, it's declared in one place and it's called in the one place It's declared at 139 And it is called in the same file from 203 And this is the one where it comes from the position arguments Position argument zero It's passed into auto detect Inside auto detect This It's this stuff done to it Maybe it's not entirely clear to me if that's doing something to it or not And then it gets passed to here These are different lf Wait a minute. Mine doesn't have that lf Where did I I'm so confused now. I'm lost again. Where did I steal this from? I wish dash in was the default 174 Which is inside auto detect Inside auto Right, right, right, right. Yeah. This is fs one or whatever one two Now we go down to there. So yeah, it comes in As beta of object here These two things happen I'm sure if those are important or not And then it gets passed here The three is inside amount Turn positional arguments 181 Is the declaration 503 that one's new arms 503 The level helper function for ports to use if needed Args, it says bdev and mount point, but that got passed into here Both of them, I don't know where to get our bdev I think I might I think we're probably stuck. I don't think I can get this Yeah, it's so it's impossible because like everything is always just passing it in but I We can't ever get a look at like what was it like what would it look like if it weren't passed in Well, we could keep trying to chase this I guess right We could try to find this one because it's going to get past the bdev and amount point Maybe we'll find the bdev there, but I don't know this feels like we're just Hopping from stone to stone and just chasing it further up the chain, right like we have still yet to find Where it came from so these point to the same file at 498, which is where we're already at actually Only other one is in h That yeah, the only place that's even referenced is back over in h and that's not going to be calling it. That's just going to be That's going to be declaring it or whatever like What it's called, but it's going to be like saying the signature pretty much Yeah MP object T Is there any reason to believe that we might catch a thing here? I don't know if you're allowed to do that Any chance this could work feels so unlikely, but But we have to lose Peter blows up All you ignored Void value not ignored as it ought to be Not supposed to be catching anything from that We need to like Can we like Is there a way to go backwards from a more specific object T Into a more generic like is my problem that I need an mp object T but what I have is a SD card object T but it Seemed like it was looking for Weed though, right? this one say says expected void const Star everywhere else that I have seen It seems like that thing should be an mp object T Looks like all of the places here where we crept through Like here mp object B dev So it was my problem that my My object is too specific Do I need to somehow back out to mp object T Any sense an extra in and we need to try to find Where does that actually call again? What is this from? I want to look inside of here E3 Try to see if it looks like it's trying to convert it from an mp object T into the more specific SD card object T Arguments look entirely different User mount T we saw that earlier. I do remember that in new object Strangely, I don't see where this comes from here Does have another one of these block dev and nits also I don't think we're gonna get there back to be once again because I don't know trying to find It looked like it was converting Okay, okay, so type is the first one then we have a number and a number and then we have the fourth argument One two three fourth argument I have too many things open and it keeps bouncing back to the end and it's actually kind of frustrating as far as things that the ID does go So type int int args arg zero It's past a block dev and it I think I mean I don't really know what I'm looking at. So what I think certainly could be wrong But if I think it's it's feeling to me like we won't Like we don't want this to be so specific Does it just break entirely if we call this mp object T instead? I guess yes MG I did it wrong No, incompatible pointer type SD card object T I do think this is weird how it's saying that it's expecting void const star I don't know what that means So that particular error does not make it seem like it's interested in an mp object T instead I mean, honestly, it makes it seem like it's looking for null or something Actually, that's probably just me not knowing how to read that What if we took these out for now Let's see if this part tiles Might get a build seems like we're gonna get a build Yeah, you get a build That's good news. That means at the very least we don't have like Extreme compilation errors in the first half of what I've done But I am pretty much at a roadblock. I think on the next bit. So I do not understand How or what to pass in feels like we're so close though, right? Like it feels like It's got to be something Pretty much like similar to what we've seen So many things like everywhere is always just inside one of these two or three files 96 Sure, I have already looked at several times There again, it's a wrong file not LFS. We don't just I mean it has to be an mp object T, right? Like it has that has to be what it is Did we try ampersand? I think I did right and I try ampersand sd self I think I did And an sd card self that feels like what it should be from the python side, right because we On the python side we create sd card and then that's what we pass here And then the analogy in c as far as I can understand it sd card self I believe is sd is this I think that's the same object So it would make total sense if that was what we passed to here It just does not like it Or I tried an ampersand I mean, this is like insanely dumb, right? You can't you can you cast is they're casting? Right, there's no way, right? I mean it can't be that easy, right? Could it be that easy? um Can I use it somehow? How can I use it? Um But I I don't want to call mount yet because that's like a whole another can of worms Can I access anything off of this? Is there like can I print it out or anything? Can I do anything with it? Um Because we just want or is there a way I can suppress this compiler error Unused because right now it's just like the only error is that this is unused I don't know how is there like anything generic I can print from it I think this will not succeed, but It will not succeed even if I do remember to put a semicolon on it I'm not allowed to add those things together objecty um How can I find out what this has on it? They're like an id or a name or a class or like a two string method or anything that I can call You get a string or a number just so I will have something to print So that it won't be unused This is going to be every line of code in the entire thing though, right? This is everywhere You print from that can I print ampersand that like the is that a pointer number? Is that an int for the memory address? What if I don't have new line? I really love high level languages like python where like In python if I wanted to figure this out, I could just be like print dur Bfs and it would tell me all the things on it and then I could find one that Looks promising and use it, but I have no idea how to find like On this. I don't know how to figure out what it has By itself interesting. Okay. Okay. Well, there you go. So apparently we can print that by itself Not sure why I don't know if we would want this or not. It builds both ways Builds both ways. So I don't know if we would want that right follow. Sorry That's x Not sure I felt sorry This treats it as as used so this actually gets us past that one bit there I don't I didn't think it would because it's not a string, but I guess it figured it out for us Um, I think I'm going to call it a night here though. So thank you to everybody for watching Thank you to all the folks who helped me out in the chat I would not have even made it this far without help from especially the shippu Neurodoch and anacdata appreciate all of you Quick sd card file directory. Don't know if it'll help for folks that are interested in this sort of content. I will be back Tomorrow morning working on some more circuit python stuff. Okay. This is user code level Yeah sd card and stuff in here By doing the unmount you're just talking about over there. Okay. Um, so yeah tomorrow morning I will be back at 10 a.m. Central time And I'll be working on some more circuit python stuff. I don't know exactly for sure what I'll be doing just yet, but um Probably a decent chance. I'm gonna at least make a stab at trying to get the last of this because now we have If this code is right It's definitely a question mark, right? We don't know for sure it is but it compiles So we're moving in the right direction If that code is right then we actually have Uh, one more function call we need to figure out how to convert into the core And then after that we would actually be able to start testing the sd card So probably I'll take a take a an attempt at that Um, we did not get into web sockets which I put into The name of the stream. So perhaps I'll dig into that afterwards if we managed to get the sd card stuff working Um, any which way though that will be tomorrow Over on my own twitch and youtube I'll drop links to that in the live broadcast chat Which is the same discord we have pulled up here In the morning when I'm about to get started so you can head there if you want the links Otherwise, I will say have a good evening. Thanks to everyone who's watching I hope you all have a good rest of your night and a good weekend and all that stuff I will catch you all next time. Thanks