 to the last deep dive for me for the year. We'll get going in a few minutes. Sorry I have a cold and I have been sneezing a little bit so hopefully it won't be too bad. But I'm excited to be here. Excited to be diving deep again today. Hi Shannon. Thanks for stopping by. We'll get going in just a couple more minutes. I have had so much trouble but I like getting going early and I'm planning on probably stopping early as well. So if anybody has questions before we do the intro feel free. Hi Beata. Welcome welcome. Sounds good hopefully. One more minute and we'll get going here. I know it's going to be probably pretty quiet over the holidays too. Jeff's here. Knock knock. Who's there? Welcome welcome. Glad everything got started. I'm glad you can't see how messy my floor is. I've got a sort USB cables and like been in the middle of it for like a month. I just I had like one cable for the salier that I was looking for after the move and I was like I'm going to sort these and I'm like started sorting them. I just haven't finished sorting them yet. And they've just been sitting there. I have a whole box full of boxes like I was talking about last time that I've got to put together as well. My plan is to do the like pizza box style sorting for for these USB cables. So it's easier to be like I want a USB A to USB A or that sort of thing. You know the world you live in when you have lots of USB devices and and all that. All right. It's two o'clock and we'll get going. So hello everyone. My name is Scott. I work for Adafruit on Circuit Python. If you don't know what those things are Adafruit is an open source software and hardware company based out in New York City. I work remotely for them. So I'm located in Seattle in my office space that I moved to in September. I used to be working from home before then. Circuit Python is a version of Python designed for tiny computers that are also usually inexpensive called microcontrollers. I usually look and see what's on my desk. I think this is what I showed last week for this as well. So underneath this little can lid thing there's a little chip there that has kind of all the crucial bits to make up a computer all in one. They tend to run a few dollars to maybe while I'm sure there's really expensive ones as well. But you can get them for a few tens of cents I guess as well microcontrollers. But so Circuit Python is designed to be a really easy way to jump into programming these microcontroller devices that are really good with interacting with the outside world. And it's really easy to do that usually via USB which is really nice. So that can be part of it. And I'm noticing here I adjusted the side the side here and it's showing how many new messages are there which I think it's syncing with my other one too. So that might flicker on and off but that's okay. It's better than the empty space where the camera that never works used to be. Hello Tyeth hello to Shepu as well. Last thing I should say that I am paid by Adafruit. This is their channel so they're you know they're they're paying me. They pay me to work on Circuit Python and if you like what we're doing here what we're doing with Circuit Python and open hardware in general you can go to Adafruit.com and purchase stuff there and that really helps us out helps pay them them pay me. Hi DJ Devon 3. Yeah so the way deep dyes work is they're typically two hours or so. I think this one today will be an hour and a half. I have my my parents are staying at the house and so we're gonna be I just squirreled away to do this. So I'm gonna be I want to get home a little bit earlier than I normally do. So I'm gonna we'll do an hour and a half as long as my voice you know talks. It doesn't sound spectacular right now but it's still you can hopefully understand me. And as always I like to take tangents. I like to explore different things. People ask questions so if you have questions about electronics, software, Circuit Python or whatever feel free to ask them and we'll go off in those directions. What I've been working on and what I planned on talking about today is I was working on adding SD card support to the the why the web workflow. So maybe the back story is important. So workflow is a term that I've used to describe how you access and edit files on Circuit Python. That's one piece of it and the other piece that makes up the workflow is seeing the serial output. So seeing what the error messages are what your code is printing. I think of workflow is kind of the combination of those two things. So Circuit Python versions like three through seven really focused in on what we call the USB workflow which is the one that people know and really assume that is there which is the the native USB workflow. So you plug it in it shows up as a circuit by drive you edit the files on there and then the serial is just a CDC kind of serial connection to as well. So that's kind of like the that's the core workflow the main workflow that people think of it for Circuit Python. But there's also web workflow and BLE workflow BLE came first and then web after that. And then we've kind of loosened constraints around that. DJ Devon 3 and Tyath are in Discord as well along with Dave on YouTube. Well welcome you both. So yeah we did USB and then we started seeing that you know there were going to be some well the reason we I wanted to do a BLE workflow and it really hasn't paid off yet but it's a long term thing because it's a bit weirder. The reason to do a BLE workflow is that it's easy to do from a phone or a tablet. So BLE is pretty well supported from a phone or device and I you know I I've pitched the idea that programming from your phone is the future and from a touchscreen because simply that's the device that people have. So we could do that and we've had to build out a lot of like apps on the on the device side as well to make that happen and maybe that's what I should do show some days the apps that we have both on Android and on iOS now. Maybe I'll let me talk about that a little bit. So Shannon says I'm just starting out so Circuit Python is super new to me. My turnkey shows up today. Yay welcome and Feather. Great. Hopefully they're RP2040s. BLE yeah. So BLE is short for Bluetooth Low Energy. It's kind of like more modern Bluetooth and DJ Devon 3 says isn't File Glider used for that? Correct. So there's kind of two or three apps that kind of work together. File Glider is an app that talks to a Bluetooth device or BLE device and can transfer files and delete files and move files and do all that stuff. It is like not necessarily Circuit Python specific so you could have another device like maybe something running Arduino that presents the same API and File Glider would work with it too and we I published kind of the protocol that I came up with for that and then we have the cool other cool thing about File Glider is that not only can you use the app to look at the files but it uses like the OS's native file API to present those files to other apps as well. So I can use like a code editor the one I test with and use is called Runestone R-U-N-E-S-T-O-N-E on iOS and so I can load a code up high in the Runestone via File Glider, edit it and then it saves implicitly which is kind of annoying but that saves it back to the device over Bluetooth and in fact I've shown this before ages ago but this watch is a Bengal JS2 and it's running Circuit Python and it's my daily driver. It's not perfect but it's good enough that I can use it every day and I know that if I wanted to I could make it last longer on a battery but it lasts a full day so I just charge it at night and that's fine. So BLE workflow was really important for being able to connect apps and the apps are pretty mature now. We have File Glider as the main way to get files back and forth and then we also have the PyLeap app which is a kind of higher level find some projects on the learn system and just download them to your device no coding just just like leap into Python kind of is the idea and that works wirelessly as well and then kind of the third piece is that the Bluefruit Connect app existed for a long time but we modified that to have support for the serial terminal as presented over BLE by Circuit Python by default as well so you do kind of need this like combination of apps to make it work but it works pretty well. So that was BLE and that was the reason that we did BLE and then from there I had hesitated on Wi-Fi workflow because or as I call it web workflow because it's never fun to get connected to your Wi-Fi access point but Brent who works on Whippersnapper had done a lot of really cool stuff with that. Jeff says I was going to ask why not Wi-Fi over BLE power? Yeah so getting there so the reason not to do Wi-Fi is that the like how do I do that initial like provisioning to get the device on the Wi-Fi is complicated and there's like different ways that it works but they're never that great and then the Brent who doing the Whippersnapper stuff which is like straight up no code IoT did a really cool like install from the web sort of thing where you put your credentials in and it includes the credentials when you install the firmware and so it's kind of this like you have it connected once we get y'all going and then that's fine after that which made me rethink Wi-Fi workflow and then we have more of these ESP chips so it was definitely time to to do it and I there was some other oh um Jeff who works with us a Jeff Epler not Jeff in the chat was doing um no it's it's not Wi-Fi over BLE it's it's Jeff I think is talking about choosing choosing BLE versus Wi-Fi like one over the other is a choice is at least how I read it um so Jeff Epler had had mentioned this thing where you can use a technology called mdns multicast dms I think is what it's called so on local networks you can discover domain names so we could do something like circuit python local and you'd actually be able to find your device so the other piece of a Wi-Fi thing that's complicated is like once it's connected to the to the outside world how do you find it via like an IP address and mdns is a really cool technology it's pioneered by apple it was called bonjour from them but it's really commonly used for like how does my iphone discover my apple tv it uses mdns when it's on the same network um so mdns is really cool and you can set up your computer to do domain name resolution over mdns so circuit python local works so if I just actually I can I can start to show you here so here's my switch to desktop so here's a firefox and we're gonna do circuit python local we'll see if this works so what it does what it did is um it does this kind of broadcast to the network say hey who's out here is anybody called circuit python um right and dj devon 3 is pointing out that you can have it disabled um yeah so it's not gonna it's not always gonna work perfectly um but it it is a good story for I think default things avahi I think is the name of like the the linux daemon that does it there's different things yeah um so it does this like broadcast to say like hey who's out there and what I realized is that we could have um we could have circuit python devices were they all respond to circuit python dot local which is how I found one but then what it did is it um the http server that we run on circuit python will redirect circuit python dot local to c pi dash the mac address so it's a unique domain name for each device and then this page is not working super well so whenever so this is part of what I'm working on it's getting this working better but it's always handy to have the the the web tools out and like this welcome j s fetch is not working so I have just one device right now that I'm hitting um and what I realized is that we can rely on the circuit python dot local stuff on your on your computer to get you to one and then you can actually ask that one to find all the all of the others so uh that is that was kind of the thing that unblocked my mean mentally that uh that we could start going this direction um meaning we could have a wi-fi or a web workflow so there's a that's kind of the pitch and maybe what I should do is let me get a second device the second device that I've been working on out because I I've been improving it the one that the device that's serving this it should be so let me let me show you even more info so in the circuit python docs docs.circuitpython.org there's a workflows page now that will tell you kind of like the standards that we how it works how the workflow works so usb billy and web will cover it all and web is actually kind of the most thorough one um tells you how to get going tells you about the HTTP and then it gives you a bunch of examples uh about uh querying the device so this is all the file stuff but then further down there's also um slash cp and there's devices.json so that that runs the discovery for other devices cp slash serial is the serial connection version.json will tell you more about it so this page is trying to like if welcome hadn't loaded it would try to do that so we could do it directly I think I guess it's version if we just do version.json we can see that it's this inky frame I don't know how long the cable is so I have on my desk this weather display that I did a while back and I was actually I need to look at it this is what happens when it doesn't have a graphic for it I think it's probably wind I know I need to make a wind graphic that I haven't yet but I've been really happy with this it's got this pink tint it's these like seven color ones but it's still pretty neat and that's actually uh that's a pico w that it's running on so the web workflow works on the esp expressive chips all of the ones with wi-fi and then it also works on the pico w oh yeah and I guess what I should say is that DJ Devon 3 says you know the mdns the multicast stuff can be disabled so all of the auto discovery stuff would not work but you if you knew the ip address by like connecting to uh if you knew the ip address by connecting to the device over usb or setting it explicitly yourself you can still do this it just won't automatically you won't automatically find it the shippu saying is this because there's a limit on the number of sockets open simultaneously the reason the page didn't load I haven't looked into it actually I don't know exactly why that happened um it could be it could be I've been meaning to debug it but then again the inky frame is actually running like an old version of circuit python it's running 824 so it's it's actually kind of a little old and I've been fixing stuff in it so it's kind of like one of the situations where I like I could debug the old version but I at some point I'll I'll update that to just the newer stuff that I've been fixing finding and fixing stuff on the expressive side or displaying a QR code I mean yeah like not every device has a display so I didn't want to rely on that and I've made I've learned my lesson about blinking important important data out of a out of an led that's always not good too Shannon says yes rp2040 and a feather wing OLED 128 by 64 cool have fun with that and oh another thing so we have two chats above me here one is the youtube chat and then the the gray one is the discord so Shannon if you have problems the discord server is the place to ask them you can join it by going to the url adafru.it slash discord and there's a help with circuit python channel and there's lots of friendly people a lot of whom you see above me see there inky is running inky is running the pico w so it is a coprocessor but it's not an ESP coprocessor I'll just copy this link to the youtube chat as well thank you okay so that so this is web workflow the pieces of it are here and the way that it works is if we just do I know my password so yeah I don't know welcome it's just been like failing on this at 824 I'm not sure exactly why but we can go to the file browser and I think so you just leave username empty and then I type my password in and my password is hello and I see a lot of people using the default I would suggest not using the default but also don't use something definitely don't use a password you use somewhere else because the password is sent unencrypted on your local network so it's not that secure the way that I was thinking about is like if you're in a classroom full of kids like you just want to prevent kids from like hampering each other like it's a very low bar to like figure out the password it's not it's not not secure by any means and it is sent clear so don't don't reuse something um anyway so we could see here like here is my code that's running on my ink display we loaded it from the device um and then what we can also do maybe I'll crash it but that's okay we can go to the serial terminal and let's see we can actually do control C maybe it might be sleeping I'm not sure like I said I think I fixed USB is also active so I just control C didn't USB and it worked and in fact I think that is you know that is a bug I fixed I fixed a bug where it wasn't um where it wasn't doing control C I already fixed that in nine I just haven't fixed it here so this is am I printing out did I print out my access key it doesn't look like it good so I'm using I'm calling the like pirate weather API to get this stuff and now it's it's refreshing oh look at this oh snow I was thinking it was wind but no so yeah I'm using the pirate weather API and it's giving me like the icons I should use on an hourly basis and I print it out if I don't know I don't have an icon so I I need to do windy and I need to do snow Dave says are you eventually going to exclude YouTube chat probably not I like the YouTube and we always get engagement I think YouTube serve its serves its place as a like onboarding folks I think that the discord is the better place for folks that want to stick around because it sticks around um but no I think we'll we'll stay with we'll leave the YouTube stuff going haha yeah json stream yeah you probably spotted that that's I I did it for this I think so yeah so that's the serial part so workflows are files and they're serial kind of like the core bits of it uh and so we now have usb we have usb we have uh beli and we have web or wi-fi workflow um couple other things I should say so those apps I talked about earlier for beli they've actually been enabled for wi-fi as well um so they should also be able to do the mdns discovery and be able to upload and do all the file stuff and all of the serial stuff actually I haven't tried the serial stuff that might not work but the file stuff should work over wi-fi as well which is really neat and in fact let me just show you if I pull up um file glider we'll see so right now it's showing this is my watch and I was hoping it was going to find the other one as well let me plug in this um s3 metro to get another device on the network I was surprised I've seen it before there there's the metro so so now in file glider we can see that the metro esp32 s3 also showed up so if I select that like amazing and then I'll hit the files button could not be completed oh you know what I changed it I'm breaking it oops I changed the way it worked so uh that's the background for what we're talking about um oh yeah the other things I should mention is so there's two there's two code editors here so in file browser um it will detect whether you're able to if circuit python itself was able to edit the files or whether usb is so unfortunately the usb uh circuit pie drive stuff operates underneath the file system level um which means that circuit python itself can't modify the file system while usb has the ability to um it's terrible but it also means it works for anything which is great um so uh here I turned off the circuit pie drive on this on this device so I have serial access but I don't have um I don't have the circuit pie drive showing unless I do a safe mode which is fine um and what I can do is then I can uh I I click the file to see what it was but I can also hit this edit button and this loads this really basic editor um that just hasn't been like all in this one window um and this this this editor will work even if you don't have internet access but what you can also do is you can do and this will work this should work you can also do slash code and now what we what we've loaded is um code dot circuit python dot org um so here you can see the device that we're connected to and you can also see the other devices on the network um we're not going to switch because that other one's not going to work um but here what now what you can do if you want is um list your files let's we can open it here and now we get a like a full nice syntax highlighted thing um I can just then hit save and run and it will it should interrupt it and now it's now you see the serial output here next to it so this is the like enabled version um with the wi-fi devices because of browser security you have to do this cpi dot local slash code thing um if you're not doing wi-fi what you could do is and you can do code dot circuit python dot org and you can pick from the three workflows so it actually will work over usb now and it will also work over wi-fi or over bluetooth if you do it over wi-fi you've got to do this like slash code thing um but with bluetooth and usb it just asks for permissions um so this is warning me because i'm in firefox um that you have to use uh you have to use chrome or chromium um bear says i've been enjoying the new web slash wi-fi workflow i can edit multiple devices at the same time to test uh does it have tab completion or those other types of features planned for someday uh yeah we don't have we don't have circuit python specific tab completion in the editor one of the reasons to add usb support to this is that it makes it way easier to test so if you'd like to add it that would be super cool um it is using like a standard editor called code mirror under the hood so it's probably like got some sort of um plugin that we could add that would do the completions for you um which is you know where we'd love to go in the long term but it's just it's it's hard balancing what we spend our time working on um so yeah so that i wanted to give code that circuit python to org props as well and and melissa who maker melissa is the one that does a lot of this work so kudos to her for for all of the the browser based editing stuff that we've got um it looks really good and justin has done some designs for us as well but yeah if you want to work on it um the source for it is in is it circuit python web editor yeah i think that's where it comes from um yeah code dot circuit python dot org depend on updates from melissa so if you want to work on it um circuit pythons so github.com slash circuit python slash web editor so it's not under it's not under the aid of root domain but it is open source so uh if you want to try it that would be super cool i'd love to love to unify us to that um bare says are you thinking about enabling remote dev and vs code using wi-fi or usb i'm not i'm not a i'm not a huge fan of vs code i know pretty much everybody uses it but i'm a sublime text user um so i have i've not thought about that it's uh i'm hoping i hope that i've documented everything well enough that somebody else could do it um by having all of these different uh workflow documentation things um and it is a bit interesting because when i've talked so i've talked with damien about this idea of of workflows and i've i kind of wanted to go the like native api sort of style where we know we do rest like stuff for files we do ble services for ble um and we do web sockets for serial over wi-fi versus um damien kind of had the idea of like let's just do a serial like we'll just do a serial protocol and then we'll have clients and stuff work on um on either side of that uh which is another interesting take in i don't know how well that's worked but um i kind of alluded or ignored the fact that you can do like all of this file editing and serial stuff all over a single uh series single serial link that's what fawni will do um i've never really been happy about sharing serial output with like file transfers and stuff though i don't think that's a great idea but i get it if you if your minimum requirement is to have uart and you want to have the same same sort of experience and maybe maybe that makes sense but i'd encourage and support anybody who wants to do more tooling integration uh i don't plan on doing this because of myself though instead what's worth my while is making making it work better um so when more lady aida had done this uh project where it was a pcb in a kid's toy and the idea or the hope was that it could be all enclosed and you wouldn't have usb access and that kind of got her into using the web workflow but it wasn't kind of like super stable enough for her to feel like she could actually rely on it um so uh she was talking with melissa about it and filed a bunch of issues so what i've been working off of is in circuit python um issues and then we have a specific label for web workflow and we have one for billy workflow two here um so there's 13 open issues um running cut up high and hanging after upload i i know a fix or i've done the fix in this branch i'm working on but it's not emerging yet um so showing disk space use i'm also doing yay shannon welcome on discord let's see so mounted file systems don't appear over the web workflow so this is what i've been working on kind of this one the disk space being used and then also um the uh not this one but the the hanging these other ones i was not not doing not doing yet so i did the i think that it shouldn't work now so circuit python got local we find the inky frame so it actually loaded better it look it's interesting the fave icon failed the load but now like the javascript for this page worked which is cool reanimation xp says hey just joined i don't know a ton of python but i'm versed in arduino in general i know you've probably answered a hundred times but you can you sell me on switching the circuit python uh and give me the quick el i i don't know what that means but uh the difference as it pertains make yourself yes so the pitch for python and micro python broadly in python python even more broadly is that you're trading execution speed so it's not going to run as fast for development speed so you're going to be able to develop and iterate and run and have a much better developer experience at the cost of not being able to uh have as fast execution speed as you would in a compile language like arduino um so the pitch is that you can uh edit and iterate a lot faster oh explain like i'm a five year old okay so um i'm starting to show my age uh so the the the purpose to try circuit python python in general is you can get really far really quickly you can figure out what you actually need to do you should always start there and then python micro python and circuit python all benefit from the ability of what i think of as escape hatching into sea land so um all three of those are implemented in c under the hood so if you have a function that you need to do quickly um you can bake it into the runtime and do it quickly from python you can call code from python to do the thing that you need to do quickly and um sister's calling and i can't um so so that's i think the way that you get the best of both worlds you get really fast uh iteration and development to start and then um you can always escape into sea land if you need the performance of sea once you know what you need to be performant um and if uh like the work that we do a lot is the sea level stuff um is the is the stuff the c code under the hood so that you we provide a lot of generic functions that you would need to do quickly like transmitting neopixel data and capturing pwm input edges and stuff like that um playing audio doing usb all of that is c under the hood of python so you can put the pieces together really quickly with python and then we give you the tools that you you probably need um so i i bundled python micro python and circuit python into that um python is for desktops it is well c python is an implementation of the python language it's the de facto one but it's not just it's not designed for the limited ram that a micro controller is that a micro controller has so micro python came along and um i'm still going micro python came along and re implemented or made another virtual machine that works this works with the same code the same python code um but works on the micro controller level and then uh in 2016 when i got hired by adafruit to work to bring micro python to the adafruit boards um there was a couple things that we wanted to do differently than micro python that kind of led us down this path of circuit python so one of those is having a standard hardware api across all of the boards and so we have ports which are like chip families and then we have boards which are like individual like pc bees with chips on them and we wanted to make sure that our hardware apis were the same across all of the ports which is where that work usually happens so expressive should work like at mill samd and it should work like nrf and there's a technical way that we do that because we have like the layer that that bridges pipe on the c is all shared so when you're implementing a new port you implement c functions that then use the same thing on top um that was a big one and then the other big one has been this workflow stuff so not only did we factor out that like python to c layer but we also fact out factored out like main dot c so this is still true for micro python they have separate main dot c files for every port so it doesn't necessarily work the same way so we've also worked to we factored out usb so our usb stack is tiny usb and it's used across all of the ports that use usb and then um on top of that we kind of build these workflows that work across all of the ports as well so uh we benefit a lot for micro python for the vm side of things so the fact that it feels like python or runs like python is all something that we inherit from the micro python project so they've done amazing work with that and they continue to do amazing work with it we continue to every few years or every year um we import um kind of the latest micro python changes into circuit python and so circuit python 9 is like currently current with the latest released micro python code um so we still benefit from that project a lot but we've chosen to do like hardware api and um workflows kind of like our own way for circuit python okay i'll continue asking questions so do you have do you have to use totally new libraries for circuit python or micro python or are you able to import and use existing c libraries so to use existing c libraries you will need to build and modify the source of circuit python it's not too hard um we're happy to help you discord to the place to go um you will need to write that layer between python and c so figure out what python api you want and how to translate python objects into c objects we have lots of example code that does that um but we do have a few cases where we'll use libraries uh that are c libraries so the biggest examples are the like vendor provided stks so we use like the esp idf is all c code that we're using under the hood um another one that is like there's a draft pr uh jeff is working on jpeg decoding and there's a t jpeg dot d source uh thing that will do jpeg decoding um and that's kind of imported and wrapped into python in fact i can just show you it's a it's actually a pretty good example of doing exactly that so there's this jpeg dip coder it's 44 files but um this live t j jpeg dot d is all of the files kind of like copied in the person who does it doesn't have like git sub module couldn't sub module it in so it's just copied in they release it as a zip um and then uh these are specific board configs where like it won't fit in the build so jeff is turning it off um you add this like build rule thing so if you want to enable it you have this variable that then includes the source um that's a piece of it and then you have you list the source file you add like add them to your build rules shared bindings is a layer that does the translation from python to c so you can see this slash slash bar is our our hack to be able to include python it's called python stubs so it's a format that the python world has where it's like we give you the interface but we don't actually implement it um so you can have classes with documentation but then the dot dot dot here is like this is where we would have implemented it um and then you can see like the decode function here as well and we've started typing stuff so we python the language has typing that is optional but we try to do that as well so we have a build thing that strips all this out and packages it as circuit python stubs so that's something like vs code could ingest it and do completion based on this data um and then this is the layer that's so it's this is the c behind the curtain so you're doing argument parsing you're getting a buffer you're validating some arguments and then you're calling this is a convention that we have in circuit python which is common how so common how was the term that we came up with for like this is the name of the c function that gets called by this translation layer the the binding layer um and then it in this case it's just another c library it's not port specific so the the implementation of the common how stuff goes in shared modules here so now you can see that there's like some helper stuff but then the common how decode is right here as well um there should be construct as well i don't know where it went yeah and then just the knit thing is a like python has a knit py files and so there's a knit c for things that don't go in their own class well and then jeff has hooked it up to the unix port so you could actually run micro python on linux or whatever and it's great for testing stuff that's not heavily hardware dependent and so this is an example of being able to do that so jeff can actually like test it without a separate device but that's a good example of like how what's needed to to interface to an existing c library okay next question for me animation this is great i love the answer in questions um thanks for that that explanation really helps why do you call the different platform ports if i'm understanding correctly oh good question i don't i think it's a term we inherited from micro python and i did position or i did um pitch the idea of splitting it out into separate port folders i i think of it as kind of like porting um but yeah why are they called ports good question uh i'm not entirely sure um that's a great question ports was a way to combine all of the different chip families so you can see atmos amd broadcom so we actually you can run on raspberry pi devices um cxd 56 is on this presence expressive linux blah blah blah the act of porting yeah i guess that's the way i think about it uh reanimation actually looks busy porting libraries might be a bit much for me unless there's quite a good guide somewhere probably is i assume but i really appreciate you going through it thank you yeah so whether it is a guide but it's a little update or maybe a lot out of date um there is an up-to-date guide for building so if you go on the learn system and you click building circuit python that'll get you building that is up to date the one that's not up to date is dav wrote extending circuit python and this is out this is out of date and it has the warning for it um because mainly because i think the uh the build stuff was changed since this was written um i would really just suggest looking at the jpeg guide that really kind of covers a lot of it um if you have questions the discord server with the circuit pi there's a circuit python dash dev channel where me and the other folks paid by ate a fruit and the folks who aren't um they also we hang out there we have we're happy to walk you through it randall says any supported m7 board with more ram so the 1011 the imx 1011 is uh pretty short on ram it's 128k and half of that gets used for a tightly coupled memory but the whole imxrt 10 series should work um so the teensy teensy fours work just fine as well um and they have like a mega ram but for the m7s you're going to be in the rt series intern for circuit python support um i've tried to get the 11 series um this six the 70 is the one i have and it i haven't quite gotten it working but i've tested i've tested circuit python on the 1010 the 1015 the 1020 the 1040 the 1050 and the 1060 families the actual chip numbers are not quite exactly that but um circuit python should run on all of those just fine so the the 1060 which is what's on the teensy four has a mega of s ram it's great you should use it um yeah extending but also just hop on discord so the other thing and i realize i'm behind um i'm behind so jeff gdjsky01 asks so that is blinkett so this is a good segue we should cover this too and let me read what dj devon3 helpfully replied with um blinkett is the compatibility for small board linux machines like raspberry pi 3 4 5 um it doesn't run on micro controllers so yes so so eight so blinkett is both the name of the mascot and the name of uh python implementation of the circuit python layer the circuit python hardware apis so i talked about wanting to have a standard api that we factored out that stays the same across ports well we've also re-implemented that in pure python that is assuming it's on top of linux and it's generally like best supported on raspberry pi single board computers but it got a lot of other boards that i think it's like 100 boards that it supports now so and you can see here like what circuit python apis it provides so it makes your code portable not only across micro controller families but also up to single board computers which a lot of people use it for um but it is not circuit python in the sense that it's not the c code base that is the core vm of circuit python because for blinkett what you're doing is you're using standard c python so desktop python um along with like pip so it brings all of the libraries we built for circuit python to single board computers as well ham's lab says why aren't you supporting lvgl for graphics with circuit python um i wasn't certain that it would work on the smallest boards that we wanted to support at the time that display io was created so display io is like the system that i largely created for circuit python um and it's really designed to be uh really work in memory constrained environments um whereas i'm not sure lvgl is and then when i looked at the previous micro python bindings um they weren't pythonic like they were literally like taking c function calls and making them available um in python but there was no like kind of larger organization around objects and stuff like that so um if you want to you're welcome to support it but uh it's not a priority for us um display io i know it's not always what people expect but i think it's really proven that it's quite versatile um it's both versatile in the sense that like it works from a samd 21 with very limited memory up into the higher ones even if not super efficiently and then we've also shown that it like it can apply to yinx and oleds and lcd screens and now we're adding support for like dot clock dot clock displays where like we do have to manage a frame buffer um okay let me keep going because i'm behind still so why is circuit python but blinka as opposed to straight python size the io headers yeah so so normal desktop python cannot run on micro controllers why don't we encourage people to use that otherwise i think we do benefit like the blinka side benefits from integration with other like standard c python stuff yeah anecdata says that too you can intermix circuit python libraries and c python libraries with blinka yep bear says it's an old term ports is an old term for when you're trying to get code ported from one environment to another why run circuit python on pi oh so running circuit python natively on the raspberry pi um without linux i when i was curious about cortex a level stuff but also the holy the the main feature that i wanted that i couldn't find on a micro controller was hdmi output so um in in the broadcom port of circuit python you you get the circuit python terminal over hdmi by default which is really really cool i was hoping for and then i do really like the simplicity of it where you don't have the complexity of linux you just have a much smaller but still getting complicated code base of circuit python uh but really hdmi was the like i really really have this fantasy of doing a standalone circuit python computer and um to be interoperable with modern displays you have to do hdmi um so i i would love to be able to do like like i have a pi 400 which is like the keyboard with the pi in it i would love to run just circuit python on that but unfortunately the way that the keyboard is connected is over usb but it's usb via a pcie link to a host chip so we've got a little more work to do before we have usb host um running on the broadcom port now that makes me think that i left out a workflow and i haven't talked about it in the doxy but um with circuit python 9 i think it's a nine i don't think it's an eight we have usb host support now and usb host support if you plug in a keyboard it will automatically uh use that as serial input to circuit python so you'll be able to like control c and run the repl and do all that if you have a keyboard plugged into a circuit python device now you don't have the output side so you'll probably want a screen to go with it but it is like one more step towards that like standalone circuit python computer kind of world um running circuit python on the pi with blinka gives you access to a huge base of device drivers and helper libraries for sensors etc i guess i thought blinka was the how no so blinka is like the term we use for the python implementation of the how if you master circuit by then you'll have little problems switching to micro python and little vgl down the line and it's been they've been looking for a new maintainer for micro python plus lvgl so i'm i'm keeping an eye on it um but yeah i'm not not actively working on it or i probably won't work on it newer imx's are are well the the 1011 is really memory constrained but pretty much all the other ones aren't yeah and let me know ham's lab if you want to take it on um although we should coordinate with the micro python folks too reanimation xp says oh that's interesting did you do anything cool at the hgmi i got it working um i didn't i wouldn't say i did a lot cool with it because i ran into this other usb kind of hurdle um it just works i like i learned a lot about how the broadcast chips work which is really neat like the gpu is a custom core and it boots up and it starts the arm cores and so like it's pretty easy to just get running circuit by then running on an arm core because the gpu's done a lot of like the boot initialization stuff for you and then there's a way you can talk to the firmware on the firmware on the gpu like and so what circuit by then does it just says like give me a buffer like a frame buffer for the display and and then display io can render to a frame buffer and and you're often displaying um i didn't get audio working i don't think which would be cool um but yeah it was it's kind of like one of the things that it's like yeah that was fun but it's not necessarily core to like the work i do for aterfruit because we don't make a ton of money on raspberry pies because they're not our boards um and so we're still looking at this these ways of doing like you know self-contained circuit by then computers but it may not be hgmi or or i have my eye on the chip that can do like dot clock to hgmi um which would be another way to get that too oh and then of course like the the rp2040s have a hack to do dvi over hgmi so that's another good option it doesn't do audio over hgmi which is unfortunate but um thank you jeff he says your explanations are very clear this is why i love taking questions because i don't necessarily know what to talk about but i'm happy to talk about what what people are are interested in okay and i think i did see anecdote i get pretty excited or hopefully excited so let me pull up i had it open didn't i so this is this is the no this is the other one didn't i have oh yeah i hear no that's the inky frame didn't i have the metro so this is the metro that i have sitting here and this is the one i've been working on the latest and greatest versions of the web workflow good night dav oh yes have a nice christmas all the best for new year i forgot to say this is my last stream of the year i meant to do that at the beginning and i haven't done that so the plan i talked with tim so tim foaming guy is like we trade off spots or like he fills in for me um he's going to stream next week um but i'm not going to and then he we're both going to take the two weeks after that off so this is my uh last stream of the year i'll see you all next year and start thinking about circuit python 2024 which is kind of our like call for people that to just brainstorm kind of longer term vision for a circuit python um we usually we do hashtag circuit python and then the year so we'll be doing that in january i'll do a post for the new year asking people to i mean it'll be very similar to last year's but like let me know what you're thinking about what you'd like to see in circuit python um and well it's really fun to see what projects people are doing and where they think the projects should go so uh usb host is definitely going to be one thing on my list um i've done a lot of work and i haven't um but i haven't uh uh like really advertised it and gotten it everywhere so um yeah sorry let me just uh i'm just managing my well my mom is sick and she's at my house and asking me about picking stuff up on the way back okay uh reanimation xp says i've never seen a makeup board that can use slash bit bang h hgmi in that way most of it is fpga stuff and i'm now ready not ready to dive into verilog anytime soon yeah i feel yeah it's a really neat hack and like one person who's worked on um yeah it's like somebody who worked on the actual like rp2040 like figured out how to do it it's very clever um and so we we basically that's another example of like we took that library that they did for the res rp2040 and wrapped it into the like pico dvi module that you see in circuit pylons dj devin three says when boards come out with more ram and storage with dvi i think the possibilities of hgmi with circuit by them will expand happy holidays hope everything is going well with what you've been dealing with lately um yeah so sad news that i told everybody last week is my mom has cancer and is not going to live much longer but she's at my house i've got to see her and hang out with her and uh we're just making sure she's comfortable uh another reason that i'm like i'm not going to do next week is i don't know what where we'll be with that and daycare is not next week as well and it's the holidays okay hands lab has another question here's another one why doesn't it a different carry the swan feather from blues wireless it's got a stm 32 l4 plus at 120 megahertz uh that is not my call i don't know i you could totally email um support edited fruit dot com and suggest it uh maybe they haven't asked us to carry it i don't know but yeah i don't i don't really i don't really decide that stuff i just more says hey we're we've got this new thing let's make sure it's well supported and certified on yeah family comes first thanks yeah sorry that's why i was just like texting a bit i'm gonna swing by the pharmacy on my way home but yeah i mean that spending time in family has been wonderful um mark says and things do get done from those yearly posts that is where i got the want to work on gif io and an wanted it and thought that would be a cool project yeah it's it's really cool like it can take multiple years like the bealy workflow stuff is something that i talked about like repeatedly for a while and now i've actually done it and i do now i'll see like how much i see the numbers for how many people are using those apps and it's like single single or maybe double digits so uh it would be great to start to see people pick it up and it it also makes me really really how established the usb workflow already was right like really like showing up as a as a usb drive and just editing a file like there's no learning you have to do or there's very very very little whereas like on all the mobile stuff you have to like not only do you have to install an app that can do it you gotta figure out how to connect and then like then you gotta figure out like how do i actually edit this stuff because like you don't really edit code on a mobile device even and i have lots of ideas on how to make that easier but um it's just a huge like a much longer term bet um much much more difficult thing to get adoption for than usb is um and circuit python really has has really benefited from having really good usb support like the rp2040 and the pico came out and they didn't have usb human interface like keyboard mouse support um in micro python like they've not been as consistent in their support across all of their different ports as we have and and so people say like i want to make a keyboard and and like circuit python is great for for that sort of stuff um ble bluetooth lonan g uh hid is also something that people really want um randal asks what about loading compiled extension modules from disk so micro python has the ability of what they call native modules where you can compile c code and run it from a native npy file i've i've it's never been a huge um priority for me so i wouldn't say that i would prevent it from happening but i've like set some bars like we need to figure out how to make it clear what platform it's compiled for so like you wouldn't be able to take a file from an atmel samd and use it on the expressive because those are two different cpu architectures um and then there's a lot of complexity because like micro python has to end up doing some sort of like linking so that you can like call some standard functions and micro python in the native code it's just um it's complicated so yeah generally it's complicated um so yes so here topping the stack we got about 25 minutes left so if you have more questions feel free to ask them um i yeah and then the other benefit so the the going back to the native modules thing the other reason not to do native modules is to push people to have them in the core and by having them in the core they automatically are kind of like maintaining like we won't break them we won't deliberately break them if they were in the core and they all automatically like stay up to date because they're in the this core code base that does get like you know tested in the sense of building it at runtime and that sort of thing so it's just um i'd rather if you need another module i'd rather do help you do it in the core code base and help you like get it merged in so it just goes along with everything else and we've done that so you can see it there's a couple in there like diship who's stage exam is a example of that where he he had the custom native module that he wanted for his boards and and we've got those merged in so that's what i would say is like we're happy to just have you do it in the core too mark says i played around with compiled modules and it's a lot of work and even the micro python implementation isn't perfect the core is so much easier he says i started typing this in scott said that yeah so here's an open invitation if you want to make your own module we'll get it in the core hi unexpected maker are you on time yeah you're on time time zones are hard uh i'm i'm only doing an hour and a half so we got about 20 minutes 27 su 27 also known as shannon i think man i have too many hobbies hard to dedicate time to them but i enjoy them all learning how to program seems like it's going to need a lot of time to learn it a lot of time a lot of experience but circuit by thumbs the way to go in my opinion really overwhelming i have ideas that i want to do but lost on how to get them done a really easy place to start so what i always recommend is the learn system this generic get started with circuit by the guide is fine but you can also find what you want to do and kind of start there start with something that's like what you want to do and then you can modify it to do exactly what you want to do that's how i started many years ago but yeah it's always fun to talk about how circuit python came to be and stuff so yeah that's my suggestion would be this if you have specific questions about python there are just python tutorials that will teach you if statements and for loops and variables and all that that's the same but then for reference the circuit python essentials guide is the best reference for like how do i do something in circuit python so audio mp3 pwm neo pixels this is a great way of like you know kind of what you want to do unexpected maker this is my last stream of the year next week will be tim and then two weeks off after that as well okay new workflow stuff file browser i think did i do hello is my password as well so one breaking change that's coming with this code for circuit python 9 is that when you mount a file system like an sd card you'll now need to have a file or a directory there already it used to error if you did that which is probably inherited from micro python but i'm inverting it so that's why it's breaking change is that you'll you'll now need to create it and then but if you did before and then tried to mount it wouldn't so that's changing with circuit python 9 and the reason to to add that requirement is that uh it makes it much simpler to list on this view the mount because it actually doesn't know that like sd is it is uh is a like separate file system or a separate separate disk all it knows is that like there's this sd folder so it's kind of cheating but it makes it more convenient so here's a listing of this sd card that i had in here last week as well this is interesting because it's it's showing that it's using the storage but it's also letting me click these things so this is the thing that i had to like fix and that caused the title of the thing that i probably won't actually work on the refactoring today but the other thing i should show that is new is this message here and if you have ideas on how to change that let me know but disk usage is 17.1 gigs out of 31.9 gigs and this is in hard drive manufacturer divided by thousands not 1024s and the reason is because i have a 32 gig card so like it makes it match up with the card size and if we go back and we see here you can say you can see that this is 12.3 kilobytes out of 12.2 megabytes so that's the this is a way that you can kind of get a hint about which file system that you're you're looking at and this e-paper driver was just a test upload that i did so i don't think this will work i don't have a message to tell you that it doesn't work so the the the thing that has been not fully done in the code that i'm working on is like the management of when who has like writes who has the right to like read and modify file systems uh reanimation xp says it would be technically gib if you're not using 1024 right no i think it's the opposite gib is the like technical technical one for the 1024 i think i think it's one of this uh yes learn.ideford.com yeah yeah and i sorry i i know my browser's a little small so um where does the refactoring piece of the title of this thing come in so so i did a pull request and it kind of crashed and burned in the um the ci so the ci is is short for continuous integration uh it just means uh the tests that are run automatically on code so i made this makes sd cards available over the web workflow and it has this red x here and the reason that is is because uh i had made it work on the expressive boards but i had not made it work with the ble workflow and in fact i'd broken the ble workflow stuff because i'd changed something and if you know me i'm sometimes okay with things creeping a little bit uh and so i said you know what i'm gonna do i'm gonna make uh sd cards work over ble as well and kind of make it more generic so yeah i got the circuit so i said like let me refactor some of this stuff into a common place so that both the web and the ble workflows can work together and then also um the other thing that my brain is thinking about and justifying doing more this more work is that um one of the things i did last week was i updated the internal version of the esp idf to version 5.1.2 um which is a uh which is the latest version of the stk from expressive but i looked at the release notes after dan asked if i had and i saw a line that says uh support dynamic ble services and uh that has been a roadblock to full ble support on expressive including the uh including the ble workflow so we could do the ble workflow but then we wouldn't have the user be able to do anything on top of that because ble workflow kind of starts everything up before user code runs um and so i'm thinking ahead to a world where we're gonna have web workflow and ble workflow on the same chip that specifically the esp32 s3 so uh we'll have a world there where we're able to do both um ble and web workflows at the same at the same time and so i was refactoring yesterday when i had a little bit of time um some of the code from ble workflow kind of outwards because i was doing all of the same changes so there's let's pull up the code i'll show you what i'm talking about so um i like to work by looking at the code where it is hi bruce just dropped in for the end happy holidays thank you yeah i don't actually know where we'll be for we celebrate christmas and we're supposed to go to michigan but it depends on on my mom's health so where is it live all right i got distracted because ham's lab says a company called tq group released a board with the nxp imx 8m plus processor and a board with the same format as a raspberry pi and that runs pi ls you can also do custom builds with the octo it's got four a 53s and one m7 i don't know the price yet but making a board like this raspberry pi from from is brilliant i have more companies make them yeah um that's why we sell single board computers it's sending them for raspberry pies and everybody else's version and the imx the imx uh a series stuff is pretty interesting but generally that they're just not cost competitive like raspberry pi is a really aggressive in pricing and so it's hard to hard to match that yeah so there's more work to do in bili on isp um we're now unblocked but we haven't done the work um but i'm thinking ahead to a world where where we'll have full bili i o because i think it's something that we do want sooner rather than later i think once we get through the holidays and um have some cycles and some focus like we'll actually be able to pick up larger projects like that holidays are hard just because they're like you know you're busy um okay so top level circuit python a lot of the shared kind of runtime stuff is supervisor is what it's the term that i we picked for it um supervisor shared bluetooth has uh an outer bluetooth manager and then file transfer and serial stuff is separate so in here you can see like the actual deli gear thing is down at the bottom um so there's like some format or or thing that i came up with and it delegates to different um process function so you get a make dirt command in and then it calls this process make directory and i am switching it to using this like supervisor workflow make directory um which we can skip to here so what i was having to do is i was having to add this chunk of code in a lot of places so what this is doing is it's taking a full path from the api and figuring out which native um file system it applies to um and then it's also doing a verification that it is a fat file system so this is a constraint that we'll have here for a little while at least um because the further code the code further down is expecting a fat file system so no no no little fs support initially but the the apis are um the apis are not fat specific so you'll you will be we will be able to go there at some point if we want to um and then the new thing that i'm adding here is this file system lock we it wasn't as clearly split out we had we were previously doing like usb state checks and and just deciding to throw error messages if usb was to was using the block device that underlies the file system hi tomon but i'm going to switch it to this file system lock and unlock and then it will also check the usb so each each mountain file system knows whether it's meant to be granted to usb or not um and so this this is going to be a good way to isolate that and then you can see this override fat time so the api allows you to specify what time the file should be created and then make directory um tomon asks how would you make little fs work translation on the flight of fat so micro python already has little fs support um it would not work it i wouldn't make it work over usb i should be clear about that i'm not going to make it work over usb but the bili and the web workflows are like higher level file based stuff and so you could have that use little fs if you wanted to reanimation xp says today i learned windows has been lying to me my entire life and reporting uh yeah divided by 1024 is while labeling it gb that's going to continue to confuse me yes correct so i should also yeah so this is not this file system this sd that's shown in the other firefox window is not available over usb yet we have another issue where we want to make a separate a second block device or a third block device so you can have multiple like you'd have circuit pi and then you'd have a separate like circuit pi sd lot um yeah i'm not doing that yet i'm only doing web workflow uh because like the use case that we have is like more is making this audio player that goes into kids toy and if you want to like upload an mp3 but you can't store it internally you have to store it on the sd card um that's that's the reason you want to be able to dump big files straight to sd and yeah sorry i know there's latency but i also like to have closed captions line so hopefully those are working because that's why i take the latency hit uh right so disk usage is working it's not pretty but the other thing to think about is all this page works offline um there it loads in a css file but it still looks okay without the css file so if you have ideas on making this look better there is a css file that circuit by that or hosts that gets loaded um in case you do have the internet um yeah so the refactoring that is in the title that i'm working on is like sharing like this make directory code that's doing this file system look up i'm i'm moving to that world instead of copying it everywhere like i had started doing and it's it probably doesn't even compile right now i'm still working on that now i see here that this is unneeded so i just i think this is where i was working when i i stopped last time um so it passes the time that you want to write in um and that is fat specific i think so we would have to change that but um and then we're using the other one and so this should make maker parents actually work across file systems because for every sub path that we're trying to make we do um we do this look up again which might be not it's probably not the fastest option but so yeah the next yeah and then this file system lock is not actually implemented yet i gotta do that but i like the api so you give it the file system you call file system lock and you tell it which file system you want to lock and so every file system object will will be able to tell whether it's locked or not it's not super we don't have to worry too much about concurrency but and then i think what i'll do is i'll change the usb code the usb code will also call this to lock and unlock so like there will be a bit more indirection like this will just worry about locking usb code will just worry about locking and then um it won't be that like the workflow code is checking to see if it's on usb directly or not it'll be kind of indirect tjdevin3 says have you had to use octal ps ram would that make file transfers stuff to sd turn faster to sd or would that only be relevant to onboard stuff so i've never made any speed promises um just kind of like my approach to display io with uh the workflow stuff i'm not shooting for fast um at least you know any optimization takes a lot of effort for diminishing returns um you know what i was optimizing for more is like universality and portability and then optimizations can always happen later if you really need it um so yeah i think i don't know i don't know if octal ps ram would help the web workflow speed up or not because i think it depends on like where the temporary buffers end up so like the socket reads bytes in and those bytes go somewhere they either go internal ram or external ram and then writing to the sd card and writing to the sd cards probably not super fast either um i should note that i'm not adding sd i o support immediately which is like the parallel faster interface to sd cards and i'm only doing the spy one right now uh because that's actually the one that i need here and and is more supported so i'm starting with that i'm wandering into this locking stuff but i'm not wandering into like supporting all the different ways to tackle an sd card or all of the different past systems okay um so that's all the background on the work i'm doing hopefully i will have some time next week to finish this up it would be nice to get it checked in um so i'm gonna have to my brain is not fully there to figure out what i have left to do and it's friday afternoon and i don't really care to get to get it in that mode either um hopefully by the end of next week i'll be able to get the pr out and ready again to get checked into nine yeah any final questions otherwise i'm gonna take off i think and have a weekend i've got a closet to stuff full of stuff temporarily all right it's a very random comment the backstory is we had electrical work done in our house and to do it we had to take a bunch of stuff out of a closet and we got a new closet system ordered to put all the stuff in there but i we haven't gotten it yet but we need to get it in there temporarily anyway getting late you're tired to have a stop on the way home all the best yeah terrible 2023 has not been a great year for me and i know some other people too so keep an eye out for circuit python 2024 come january first i'll do a small post on the blog and then talk about it in some streams we'll have some ideas about and well spend the holidays if you have time thinking about uh where you want circuit python to go things you'd like to be able to do with it you can't yet or harbour you'd love to see um my name is scott if you came in late i work for ate a fruit you want to support me ate a fruit's been super supportive through all this stuff with my family being sick and stuff so i highly highly highly just help them support them they support me really well so ate a fruit com there's hardware there new hardware every week usually uh lemurs and lady it has just done amazing work to keep that rolling even though she has a kid younger than i do her and phil have a younger one having a little one is a lot of work and now and they run a company too through a chip shortage so uh support ate a fruit uh ate a fruit com um if you want to hang out with us on the discord discord is great it doesn't disappear when i stop the stream um you can go to the url adafru.it slash discord uh thank you in advance also to tim foamy guy who will be streaming next week uh doing some higher level library stuff probably uh he's been working on circup which is awesome so check that out as well and i think that's it uh we'll see you all next year uh have a great holidays happy holidays to everyone thank you for being so supportive i'm excited