 Okay, happy Friday. Good afternoon. Let's get a couple of our windows straightened out over here. And then we can get this on the road as they say. Got text for a minute here. Here. Looks like I have got sound. OBS at least. I did YouTube one. Okay, that one shows as well. All right. I think we are good to go. Put this back. How's it going? Seeker over. Good afternoon. So welcome, everyone. This is the DeepDive program. My name is Tim. I go by PhomaGuy on GitHub and Discord. During the DeepDive program, which is a weekly live stream program where we are working on CircuitPython stuff, typically we are going to be working either on CircuitPython core or libraries or infrastructure or sometimes even projects that use all of the above. It just kind of depends from week to week what's going on. But the kind of common theme that brings it together every week is we're always working on something related to CircuitPython. If you are brand new though and you don't know really what I'm talking about or you're catching this in the future and you have never heard of CircuitPython before or you don't know what it is, you can learn more at the main website for the project, which is circuitpython.org. Basically though, CircuitPython is an implementation of Python that runs on some tiny computers that are called microcontrollers. And when you run CircuitPython on these devices, it allows you to plug them into your computer. They will show up typically like a USB thumb drive. There will be a Python code file on there and you can edit that file and save it. And then the microcontroller, the computer that is on these little devices will execute that Python code for you. That's kind of like the super high level version of what we are messing with here. In particular tonight, we are going to be taking a look at this device, the Matrix Portal M4. However, it is worth noting the device by itself is not so special. Really what is special about it is that it can plug into a LED matrix, matrix Portax, that's not what we want, matrix portal. It can plug into an LED matrix, which is a, I think 64 by 32 maybe is the number of pixels in there of RGB LEDs. And then you can draw on it as though it were a display. So that's the device we're looking at tonight. There are however loads and loads of different devices that support CircuitPython 416 devices at last count. This is only one of them. It's important to note they all come in different shapes and sizes and capabilities. So the one that we're using right now is well suited to this LED matrix RGB thing. There are of course other ones though that do other things either draw on regular displays or ink displays or maybe don't even have displays at all, but instead hook up with other different kinds of hardware. If you want to learn more, like I said, CircuitPython.org, that's a good place to head. Another good place would be to join us over on the Discord, which is linked down below, ADAFRU.IT slash Discord. On that Discord, there is a CircuitPython dev channel as well as help with CircuitPython channel and also a bunch of other sort of maker electronics programming related channels as well. So if you want to get involved or just chat about any of that stuff, head over to there. CircuitPython is an open source project. It's free to use. It's free to run it on your own microcontrollers. It's even free to port it to run on your own microcontrollers. Even if you're a third party company that has made your own hardware, you can add CircuitPython support for that hardware. You don't have to pay anyone. It is all open sourced and it is all funded primarily by ADAFRU for the CircuitPython project. They are paying the team of folks who work on the project full-time. They're paying other folks like me who work on the project part-time and that is kind of what is keeping the CircuitPython project driving forward of course because without people working on it, then there is not much of a project and they are heavily encouraging the people who are working on it by paying them great wages to do so. So thank you of course to ADAFRU and then thank you to anybody who wants to purchase hardware from ADAFRU because that is helping support CircuitPython as well of course. You purchase hardware from them, they keep the lights and the factory running and then they keep having the ability to support CircuitPython by paying the developers. The main goal that I am trying to do today with this Matrix Portal is just test some changes in the ESP32 SPI library which is the module that is used in order for this Matrix Portal device to connect to the Wi-Fi. This device has the capability to connect to a Wi-Fi network and then fetch data from the internet for instance or some other source on the network. The library that it uses to do that is this ESP32 SPI. There is some work in progress to change up that library a little bit to rearrange the API for the socket that is inside of it. I have tested this a bunch across a bunch of different things but it did occur to me the other day. One of the things that I have not tested at all yet is the Matrix Portal so I figured we probably should do that before this one ends up getting merged because we definitely want to make sure that the Matrix Portal is going to be working. Working on AIO mini MQTT session timeout issue today whilst watching the deep dive, getting close to a solution hopefully. Fingers crossed here for you as well on that one. A little bit of mini MQTT testing on this stuff as well but not much with the timeout. Actually worth noting there is this other PR. I don't know if you've taken a look at this one or not. It might be worth trying this version from the PR though if you haven't. This one was changing the behavior of timeout a little bit to be more like how I expected it to work from the beginning but I think it used to be a bit different so if you do end up stuck stuck that might be one thing to try is that open PR over there. Okay so I'm just going to grab a couple of learn projects that use the Matrix Portal and fetch stuff from the internet that way we can test the ESP32 spy module. We also should probably update the Matrix Portal. I have no idea what version is on it. Most likely not anything particularly new I'm going to guess. Oh actually maybe I updated it before this right. I got the old bandmaid logo going on there a couple weeks back before I went on the concert. I went to the concert I should say over the weekend. Let's check in on the version of Circuit Python 800 beta and it's a dirty build. I don't know what I would have made a custom build with. Okay yeah let's definitely update that. How's it going Isaac? Good afternoon from the Pacific time zone I think is what you're saying there. Portal there was just a new RC the other day so we'll grab that. It's over to bootloader mode. I think it's quite bright. That's going to put us into bootloader mode. I'm trying to pull this wire just a bit out of the way. Okay a newer version here now 820 RC1 and I would suspect that the Matrix Portal has got ESP32 spy frozen in. Let's confirm that because if that is the case it changes where we will need to paste our library in order to test it. Requests portal base ESP32 spy. You know it might be interesting to make a build with an updated version of the library. Might be a good exercise as well. To start with though I'll just paste it on. We are in compatible socket so that is the branch with these changes. And so ordinarily when we would want to load a library on a device we would be pasting it inside the lib directory. In fact if we look in here we can see we already have ESP32 spy and portal base and requests. All of which were listed in the frozen libraries meaning that none of these ones that are inside the lib folder of those three specifically are actually doing anything. Because when they are frozen in they will take precedent over the lib folder meaning that these ones in the lib folder won't actually get used instead the ones that are frozen in will. So we can actually just delete those right now and that's going to also save some space. And then I'm going to grab that. We are going to put it in the root instead of the lib folder which is how we get it to use our modified one instead of the frozen in one. Paste it in the root. We also want requests which is on this branch which is also the one that goes along with this change. Quests.I mean we could take MPY but I don't know when I compiled it or what version is in it so that is well requests okay. What was that? That was something else. Let's take that and go band-maid, logo, scroller, and code pi, MPY that. That one like there okay. We'll start with this matrix portal new guide scroller. I think it puts the number of total guides and then I think the name of the most recent one or something like that. It makes a nice thing to test with because it grabs data from the internet. You know it's interesting the lib folder here does show those things. I wonder if we could make the screenshotter smart enough to know what's frozen in. I guess the crux of it though is that the project bundler also probably does not know that those things don't need to be inside lib folder. I think we find the same thing here actually. Yeah it'd be a mono zipped. It'd be a mono. Oh that's interesting. I wonder why it's zipped. We probably want that to be unzipped. Does it use that? Head font. Uncompress. If there was an unzipped copy of that font file in the repo it would make it so that the font will appear correctly on the screenshot here. I almost called this a spreadsheet. Hold on I'll be back. Trying to figure out what the cat's doing. Um heard some questionable sounds but actually just the toy. I think so it's expecting it to be unzipped and in the root. If it were in the repo that way it would make the screenshot correct. It would also make it to where you'd be able to just copy paste. Copy paste this right on in without having to change anything. Just how a lot of the guides work. Oh is that the same thing? Hey look that's the same thing. I already have this. That's right let's overwrite it. Sure. PyCharm. Mr. what IDE is that new peer? Yep totally correct. This is inside of PyCharm. Technically PyCharm I think the pro one whatever they call it I'm not sure. They have a free PyCharm that you can use if you are a student or if you're working on open source stuff. I think they call that one community edition but I do have the paid PyCharm version and I do like it quite a bit. There are a few things here and there that irk me about it from time to time definitely. It's not without faults completely but uh I definitely do only do enjoy it as a IDE overall. I already have settings in our time zone. Put that back up here. Here we go. They're overlapping a little tiny bit. I don't know if that was intentional or not. It really is. It's the ascenders only. Oh I think probably my PC wrote a file and it caused it to reset so it takes it a second to fetch. How interesting. Different colors each time. Or is it rainbowy? No. Changing? No. Saying yellow. Oh different. Okay each each project takes a different color. Looks like okay. Nice. 2780. So what was it when this was made? 2325. So 455. 455 ish. I've been created since this. It doesn't let you write directly to the board. The short and easy answer is yes it does. The longer and a little bit more complex answer is that it is best if you do some setup first. You you can write directly to the board straight out of the gate but there are some things that make it less convenient. This page right here which I'll put in the I will put in the um yeah I don't know what I just did to the place. Oh I say oh this is not it what doesn't have its own page. These don't work right now. It's not changing the URL. What is going on? Okay hold on. I don't know what's going on. Put this in the chat. This page has the exact setup that I did inside my pie charm which basically boils down to turn off autosave and add the directory where the thumb drive spawn as a content root inside pie charm so that you can see the thumb drives when they show up which are in our case actually the microcontrollers. Do they overlap? No they don't. We want to nudge the font slightly. I don't know why it is different now but it's looking like our ascenders on our scrolling text is actually overlapping our numbers like two basically two pixels it looks like maybe three but I think two. Oh it is it's three and at least one spot. It's mostly two but there is like a tiny bit of three somewhere. What was that on I wonder? What was the tallest one? It's in green I think. Oh the eye that's what it is it's the dot on the eye. Yeah the lowercase i actually taller than the uppercase i that you see yeah that's interesting the lower the the top row of dots on the lowercase i's dot is one pixel higher than the crossbar on the top of the uppercase i so like in here let's nudge that up some oh it's a little tricky isn't it exposition I don't know which one's which well okay this one must be the scrolling text because it's at display height over two minus four which means it would be more near the halfway point maybe it might actually be that backwards actually height would be something like I think 32 over two 16 minus four gets you to 12 yeah I'm thinking that's the number actually so then this is 25 which would put it further down yeah so what if we just back this one up like more three more because we technically have we have three pixels of overlap and truthfully what we really want is one pixel of in between we can but it did not go this time I saved this it didn't actually restart I'm not sure up lines red too low yeah yeah we're gonna try to scoot that one up and then we may have to scoot the bottom line down just uh just a scotch really programmed in forever only twinkered with our you know stuff as necessary nice yeah circuit python is a little bit easier typically than our do we know but there is some stuff that you can't do um it does not that changed at all I didn't save because that's still on four is it on four started on four I want four more truthfully there we go now we have one pixel in between we have most of the time we have two but when the like on the tallest spot which appears to be the lowercase i we have one and it does appear to be working as well we should be using the we should be using the frozen in ones or vice versa we should be using the ones we pasted rather than the frozen in ones oops do it this way we can like theoretically even more super duper sure that we're not using frozen in ones that's fancy led parody too fast led uh I do not know the answer to that sorry I do I play with leds a little bit but nothing where I'm like super duper pushing the limits of what they can do I would say for leds the best place I know of to get answers to all kinds of stuff related is inside this guide here uber a different a different new pixels uber guide has all kinds of stuff about leds I don't know for sure if it talks about fancy led or fast led though but that's the biggest cash of information that I'm aware of have related to that kind of stuff kind of working my way through various guides welcome to the world of circuit python if you have fun I don't know if it's gonna fail or like it might not be able to import now I'm not sure yeah it looks like it's not able to import oh well and also yeah I mean portal base in specific I also did not paste a copy of so that would make sense that we actually just don't even have it whatsoever this is probably gonna put back is p32 spy and requests maybe I will say here's one thing that does happen sometimes with pie charm is it does sometimes get out of sync from the disk and you have to reload like this manually I've noticed that doing that it's back we can get that reallocation failed probably our issue now is that because we're not using frozen in ones gonna take more ram in some cases because we also did not use npy copy of the library and instead use the python the plain text python code it's online nine it's just an import still dang maybe if we npyify the sps spy library we might have enough smaller font might help as well truth make it any farther the line nine 18 it did make it one extra layer we could try requests as well I suppose this one here is there any chance that this command will build the npy files if that's the right prefix I finished cross hopefully we get enough this time okay and now we know for sure we're using the modified ones let's open learn oh it's here somewhere we can submit PR with that tweak on the size or the location I should say it's not that big a deal but it'll be nice if anybody's using this in the future new branch check out be the new branch that's going to be called um learn guide what was the name of the actual project matrix portal new guide matrix portal guide count oh next pause bang no track find the folder that it's in which is going to be called matrix portal learn stats I'll leave that zipped for now I guess I want to change too much but I think it'd be nice if that were unzipped as well okay seems to be working good though as far as the actual functionality with the network uh I will try this one as well which I think that is time from the network have thoughts aerial I'm going I want to keep a copy of that I mean it's much just stock from the guide we don't need to mess with it so we already committed the PR for the change okay it wants BMPs pumpkin time for america halloween I'm not sure let it run through its whole thing here and see what all it's hope it's reset again stopped by otter reload it keeps doing this too much I might turn otter reload off I think sometimes my computer is writing some like meta files stuff and it's causing it to reply post getting text with hours minutes I don't actually see the hours oh until halloween okay we're getting actually see any countdown or anything this it maybe until halloween looks the same oh eight hours that part we missed eight minutes maybe it's because we're more than a day take a look at the code walk through here see what's going on or is there a walk through yeah let's see here okay well for one thing maybe it's um maybe it's in the future or whatever maybe it's in the past rather and therefore that could be that could be why it was blank on all those things it's set yeah here we go now it says width uh we had a bunch of these with and then it was blank 17 block which is actually coming up maybe one minutes days got cut off a little bit but I think that's because it's three digits probably not made to bust it out quite so early in the year and it's it's okay that seems to be working let's see if we can get maybe one more that fetches a little bit more data I don't know for sure if there is something but let's take a look moon phase it's fetching some kind of data from somewhere I think how much of it and data yeah whether the two launch to uh let's see what else there is it's not it doesn't look like it's like downloading if there's anything that downloads a picture that would be data the text for diofeeds probably this has an update delay with polls data diofeed portal.getio feed this has probably gone through requests then would probably have to nuke all of my data for diofeeds make four and we're out of matrix portals quote come from data fruit quote server that's also seems like data for diofeeds find quotes dot sign text dot sign color updating from data for diofeeds that text get the quotes feed that at least one quote does it choose random ones or always give you the latest one random don't necessarily want to set up a bunch of feeds if this is pulling anything from the network this quality weather matrix need a token for this yeah open weather token I don't know if I have that let's see one second yeah let's try this one stuff already exists pf oh we ran out of memory font stills to use burial hole 14 and 16 that using all three glyphs line 77 graphics 100 medium font and we could try not doing load glyphs but I don't know that it will make a difference unless we're going to use every single one of these characters doing load glyphs like this is basically just eating a little bit of extra memory as a trade off for time but we could get the same speed up if we figure out what characters were actually using yeah I probably just go without this maybe numbers I guess might be helpful because you definitely have the numbers there but as far as everything it's going to use in the thing here you could try to write out all the letters that are important but the truth is like it's going to save you a few like a fraction of a second the first time it happens it will go a fraction of a second faster once it gets down to here but really you're just trading the time like it's taking time here instead of down here somewhere whenever the display gets refreshed this one called weather matrix portal weather their display matrix W's the glyphs have any I mean you don't even necessarily need to do this one either this here and it's open now to be attempting I do have a custom build though huh we removed those built-ins I wonder if it has that problem on the stock image let's try the stock image I guess maybe it wouldn't be worth changing if it does work on the stock one and if it's like only not working because I unfroze those things and then copy them on maybe on me for doing it that way I do think in general though load glyphs like oftentimes doesn't end up necessarily being worth the trade off well it would have to let's see we'd have to put that back some maybe that one's not worth changing this would put a spec to frozen in versions let's not have that problem so the other thing though that I kind of want to try is what if we freeze in the new version of these to the best of my knowledge I think they both get smaller so we should be getting more ram not less to use I think but it's definitely worth a try for to do that we're gonna go frozen about that and then back to here to requests three five sure this would now make a build that has our custom versions inside of it it might be nice to have like some that check what's on socket okay here we go this will let us see this will let us know if we have the updated version the updated version does not have read line and does not have available it will be underscore available and then I think read lines gone all looked all together but I'm not sure maybe read also so we'll be able to check it after thinking maybe we could modify the library but we don't need to the library further our case is already modified now we know what to look for to see which one we have cross it ramstr 21 percent boy that one or okay we're not just in py crossing still and takes a minute for just packing stuff in I did do a clean as well excellent after you do that bootloader nice yeah see we have underscore available and we do not have read line or read but that is definitely the new version so let's let it run and see if we get the memory error this would tell us if it was an old version new version sort of thing I leave the new version should use less since we removed stuff but I'm just memories weird set to metric I'm sure what jumper it's talking about I think it was it displaying in metric oh yeah I guess so nice okay so that one's not really necessary I wonder what's the jumper oh I changed it to Fahrenheit okay I probably spelled it or not a spell P 12 P 12 that is that like interest see a deal well we will be using button down if it has button down and button up if either is pressed essentially oh no well we check either but one of them means one thing and the other one means the other thing we also don't necessarily know from here which one of these is metric and which one's Fahrenheit we have is metric so I guess probably one is metric so if we can press the up button should set this value down to zero which should make is metric false you know what's weird is that this gets is metric here set to the value that it finds here which we know is going to be either a number either a zero or a one but then here we set it to false which is a Boolean I guess zero and one are pretty close to Boolean so is this only this is when it boots up then basically okay so if we hold the up button and press reset at the same time I think it should go to Fahrenheit mode it's kind of hard to do for my fingers but let's see I think we got it but once I'll see us though I guess I probably didn't hold it long enough because we hadn't really made it into the code file yet so let me try to like hold this down longer I can really not do it without hand here definitely should be running by now but I guess I still don't know where really looks so close at where this is at in the code if it's before after loading so this down for the longer there we go got the Fahrenheit going okay I am thinking we're looking pretty good there that is essentially really all I wanted to do is just grab a handful of the matrix portal projects and make sure that we were not randomly breaking them with the either of the changes really either the change in requests to remove backwards compatibility or the change in ESP 32 spy to remove the wonky version of the socket API so far it's looking pretty good though I think next I think next I'm gonna look at HTTP server how did mine some types over on display button I'm actually gonna do this though and sticking with the kind of web stuff so this is over on HTTP server library this is not going to be using the same device ESP 32 spy cannot use this library it turns out so we'll test on a different device but I saw this came through and got marked as ready to go and I think we saw Michael in the chat earlier I definitely appreciate all the hard work Michael has done on the request library so why don't we do this one take a quick look at it here um for this one I'll test on ESP 32 s3 I was actually using a different wire the whole time on one second two different uh I have more than two different usb cables but at least two different usb cables hope we also just killed the refeed okay uh this one I saw one thing we want to do is test the timing I think what all is in this it says added form data class and request dot form data for post body using application URL form encoded which is like default I think if you have a form in your html uh with no file in it you have a file I think maybe it goes to this one explain also new example server headers oh interesting okay yeah server dot headers uh for headers that are sent with every response without the need for explicitly adding them in the constructor the constructor or the handler function or if that means the constructor I don't think I did a server at all that had any kind of header responses anyway though so I don't think I knew how it used to be updated uh doc strings more verbose fix in chunked sending empty chunk was breaking the functionality because it ended the response prematurely not sure how to test that I don't know how to send an empty chunk updated docs refactor unified query params inform data to use i-field storage or shared functionality functionality it's not even word functionality uh if possible please test the impact of the changes on the processing speed in theory there should not be much difference or overhead but on my testing I noticed a large range 80 to 500 milliseconds might be caused by the by-fi so let's just grab us the do some little timing tests here let's grab a little simple test auto and wait what is is manual no let's do start in poll actually this way we can have timing around our poll function does poll return true if it does something might be kind of cool if poll could have like a did affect something versus did not affect something this oh right I was trying to test this yesterday but it turned out that it does not work on this device okay that's fine grab this we'll want the stock one to start with which I probably have but I also don't know for certain we somehow don't have this that's weird stock one of this problem is though it's going to be on version inside server dot poll does it return anything no either raises an error or it returns nothing um I guess we pretty much just have to check from the client side then I was thinking I mean like we could still do it I suppose we could put a take a timestamp here and then take a timestamp afterwards and then print the difference it would work I guess but the problem is it's going to spam over and over and over and over and it's going to make it basically impossible to tell which ones were from like which ones were from iterations that actually returned a response or not I think this will spam really fast could do this and then it will print inside base immediately before took so then maybe we can use that to find the ones the other thing I guess we could add a filter like if it's small enough then ignore it but I also don't know how big we're expecting it the other ones to be so we need to hit the IP which uh I don't know and it's way back up here and it's probably gone no actually 227 I think I used this port 80 by default here we go okay okay these are file handlers right yeah yeah yeah different files and not actually oh we got a 404 on Blinka it's probably trying to load a file that doesn't exist there we go inside base so yeah those are taking about point point one we could we could now do something like if after minus before greater than 0.09 only print it if it's big enough that should reduce the spamming however it will also make it use will also make it um I'll be back in one second it will also make it so that if it happened to go faster than this we're no longer going to get the print out from it which yeah much less there we go okay we pretty much got 0.10 for the base and for Blinka and I guess it gave up on favicon because it doesn't seem to have requested it this time I'll be back in one second uh what about from the well let's fix the file also oh does it not have Blinka built in or maybe I did that maybe it's not actually part of turns index there's not actually an index though okay one thing we should do maybe is have an index file in here could be this one looks like it is pretty much this one truthfully so maybe it's just renamed slightly do I have that on my device is it inside yeah so static okay yeah never mind this was my this was my test this was something different we can grab home it should probably match the home hdml inside of the python file too that way it will run oops oh I think um I think that's valid for hdml how it actually wants it I guess I mean it was passing does that work what does that do oh interesting we got a bunch of random iterations that were over the time limit there I wonder why one thing I took those out so let's put that back they show up there what about if we do hdml comment them now they're not there but does pre-commit complain if we do it that way we have to actually have the repo open I don't yet um search it's still just this one though right really I guess we could go back to uh remote dash v get h is it um repo set default repo set let's go to mainly just this and then clear and combination of clear and clean clear and run pre-commit uh reuse past we are good there back to where I was before I got a little squirrel chasing a car there let's see what was the timing on this 120 milliseconds total 113 total um it would be kind of nice as if we had a code that could just run maybe in a for loop or something and take like 10 readings for us ah we have loop get requests even look at that it's pretty much what I want um this one's just going forever though say get 10 times and let's say for i in range 10 that stuff is in there we would like to do this differently though we want uh before equals that after equals now again that and then we will say can you do that in c python no if I can do that time time dot mono oh yeah that should be fun or an after and then let's just print um as now i status code let's also put took after minus before and we could get rid of the sleep or at least maybe make it lower I don't know this will run through 10 times make the get request 10 times oh we don't want random though we'll make the get request 10 times it will print out how long it took for each one okay so from our script here we ended up with the first one was the fastest at about two tenths of a second all the rest of them were about just a hair over three which is a little bit slower than we saw in the browser but there's going to be some variance as well because obviously this one was super insanely fast and then we got a bunch of faster ones here actually like our average here was quite a bit lower let's do the average at the end so it's equals list so it's a little out of hand uh after minus before now we would say print average is there like a one liner to some that were never used to be for I don't think bank results divided by the length of results average 0.224 okay for averaging probably it looks like around a quarter second for most of these about 0.25 ish a little more a little less but right around there less that time and then we'll switch to the pr version of the library so and go back down to take that delete it and then we can go to http server hpr list ghpr check out p58 copy the library here and here around this six for the average eight for the average I don't know we haven't seen any sub we haven't seen any where the average was sub 0.25 we're on the nose there but we saw like a 21 a couple two fours I don't know though I mean it's pretty random and the variance like there's a two zero in fact and we're on the new version so I don't know I think everything we're seeing there's a two three I think everything we're seeing is within kind of a uh what you call it what's the term I'm trying to think of like error error correct that's not the one six wow um that is so fast to serve a file over the wireless network literally sending ones and zeros through the air one twentieth of a second to send an entire html file same um I don't know I'm trying to blank but we're in within the random variance basically I think like maybe it's a hair faster maybe it's a hair slower either way unless you're like doing some hyper specific measurements and taking a whole lot of samples you're probably not gonna really tease out and answer one way or another to me it looks pretty darn close to the same uh one thing we could do maybe is let's just make sure we haven't gone and made a silly here let's do uh look for a change in the code and just like triple check the code that's on our device is the new version I would love to say I would love to be able to tell you that I have never accidentally tested something different than what I thought I was testing I definitely have what does it change to look for inside of a knit it will import query programs and form data the wrong place 54 yeah there it is okay we definitely on the new one I think we're pretty much the same let's try the new example so there's a new one for submitting post probably this new file yeah form data I'm interested in this one has his html in the python code flash form okay so we're gonna when we get to this we're gonna load it up in our browser with slash form instead of the root it's not using pull so we can't do this one that's fine though this well there you be used before posted value I see that past pilot it might be mad just because it doesn't get set to none okay yeah I'm a little surprised it doesn't fail pilot but we must not have that specific check or whatever like if you wanted if it was actually if it was actually complaining about it I think it would just be like we put a none here and then this will no longer be I do have auto reload off so I will start are still on port 80 but this time we are on slash form for stuff than I was expecting what all that we do here so we have three links which are on buttons just add get requests arguments then action post they look like once it's rendered though post type name is something so basically we could click one of the top buttons which is gonna set a form type up here and at the same time it gets substituted into here because gets put in with encode type and then it must do format right when it calls yeah here we go format I don't I've never seen I've never seen this version of format before interesting so you can go format you can give it named variables cool okay so if we submit something it'll get put into an h3 and stuck onto the page as well our subject has no data we kill it before or after we post it if the has no data request dot data dot get attribute data use self dot dot quest class somewhere in here will be request class data the body form data it's supposed to form data instead of data and then guess that's probably I have to restart it because I have auto reload off we have to restart it and then stop pressing ctrl c that pressing ctrl c then it keeps your program we don't really want to resubmit I kind of back there we go yeah form data we'll put this in the here before I forget so then when you submit when you submit it makes the post request to the back end so this is going to get called request that method's going to be post we're going to get the value from there specifically we're getting the something value which is going to match up with the name that is on our input right here so name something here means that we can pull out value something here and then in our case we put it inside this variable we tuck it into an h3 tag and it's stored as submitted value which means it gets put onto the page whereas when you know what's in okay okay okay okay I see I was just about to say you know what's interesting is why does it not show this part on the get request but this makes sense we have this tertiary or whatever this is called basically I guess it's just comprehension of if statement but it functions like a tertiary and javascript a little bit okay so let's try the other one so I did plain text that time let's do form data maybe let's try to trick it up a little bit with like some weird stuff in it make sure it's not going to try to like treat that as a oh interesting it did try to treat it as a as a an actual no it's still a byte string though I'm actually I'm really surprised that that rendered a I guess it ignored the B and the ignored the B and the single quote so we could theoretically give it an actual thing right back to form that makes a difference I'm not sure nice I don't know if that matters or not I guess it might be worth doing like escaping or so form data returns either a form data or none form data was up here the class I really I mean it's more of an implementation like your app should probably do the escaping versus the actual get though I am curious have any get but I guess it's because it does this one yeah okay I mean you could maybe add it into here I suppose it's ultimately like only could become problematic in this case where you are also taking whatever text the user gave you and inserting it into the html directly if you weren't doing that part of it then there would not be really any risk of people injecting html like this which feels like just kind of an application best practice more so than the library shouldn't let you because I would assume if you actually curious what does Django do I always compare this back to Django because that's what I have the most experience with does Django do any escaping of your post data or does it just let you any Ajax to get SVG graphics Django escapes all html signs who's outputting SVG it escapes if you serve it as a string by SVG equals XML which means you could serve it yeah in Django that's probably this is where this would take place in Django it would be in the template in Django this string would be inside of a template and you would use the render function with this template file and then by default any variables that are inside the template which is what this is are automatically escaped and if you don't if you want them to be unescaped then you need to use this inside of your template you would use it like this basically something like this in our case this is not actually like a template engine at all this is just a string and the format function so if we ever had a more fully featured template engine it probably would make sense that it would do the escaping when it's substituting stuff in in a similar way but in this example here I think it's not really worth changing anything I don't think we just keep this most people are probably not gonna think to inject anything on it anyway and you're running it on your own thing I end up changing here URL encoded this one may not this one might actually break it I don't know yeah because it got URL encoded it no longer no longer works so if you did if we did like back to the simpler one should have pluses or percent two f's or something oh interesting that's still oh was it back on plain I might have been black back on plain there we go okay pluses what is the difference between multipart and text plain I guess is it only to do with if you have more than one so if you have more than one input or is it the format that we are sending data through the back end okay yeah I recognize this this is like the boundary thing although it's interesting it's using this random to meanly random looking number as its boundary instead of the word boundary or anything else okay then this will be what that's this one okay the only so basically plain text is probably most similar to the top one URL encoded the difference being any characters that aren't URL safe got encoded so pluses and then plain text it gives you the exact same thing that you put in the middle one is definitely the most different what else did it say was changed form posting looks good to me multiple servers the header thing okay so if we run the multiple server example we should be able to see the headers from each one be different on x server and office and bedroom and office and bedroom will have different x server headers on two different ports you know which ones which though URLs also bedroom server is on 5000 so x server right here x server bedroom office 8000 this one right here below from the office x server office and then there's actually a third one for home which is on the bedroom server which is at port 5000 so that should also still get x server bedroom I think from data we looked at data example we looked at server headers we looked at doc strings are more reverse doc still built up with these random yellow lines I have no idea what the yellow sections are single see anything just like that on the live one there's a few hdp servers in the world no that is weird seems so random like sometimes it's multi lines sometimes it's single lines sometimes it's on the from inputs but this one doesn't so I don't really see any specific uh that have to do with the at signs maybe I'm not sure how to test that one is there a modified sample says headers access control allow all form data that's the new example multi server we looked at this should probably be either or like maybe one of these should be commented because right now it's going to try to do it twice isn't it it will fail for one of them it's because there's two different ones it's this neat or I just set the wrong URL I guess I went to the base URL but it should be maybe this one they get requests or this one that's expecting query primes okay we don't really have a form to post with so we would have to use uh something else to send a post to test that one could do this get us to here but by default it will be black which is off that would set it to yellow this one here and it does look like that's working okay that's looking mostly good to me the form data is really the only thing that I noticed that could use a tweak the timing I didn't really see anything that made me think it was for certain any slower so I'm guessing maybe you just had some likeiness on the wi-fi like you're saying that I know like at least with my wi-fi sometimes it's faster sometimes it's slower I definitely see that from day to day and even throughout the day at different times and stuff um I think we'll wrap it up here so thank you everybody for watching oh uh over in the youtube chat Jackson says I'm 3d printing a dark saber was just wondering if I could use normal led strips over the skinny ones if I kind of squash them in 3d printing the dark saber so I'm not familiar with that project specifically let me see is that a thing on here saber build um I would say the short answer definitely is that I do not know for certain my guess is that it may only have enough room for the skinny one but I don't know that for a fact but that is probably my guess so I would say probably if you are printing the files unmodified I would recommend probably trying to use the same strip the skinny strip um I can't say for certain there is maybe some chance that a bigger one would fit but I don't know and I would not be surprised if it didn't so to be on the safe side I would probably go with the same one that they quote in there the skinny one okay um I will wrap it up there thanks everybody for hanging out thanks for everyone in the chat um if you are interested in more content like this if you would like you can come back tomorrow morning I will be streaming over on my own channel FOMI guy underscore twitch I will put the links in the discord channel when I get started in the live broadcast chat channel um so yeah we'll be back tomorrow we'll be working on some more stuff I'm not entirely sure what is on the docket for tomorrow but I'm sure I'll find something interesting uh so join me then if you would like otherwise I will bid you farewell for now uh don't forget if you are a regular in circupython community we are uh taking the the uh the day off on Monday uh so no uh meeting on Monday so we'll be next week is our next meeting just a reminder on that but for everybody else I will see you later uh thanks for hanging out and I hope you all have a good evening good night