 one two one two hello everyone we're gonna take a couple of minutes just to get going and then we'll start and make sure that everything has started up okay why is it giving me restream is not too happy this says bitrate less than 4,000 oh for X I don't care I don't care about that pause my YouTube how's everyone doing it looks like everything's going okay let me know if there are any challenges I think we're gonna be at the mercy of the network weather internet like we were before and speaking of weather up here I now have a window cam which I was thinking about doing so I used to have cat cam there's no longer cat cam but now we have window cam and I'll talk about that a little bit because I'm quite excited I feel like I've upgraded my streaming setup a little bit and that's awesome first some hello so hello to DCD who says hello deep divers David in the YouTube chat also note taker so thank you hello Yanni hello unexpected maker hello hams labs football as well pretty good I think I'm the least sick of my family which means I feel okay but my partner and my son don't feel quite as well love the factory hello mark why can't I hear you oh you muted me yep that would do it just says hi from LA there was an earthquake 4.5 about 10 minutes ago did you feel it Jeff does that mean you felt it unexpected maker says this is cloudy skycam and I'm you know this is this is what we like to I would consider partly sunny which is not a bad thing when it comes to Seattle in the winter time I'll take pot I will take partly sunny I was like outside I took a walk I usually take a lot of lunch walk and it was like oh the sun feels so good on my skin I know it's it's summer where you are but it is not here and so this this partly sunny I will take never get used to them I feel yeah I felt I haven't felt an earthquake in a long time but we do have them here as well oh it looks like my audio my desktop audio is playing out of my speakers I'll just turn that off so you can't hear my my bloops hello see Grover and hello 80 cc Bob and beata I think I forgot to say beata welcome welcome welcome okay let's get going because I it's been more than a couple minutes so hello everyone my name is Scott I work on circuit Python for a to fruit you don't know what those things are circuit Python is a version of Python which is a programming language designed for designed for big well Python is is often used by beginners because it's designed to learn things as you need them which is super cool circuit Python is designed for beginners into hardware world so and it's designed to run on small computers called microcontrollers this is where I look at my desk and I say here's one so this is a metro oh I bumped my camera I think I might have just tried the HDMI cable to the cameras not too happy so that's what that's what happens here's a metro and zero so this little chip right here is the microcontroller they only cost you know a few cents to a few dollars they're a great way to get into a full-blown computer and it runs circuit Python on it the way that circuit Python normally works or often works is that you plug a USB cable in it shows up as a circuit pie drive and then you can edit your code right on the device I think I was telling somebody I was like the the idea that when you buy a device your code lives on it and you can edit it on the device it's just like mind-blowing from a like ownership standpoint too I think so that's circuit Python Adafruit this is an Adafruit board so Adafruit designs and this is a circuit board so when I say board I mean like printed circuit board where all these parts like the chips aren't made by Adafruit but they're kind of assembled into one unit that can then be used into bigger things as well or bigger projects and that's what Adafruit does and let me let me hold it right side up so Adafruit designs boards like this this is a Metro N0 express where you can purchase those at adafruit.com get yourself into hardware and using circuit Python and that supports me because I work for Adafruit and that's the YouTube channel that we're on as well so that's what circuit Python and Adafruit are I do deep dives deep dives usually happen 2 p.m. Pacific on Fridays which is right about now I I generally host them but I have Tim aka foamy guy who's my backup and has done is so helpful being able to keep deep dives rolling even when I was on paternity leave or like I was dealing with my my mom getting sick as well so thanks to Tim for being a backup on deep dives I know he does more Python level stuff but I hope that they're I hope that they're still like really fun and informative they tend to be about two hours long I am not known to be concise and if you know if you watch this before also I don't prepare a lot either so we kind of go where the wind takes us I generally am like work on what I've been working on on the stream but I'm also happy to answer questions so if you have questions I see Jeff has one there hello Gary Z feel free to drop them in the chat and I will talk about them try to answer them and that sort of thing so I'm happy to take questions you know we got two hours we can go off on tangents so this is I'm a core developer of circuit Python so under circuit underneath the Python level of circuit Python is actually a bunch of C code that interfaces with the low-level hardware to do things and so that's why it's called the deep dive is is that we're usually talking about C code and not actually Python code we're talking about how the Python level stuff is implemented under the hood so it is quite technical if you don't know concepts or have questions feel free to ask them I'm more than happy to go over the basics even if I've gone over the basics on previous deep dives so yes I Jeff has a question here who says we've talked about IDs and I guess you use sublime text are there circuit Python specific plugins that you that know what is and is not circuit Python or does everyone just use a Python language syntax completion others use different IDs so yeah generally the language part of circuit Python is going to match Python but what's going to be different is the modules so Python the language has this notion of stubs which are a way to tell tooling including IDEs like for given module what what function signatures there are so even if it can't give the whole implementation it can at least give you information about you know like digital in-out has a digital digital IO has a digital in-out class so circuit Python when we build we we we document the C implemented APIs in Python stubs and then we do package those and put them on PI PI so if you have an IDE that can use Python stubs to do better autocomplete and you can usually do pip install circuit Python dash stubs and then you'll get those in there was just a change that foamy guy that Justin started and foamy guy finished up that includes the board module and the board module is unique because it because it the board module varies per board because it includes pin names and bus names and stuff like that so you could take a look at that Zarnland is also pointing out on the discord that visual studio code has a somebody here has created a circuit Python extension that will do a lot of that for you so that's if you use VS code you could take a look at that I know that the stubs I think we're also tested in pie charm so and I think there is a learn guide a learn guide for that as well yeah so the board stubs are very very very new let me switch to let me let me just show you well I guess I'll talk the cameras a little bit since we're talking about something else but I can do full-screen window cam it's actually quite nice right now it was raining earlier but let's go to the desktop and I think I'll have to scooch this this is my my window that I look at off the screen so if we're just at learn data fruit com which is a great place to get started on projects you can search for pie charm and I think that it's actually in this welcome to circuit Python guide creating an editing code no new editor is what we recommend first Jeff says I still miss the kitty cam I know but the kiddies aren't here anymore I think under advanced setup there is pie charm and circuit Python so this is kind of like how you can set things up and I have not done this but somebody else has so if you use pie charm which is very popular Python editor you can take a look at that and let me just I'll just pop this right in the discord so I actually had this window open all the way from last week I've been doing a lot of the same work any other questions or should I talk about the improvements to my streaming setup that I've made a remote kitty cam I do actually have yeah we have Google home cameras at the house but I don't know if the cats sleep within range of those Zarnlin says I tried out pie charm but I'm afraid I'm addicted to visual studio code it's good I'm glad you found a tool you like so improvements says love the factory okay so I did a few things last week I had mentioned I would love to get love to find webcams that work better like I was talking about like the former the former kitty cam had this is good the roofer just emailed that's really good I was meaning to email him so the former kitty kitty cam was a c920 I think which is like an old logitech but like used to be super reliable but if you've watched before you know that I never could get it to work when I wanted it to work and so I let me just let me just pull up I went to the wire cutter because I love the wire cutter here's the best webcams one and I was like I need to try again because I really would like to have more more camera views one being the window cam to replace cat cam and one actually being a desk cam instead of the overhead cam David says we need to find a way to get the cats near the camera at home maybe a remote food distributor oh they would love that they would love that my partner is at home right now though so I'm not sure she'd like it like randomly the like noise there came noise and stuff so I was looking at their recommendations and the brioze 130 bucks and it's logitech and I didn't really because most of the time they're shrunk down and so and I'd stream at 1080p did you see that they reviewed wire cut it recently I did not that's kind of hilarious though hi Paul that I feel like that's what they won they should release on April Fool's Day like that would be a good April Fool's Day so the brio does 1080p which is kind of the max of what really what I care about but I decided that I didn't want to go it was a little pricier than I wanted because I'm not like the main camera here is really good because it's not actually a webcam it's like a sony zv1 so that one I don't need I don't need to replace the main one but if I could find a cheap one that I can move around so I actually went with these anchor power comp c 200 2k are your cams in Apple or Linux so it is in Linux and I'm using v4 l2 have encountered the issue with too many cams on the USB bus so right now I've got one two three four video streams coming in and I think they're all still working knock on one so I went with these anchor power comp c 200s because they're their budget pick and they can do up to 2k which I don't actually want to do 2k but one thing I was thinking is that I'd rather get a USB 3 a USB 3 capable webcam instead of a USB 2 1 so by knowing that it supports a high resolution I I'm pretty sure that it's like in USB 3 land instead of 2 so I went with these and then you can actually buy them refurbished off Amazon as well and so I actually they're like forty five dollars a piece off Amazon refurb so I got one tested it and originally it was weird I couldn't quite get it working in OBS but then I realized that I had it on the YUV setting but you can actually these cameras support H2 6 H264 encoding and once I switched to H264 encoding which is like super common and probably what this stream is being encoded with once I switched it to that I could do 1080p and it looks just fine or at least good enough so this main cam here and let me just I think I have so this this camera here is it's in so it has this like eye eye tracking mode so this is a really good one I really like this it's got great focus like it does eye tracking but it also has a product showcase mode so that's been really good that's been the same and now we have window cam which I just got like two days ago so this is one of these anchor cameras just look like literally just set up next to the window and it's getting nicer outside which is cool and then I also have a bench version so here we go and this is part of my bench and this is so this is the other anchor one and I have a version of that with the desktop so this is like if you want to see me like oh I press the button on so this is like the board I was testing with so you can kind of see there and then I also have the overhead which may or may not be working this one has a little more trouble and hopefully I won't crash so this is the this is a hover cam ultra eight that I've had for a while but sometimes it's less reliable unexpected maker says is the Sony running as a USB webcam or via HDMI it's going via HDMI so there's a I forget what the capture name is Magewell there's a Magewell USB 3 capture thing that is the HDMI for the camera for the Sony is running into so all that set up for two hours streaming awake and some show until presents were lucky well I didn't spend all that much with the new cameras the the final thing that I did is I actually bought a new graphics card I was running an Intel a770 but the I wasn't I was having a bug where if I'm like remote it in from home and then came in and turned my monitor on it the month like the screen wouldn't resume so like the Intel the Intel drivers are just not quite as polished as the AMD ones on Linux and so I I was tempted to get a 7600 XT Radeon but the reality is that because this is the anchor webcam I'll go back to the desktop this is the anchor it's the power comp C 200 2k is what I picked up I don't know if they're available in Australia but I mean we'll see how they do today but I think I'm optimistic so I ended up I didn't I realized I didn't actually need a high-end graphics card the the main reason I wanted a new graphics card is one this bug so that the screen would turn on but two doing the like offloading encoding and decoding to the graphics card would be nice and it hasn't worked with Intel through OBS kind of in a year or more but previously before the Intel I had used an older Radeon and so I actually bought an a Radeon 6600 which is basically the bottom of the the of the bottom or near the bottom of the previous year's line so it's not the newest one like the 7000 series is the newest so I got a 6600 to go in to go in here and it's been working pretty well so this stream is actually being encoded through that card which is great and hopefully it's helping with the like there's two at least two h264 streams coming in from the anchor webcams as well are they on the same USB host controller or different host controllers I don't actually know at least the hover cam the hover cam and the desk cam are on the same host controller because they're on the same USB hub let's just take a quick that's my let's just USB TV take a little bit of a gander so here's some USB see video coming in I don't know what what is the I get the names in here here's more UVC video but it's only 480 I don't know it's a good question David says it's weird how much pixelation your webcam is getting rest of the screen is fine so it's just the feed from the webcam this webcam is having pixelation I don't see it on my side is that in all views or just this one it could be the coding broken hipshot says yes that webcam huh it's showing up pixelated can I turn it on so I can see what you're seeing no it could be an encoding things sporadically all right well I'll take a look at the YouTube recording after the fact to see how it is yeah that's interesting I don't see it no BS but it could be you're moving in the webcam the screen is static the other says I seem to recall there's a bit in the USB video spec where the device announces its estimated bandwidth use and there were some free cameras mostly that didn't do this or did it badly I have no idea yeah I don't think they're all on the same host controller but I'm not positive the the Magewell and the window camera on plugs directly into the tower which may or may not mean they're on different house controllers hopefully they are I definitely wish they would be more forthcoming about how like which plugs were on the same host controller it Zarnlin says you said your face cam is HDMI capture is the capture itself a USB capture or a card like black magic it is a USB capture card or it's a USB capture device so it's got like a little short USB 3 cable that it hangs off of yeah interesting I wonder why that I'm getting a little pixelated okay and then there was one other question that I skipped over because it's a little bit unrelated Hams lab says speaking of cameras I asked a tech question about an Adafruit product a few days ago they haven't gotten an answer yet I'm using a spy camera from Raspberry Pi and I need to know what camera module it uses I'm using it with a rock-pie board and it's not working so getting specifics will be helpful can anyone help me I think that's the spy camera for Raspberry Pi is probably is that a Adafruit product or is it a so it is an Adafruit product it's not a Raspberry Pi one usually there will be notes there and sometimes sometimes there will be yeah a good question I don't know lady Ada probably knows but lady Ada probably knows but she's been pretty busy the last couple days so hopefully she'll go back to you when she's got more time mark says I should get a new webcam they're lately the only thing is reason to do it is coming on show and tell I had trouble with four USB cameras the model on the Raspberry Pi but good question if it's USB driver or streamer that was glitching actually now you're moving your web browser pages the pixelation is on that too so maybe it's OBS or your ISP feed yeah well the ISP looks like it's doing a lot better than it was like two weeks ago we were like getting like really low frame rates encoding issue I guess nothing horrible yeah so I might I might be able to tune my encoding settings unexpected maker says is your Sony the ZV-1 the model ZV-1 F or the ZV-2 it's old enough that it's not the two let me pull this off to the side and I will look I can look at my Amazon history so I know I bought it off Amazon so I'm just looking off-screen here I think it's the right yes the regular ZV-1 vlogging or digital version you know but I do have the screen flipped out so I can see it yeah sorry about the encoding I'll have to take a look I don't I guess I could tell you what my settings are but I don't really want to try changing them I'm doing Navi 23 constrained baseline level for 4,000 kilobytes per second and a two second interval so I guess I'm on the constrained baseline is the default which is going to be the most aggressive and then there's a main and a high as well so maybe next week I don't want to mess with it now but maybe next week before I start I'll give it a shot and maybe I can also do test recordings so I'll take a look there too so sorry well for now let's just go with it but next week I'll play around with a little bit this is just first test run yeah unexpected maker I don't think there was there was only one version when I bought it I've had it long enough but yeah but to me the focus of it has been great yeah the focus is the reason that I've been really liking it and I'm excited about finding these anchor ones as well because they seem to be working working out alright any other questions before I go over kind of what I've been working on slash get back to work and work on this more and I'm hoping the captions are working on YouTube as well and a 4k version yes I love the focus and I tracking thinking of getting one yeah I'm not I'm not worried about 4k but I do the newer ones also do USB 3 that directly that would be nice because the Magewell itself is a couple hundred dollars at least yeah and you know I'm happy to be how long you take to ship to USA and what our delivery charges oh to UK Mohammed I'm not sure I I'm in the U.S. and I haven't paid in a long time but actually there's probably folks maybe there's still some UK folks that are up and will be able to tell you you could also email support it if a different comm and hopefully they'd be able to tell you as well Tyeth says have you seen the Logitech reach I did briefly but yeah I see it's like $300 it was like way more expensive than what I wanted especially for like a view that most of the time will be up in the corner like up in the corner here it's like 480 by 270 like I don't need it I don't need it to be that yeah David Smurgs and YouTube also points out there are UK resellers of Adafruit products Pomerone is one and Darman points out another camera there broken hip shots says Pomerone and Pi Hut are other folks that you can take a look at and I'm sure Digikees and ships there too I don't know how that would compare there's they're also in the US okay so if folks have questions feel free to ask them when they when you have them I'll just like I like that question I'll try to do my best to answer them but I think what I'll do is I'll start talking about what I was working on before the stream so I talked about it before already but I was redoing I this is kind of where it was last week as well is I was re I redo redid a number of a number of the internals on the expressive chips to use the newer APIs that were added in the ESP IDF 5.0 and I talked about this last week I actually read so I will switch to the desktop and show this page so I actually read through this and started adding more so implementer's guide is a is a is a guide I'm working on and I remembered today that I mentioned I'd ask about doing this not off or I I would I would ask about moving it off of learn but I have I forgot to do that so that's something I'll still talk about I don't know I kind of I kind of do like it on learn but we'll see so I read over this I found some typos I've been fixing some of it and I've been adding to it earlier today and basically there's a number of modules that I need to retest because I changed the implementation and so while I'm retesting it I'm working on the implementer's guide so the implementer's guide is is the goal is to talk about how circuit python modules are implemented internally what some gotchas are and kind of like basic things to to that you can use to validate that it's working as expected so the one that I've been working on right before the stream is pulsio and pulsio is a module that is like trying to do microsecond level pulse capture in generation this is something that maybe if you're used to Arduino that you would just bit bang yourself where you'd write you would literally write Arduino code that sets a pin and then waits a few microseconds and then sets it low but circuit python makes that more difficult to do because one the VM takes longer to go from statement to statement like because there's no it's not pre-compiled and then also because python is dynamic memory whenever you're running code in in circuit python in micropython there's a risk that you will hit a case where an allocation is attempted but fails and when an allocate a memory allocation fails it goes through this process of collecting and sweeping away all of the the objects that are like no longer active it's like a GC collect and what that is doing is that it's it's finding all this it's finding all the spots in memory that it thought might be in use still and marking them explicitly is free so it can reuse that memory hi tomorrow oh yeah and tyeth i think tyeth is uk side um yeah unexpected maker says the logitech reach looks awesome from a usability point of view but not available yet yeah how many of these anchor ones can i buy for that price though too um tyeth says usually cheaper to go uk reseller or digikey free shipping over 33 pounds otherwise make sure to play with basket quantities more quantity sometimes equals less shipping in adafruit stores very as it varies a lot between 18 and 46 dollars uh david says the problem with uk resellers is that they cherry pick the products they follow and it takes time between availability on adafruit and availability on uk shops so if you want the latest products from adafruit you have to be lucky and wait but they sometimes have stock of old products or products not available anymore and after some time they will make a discount if they don't want to keep following a product uh yeah so that i think that's typically like downsides or resellers is that uh resellers i think pretty much can buy from adafruit once it's listed on the shop um and in fact i think sometimes they actually limit resellers for the first batch or two um so yeah the if you want something new you're going to have to get it from adafruit but um but yeah for for stuff that's been out a while resellers can be the way to go um okay so um so pulse out and in are the things that i've been working on testing and um specifically i've been trying to get pulse in working and what i realize is that i could test pulse in with pwm out um and then there's uh once i can kind of confirm that pulse in is working then i can use pulse out connected to a pulse in to like verify that pulse out is working as well so it makes sense um so that that that's what i've been doing right now i got it working one thing i've been running into is that the new esp idf apis taken these config structs um and when i kind of like sketched out all the code i didn't fill those structs out enough so what's happening is when i run the code it doesn't actually run it throws in the idf throws an error um yeah davis is i gave up waiting for the eight byte trellis to ever come back into stock the eight by eight like rubber button trellis yeah i mean the last two years have been really really bad for keeping things in stock just from the like chip shortage and related stuff um i think we're finally getting through those weeds but um yeah if you ever are waiting for something to come in stock uh ate a fruit make sure that your email is signed up uh to be notified because we actually will like prioritize like use that as a like rough signal for like what we should get back in stock yeah those eight byte trellises are cool i've been meaning to get back to that i want to do like fake fake sense stuff at some point um okay so let's just do the pulse in testing i was doing so here's the test program that i was doing be about pulse length um so this is this is how i'm using um pwm out to test pulse in so let me let me switch to my bench cam or i can use my overhead cam actually overhead cams like on the right spot so this is the board i'm using um and come on all right let me lock the focus okay so now with my hand there it shouldn't shouldn't change um or not i can't see if it's okay so this is just an esp dev kit m i have this label on here that it's an s3 you can't read it it's an s3 mini n8 so it doesn't have any ps ram but i when i'm doing esp work i love their new dev boards that have the dual usb and the reason that i love that is because i have debug prints coming out oh you know what it's focused on my chair isn't it um okay so maybe you can read it although it's probably upside down which i can also do so that's the way i'm seeing it so uh these dev kits from espresso they they like to me they finally found a format that's great um these dual usb ones are awesome when they first released the s2 um which was their first chip with native usb um they only broke out the non-native usb so i had to make um i made this like board that went kind of on on the other pins and broke out the native usb um but they pretty quickly came up with this design where one of these usb's is to the native usb of the esp and one of these is to an external serial to a ur converter um and it's great for doing low-level circuit python development because uh out the ur you can well yeah out the ur you can read the debug output um so if you do a debug equals one build of circuit python it will automatically output all of the idf logging to the ur so that's great and then the other one is native usb and um the native usb port switches modes depending on whether it's in the bootloader or not um so you can leave kind of everything connected and switch between bootloader and circuit python um and i'll i'll show you that so um here now my windows got all messed up and this has the this is has my desk cam and set maybe maybe i'll switch that let's turn off bench cam and that leaves hover cam hover cam is tiny hi dashipu we want um um what was it 270 by 480 i was just doing this there we go um all right with memento you can make an auto autofocus camera all right so um the setup that i have here is and this is kind of like been rotated a bunch i accidentally closed the main one anyway so this is the esp logging so this is coming out the ur at line this is the uh circuit python logging or the circuit python serial connection and then this one is the the one where i actually build and so right now you can see that circuit python is disconnected because if we look down here it should be in bootloader mode um um and i don't know it looks like it didn't start which is weird so i will um so i'm using the boot button and the reset button to put it back into bootloader mode and it shouldn't wait and then i will flash it it seems weird it says it's waiting for download did i bump it check the port and see if it's correct okay so it's only it's not seeing maybe i bumped it oh it just blinked like it was running circuit python yeah so maybe it bumped um so there that looks better zoneman says my memento my memento is here but just not unpacked it yet this saturday i will do a mail call on my channel where i unpack all my new ate a fruit goodies nice feel free to post a link to that or when you start streaming feel free to drop a link in my broadcast chat that you're doing it it's totally okay to invite other other people okay so loaded the new firmware and i'm going to hit the reset button and this is why i feel like showing the overhead is kind of helpful so it auto connects the wi-fi and then um wait the serial link actually came up too late to see the output um but i have some debugging output here for the durations of duration zero is 250 and duration one is 750 um but if i rerun it we'll see we're getting 750 and zero and the zero is not correct um what we should actually be seeing is 250 and 750 come in um we should see 250 and 750 as the the first two pulses now what i had forgotten like the main use of pulse in is to read infrared signals so there are infrared receivers that will output the pulses of um does the memento do that crazy thing if you drop it in a bottle of pop i don't think so i think that's only um um can't i forget the name of them yeah i know what you i think i know what you're getting at i forget what they're called the um yeah so so what looks like to me is that this is correct in my debugging printing but it's not putting the right values in the output buffer for some reason so this is the thing that i'm trying to fix now what i'm trying to do is run it in this mode that i'm that i had forgotten about so usually it's infrared or DHT sensors where with DHT sensors you'll you'll drop it down and then um started up again uh you like drop the line down and then wait and it sends the data back to you with a series of pulses um which is why pulse in has this resume function that will actually do that like actually command the line for a little while um for the DHT sensors but there's also this mode that i would that i kind of forgotten about honestly which i have been thinking about this afternoon is free running mode so a pulse is half of a wave or pulse half of a pulse really because it's the high portion and then the it's the time of the high portion and followed by the time of the low portion so with this test we're we're having just two we say max length max length is two by default so the the position zero is the high pulse and the position one is the low pulse and if you've ever done servo work when you output to a servo you do a PWM and you change the duty cycle so this pulse in free running mode allows you to basically read back duty cycle stuff um so if you wanted to be on the other end of like a servo this is kind of what you would do where you don't care about a series of pulses you just care about the duration of the the like last pulse that you've got uh mentos that's what i'm thinking of or that's what david's alluding to and i've forgotten thank you sir um yeah i've been to make your fair i've seen him do that um so what i'm trying to test here is free running mode so PWM in should be like constantly updating those two positions of the pulse in um and it is not in terms of uh percentage it's in terms of microseconds so pulse in and pulse out have microseconds as they're kind of like unit um although the the accuracy may be like a few microseconds not just one in the code that i'm doing here it's actually a two it's a two microsecond resolution because the RMT which is the peripheral i'm using which is short for remote it's like designed for infrared remotes it is uh it's 15 bits even though uh our pulse in stuff is 16 bit so by running it at basically two microseconds per value we get like our full range our full normal range electronic enigma zone is darlin's channel um okay so the question is is like is why is this not right um why are we getting the 750 and actually now that i think about it so let's look at the implementation so um the implementation of stuff like this is in so we're in there's all these build folders but it's circuit python ports expressive common how and then all of the different modules so we're in pulse io pulse in and actually my guess is that um so the RMT API for IDF 5 has this callback that says um hey i'm done receiving a pulse train so it's it doesn't quite work for this uh this free running use case because it actually like overflows dcd says what do you see on the logic analyzer i realize that you're confident that pwm is okay um i could do that if we felt confident that usb is not going to completely fall over um do you want to try to do that i'm a little worried because the i think that the salient tries to grab a lot of um i think the salient tries to grab a lot of uh a lot of bandwidth on the usb bus so i'm a little scared um but yeah so what we should see is what we should see is like the pwm starts and right now it's on a quarter it's it's it's a i have it as a at a kilohertz frequency so um you're going to see a pulse every 1000 pulses per second um and the resolution should well we're gonna the resolution that we can input is at a microsecond level so we should be able to go from zero to a thousand um that we should be able to measure with pulse in so right now it's set to 250 so it's going to be high for 250 and then low for 750 of that and then it'll just repeat and i haven't just running for a little while um so that i don't trigger the overflow stuff um so the rmt is not actually going to give us results until we get to the end of um until we turn the pwm off and those signals low for a longer period of time um tyus says you make me think of the usb card of death that i recently read about on the register for testing windows usb stack and hotpoint support yeah oh zerman that's not a bad idea the sigrock analyzer i used for signal acquisition i put on this a dedicated pie you know maybe that's the next upgrade for my bench honestly um is splitting it out into a separate computer that's not that bad of an idea it would be hard to share on stream but it's not a bad idea and in fact i actually have a i have an oscilloscope here that maybe that's what i do i could point the desk cam to my oscilloscope and then show that we want to try that i don't know how how far into the setup stuff we want to go but um that's one thing they could do is try to use um use the oscilloscope i send the pie output to a capture card that's in obs uh yeah we could try to do um we could try to do it with the oscilloscope too but the idea is that in this guide i'm kind of building up module by module so yeah like i want to assume that pwm out is correct um because i have code in there already that that you could like confirm that that is um okay so i'm gonna add a little more logging is what i wanted to know so i'm curious about the number of total symbols so symbol count because i would expect more than just the one symbol so the rmt considers symbols to be kind of a pair of pulses um and they can be um they have a 15 bit duration a one bit polarity and then another 15 bits and another one one bit polarity um and if um at the end of the pulse train they set the duration to zero which is invalid um you can't have a zero length level basically so that that's a signal that like you you hit this like idle period long enough that that you're done so you know it's designed for remote so remotes are gonna give you i don't know like 50 to 70 pulses and then nothing for a while so that's what it's designed to do this free running mode is kind of like a hack and then i'm gonna have to check out your channels on them you've got it sounds like you've got a more detailed setup than i have two capture systems a black magic for the camera and the usb3 capture for anything on the bench i want to capture their output okay so i'm curious about symbol count and then this position here ah this is why it's messed up so position isn't recalculated so it's positioned here once and then not again so um that's my bug so let's rebuild and check so because i'm changing circuit by then code i can just do the flash command if you if sometimes i will put debug code in the espidf and to do that you have to do a clean and flash because the the two build systems are kind of disjoint oh love the factory says with usb host support now in circuit python is barcode keyboard to serial conversion easy i haven't tried it but i have a shelf on and maybe maybe that's what i should do i have a you can't see i'm pointing oh and i bumped my camera this this like hdmi cable became very touchy which is bad i gotta figure out why maybe it's just like slightly too long but i have over here i have a shelf that has a bunch of usb stuff i intend on testing with usb host and i have a barcode reader there that i've been reading to um and i've been meaning to test so i haven't tried it but yeah it should be easy so circuit python with usb host will um automatically support keyboards um in theory so you can give that a try and dishipu points out that there's a qr code library that works with the camera as well barcode your way to code.py file oh dcd says reading the code to find the bug avoided the scope logic analyzer good question uh zarland says when you run the esp32 is sdk configuration tool instead of value is that value written to the mcu or is it stored in the build tree so when compiled and uploaded it then takes effect yeah so the the menu config i don't know if i showed this um but the menu config command which i assume is what you're talking about this thing um is uh yeah in tree it edits your sdk config which then gets propagated into the ibf at build time so it is not it is not dynamic it is at build time and in fact i found it did i find it yeah i'm not sure i wasn't sure i spent a lot of the week debugging why the matrix portal didn't work um which i finally got it working so i have updated protomatter so rgb matrix is kind of done which is good um circuit python does a little bit more complicated thing where we try to keep track of um sdk configs for different flash variants and ram variants and different main chips um so we have like a post process that will take the output sdk config and kind of like split it amongst all of our different sdk configs again um but it's still is build time that that it applies um what we do when we build is we give like if we have you know five different options like we'll have five different sdk configs that we set as defaults and the esp machinery will glom them back back together so let's uh let's hit the reset button and we'll give it a try and see if we get better output or the the output we expect so let's just here and we got 250 750 250 750 270 i'm wondering if we could get it swapped but i'm not sure i think that's working right donlan says if the Motorola symbol barcode scanner is any clue it converts the barcode to a stream of key codes that software has to interpret it it depends on barcodes like 128 a or 37 so if the key codes are not translated in the same way that normal key keyboards are translated um then it won't work by default but you still should be able to write a python level driver for it um yeah mark says the most the barcode readers i dealt with would act as a keyboard and type code for you so if in circuit python with usb host if you just um i don't know if it ends in the new line but um it should auto configure it and then um and then you should just be able to do input parentheses in the same way that like it was waiting for serial input because you with usb host we automatically convert um key presses on keyboards to characters into the serial stream um mark says he used to work for the lottery with lots of barcodes and be honest as i was wondering if that was getting work done okay so this looks like it's working these are these errors are a red herring uh for the neopixel output so i'm not worried about those um and otherwise we got what we wanted simple count is one which is not surprising and we got the two durations 250 and 750 so i think that's all good um that is what i would expect now i'm going to leave the debugging in and i want to make it a little harder so now i want to test pulse out into a pulse in so i'm going to take my code up high which i have lost i guess i could pull it back out so code up high and actually maybe what i want to do is let's just try like 800 and just confirm that oh see so that's interesting because now it's 200 800 and now the level has swapped so this is this is a problem yeah this is perfect this is a problem that i was needing to document so um yeah that's interesting that it came in that way it gave us an error that that symbols were truncated um but i think we need to pay a little bit close attention to um order that they come in this is kind of annoying because we're only getting one symbol i wonder if we need to set a minimum number of symbols because ideally what i would do is i would get two symbols and if the if it starts with a zero but i'm looking for a one i just skip that first one take them next one and then the next zero and and i'd be aligned um so this is this is an interesting api design tradeoff that is really obvious between the way that the underlying rmt espidf works and the way pulse in works so pulse in says i promise you the first pulse is not your idle value so it's high and the second one will be low and and they'll alternate um whereas in the rmt world they actually like tell you what the the polarity was was it one or zero um they don't have to do that synchronization because they provide whether it was lower high but we don't and so i actually need to be a little bit more specific so i think one thing i need to do is i need to be okay like ideally i would get where i got one symbol so symbol is a low pulse on a high pulse maybe in different orders i want to say i want a minimum of two because i might because i might um drop the first one so raw symbol size uh this is the minimum of the max length divided by two but i so my guess is raw symbol size is one and that's why the error is happening esp log i tag raw symbol size present d and that's going to be in terms of bytes possible size but i think i want max length which is going to be two max length divided by two plus one i guess what i want so let's give that another shot pdf you use to switch between hidden keyboard and other modes okay so we're just about written let's reset and hopefully we'll get two in here now we'll get two symbols instead of one and i guess we could use max to do it too let's just yeah so here's symbol count is two symbol count is two but we only printed out one which is weird so we didn't go around the loop twice but maybe that second symbol was like a symbol count pause if we're out of space that we oh you know what we don't want to do that i changed that because we because we want to support free running mode good night hands labs or have a good nap naps are awesome i don't fault you at all i hope to take one tomorrow i usually take one saturday afternoon when arie's sleeping all right let's try it again it's possible yeah it's possible that so i need to be i need to if i'm waiting for the first pulse i have to skip the zero the zero that i can end um let's look in more detail at what i've got pulse and construct so there's there's this idle state start length paused and i think we need to like say find first find first equals true and then for resuming we also need it and that here and our handler and espi 5.1 simplified some of the code for led control instead of p strip a set pixel it's now just led strip set pixel i haven't looked at that i'm doing rmt level pixel stuff so i yeah i've already done neopixel i've already swapped neopixel to the new rmt stuff too and this one's working i tested it now this is something i did at home because arie was a bit sick last week so i was at home some and i was doing testing i have these big two big front windows and i have neopixel strips that run all the way around of them and i'm using a feather s2 to do it and i was seeing a lot of flickering of the colors and i was hoping that the new rmt stuff would fix that but it doesn't and i think it's because the s2 is single core and it's doesn't have dma to the rmt so like rmt is like super inefficient for like things like neopixels because it takes one bit and it produces it takes in 32 bits to produce the one bit so like it's really like memory intensive to like expand it all out and so what the idf is doing under the hood is that you give it a buffer and the transformer for from data to data to rmt symbols and then as it needs to fill the buffer it will do an interrupt and call the interrupt and then right to the like fill back up the buffer at the rmt and the problem with that is that especially in the s2 where it's single core if you have any wi-fi going on it may it may prevent that update process for the rmt from happening whereas on the s3 you have a second core so as long as it's the second core that's doing that conversion process you're hopefully okay and then on the on the s3 also you can do dma to the rmt as well so if you have dma you can do a bunch of conversions use more memory and then set the dma controller to do the copying for you instead but yeah so it's been on kind of my to-do list to verify that like i i i submitted an order to ate a fruit to get like a kind of a neopixel test set up up in up in this space as well so that i can test like a strict i got one of the high density like half meters so it's like 165 neopixels and half a meter so that i can just test test neopixel like i can test it with one but i can't really see the flickering with one because you don't run into i guess you do but you don't really run into this problem of like having to go through a lot of buffers on the on the rmt so yeah that's one thing i was worried about last week okay i almost went way in the weeds on the epixel but i think i've gotten myself a little bit out of it so i'm going to reset and let's see if we can't um i guess i didn't finish writing the code i didn't write us a code did i actually compile it i don't even know uh so yeah so we are seeing the symbol count too and this is exactly what i wanted to see was i wanted to see that okay now i'm getting two symbols and if i'm looking for the if i so i haven't added this yet but what i'll do is the first time i'm through that loop i'll say am i looking to find the first thing if i am double check that it's the right um polarity and if it's not keep going and now you found it so that's what i need to add now so that because because pulsing needs to verify like the looking at the output in circuit python it should be 800 200 not 200 800 um and that's because we're like we're just not timing it right to catch catch it are you getting some of those new strips that puts neopixels on both sides of the strip i did not order those ones i ordered the i was looking for the like highest density at the lowest cost which is silly because i don't actually pay for it um these are the ones the new ones you're talking about these double sided ones but i got the um neopixel i'll say i think it's 165 um these are the led per meter silicone bead led strips um so they're you can see i just ordered it they're like super short but they're like super high density so it's it's 332 per meter but this is only half a meter so it's it's 65 um 165 miniature neopixels crammed together um and so it's nice and small but it gives me that density uh to test kind of like the longer transmission stuff so um yeah that should come i guess it didn't ship out today so it'll come next week um from java plumber channel 12 bolts for long strips is better than five i don't think it's an electronics thing i think it is actually like a i think it is actually like a a signal problem from the from the host controller um i've been meaning to test the the esp 32 and the s3 are both should both be better because they're dual core so i do want to take a look at that and in fact on the s3 we run circuit python on a different core from the wi-fi but i'm not sure we have that set up correctly in the esp 32 either um anyway i'm in esp weeds obviously um and i'm trying to like get myself a bit back to being rooted in um the issues so i'm trying to be more diligent about just getting these uh these tests right okay so let's this test that we have is not working because we're not getting the right uh durations back um so what we need to do is we need to update this so okay we need to say if self dot find first and symbol dot level is not equal or is equal to the negation of self idle level idle state then we then we found it i guess we can do the break as well but that would be weird we'll just ignore that and then we say self find first and we need to do the same thing this loop is a little weird um although i think we can safely say we can safely say that if if it gets down here self dot find first is also going to be false so if we skip the first symbol because it's not the right state we can assume that the second one is so i think that's okay there's a possibility that we're not there and then we just need to ignore it still but i think that's right um darlin says are you saying that this is a problem in the s2 but not so much in the s3 i thought the s3 had a dedicated led pin for fast speed um yeah so i think the problem is in the s2 more than the s3 um and uh the s3 has a dedicated led pin for fast speed i don't i think the dedicated pin is using this rmt peripheral uh lemur had when i was working on this earlier in the week lemur gave me a good pointer of looking at how w led works which is a very popular um standard firmware for doing led stuff and it's usually on the sp32 and they use the rmt peripheral but they also have a couple other peripherals they used to do it too because they're trying to get maximum output pins whereas we don't actually care well there are four i think there are four transmit channels on the rmt so you'd be able to do four four neopixels concurrently although right now in circuit python neopixel writing is blocking um so they would actually share um so you do multiple pins you it just takes a little you can't do them you can't update them concurrently david says shouldn't you try your python test code on a known working platform to verify the expected result as a reference probably i am terrible at testing though and i'm like because the numbers coming in are correct and if we look at the output levels that the rmt is giving us they are expected to i'm not too worried and this is a this is something i need to add in that doc about like gotchas of like making sure that you get the right pulse at the start um is a is a gotcha of pulse in so uh yeah so we load it again and let's just hit reset so it's actually connecting the wi-fi and then it ran but we didn't see the output but now we can see that well that symbol had one but then this symbol again did the 200 800 but we don't actually know whether it was right oh look at that that's not right either oh great um in this case we got 800 800 which is strange so that so it's still not working my code is not right uh i don't claim to write correct code especially the first time so why is that not working um it's probably because we're not this we need to say if not find first or so the or applies if the first one was false or the symbol level is not is equal to the opposite of the idle state then we do it okay so i think the second time we were going through we were we were still find first false and that you may wonder how i came up with that and that's just experience like knowing that my negation's got wrong like that test was wrong is just just it was something that comes easier with experience and i'm this i'm talking like it's correct but i haven't actually tested it yet um but yeah don't feel bad if you don't have that intuition about what what the problem could be but this is like this is what details are kind of about like this is how i work this is literally what i was doing like the same workflow process is what i was doing when i was testing this earlier 800 200 and that is true even though if we look here we got the 200 first so it is actually correct now great okay so now that we've fixed that issue find our code dot pi i'm going to squirrel it away before we uh and put it in this guide so let's put it here so this is the learn and this is like basically the same editor you get on a different playground which is super cool um so we'll just drop it in a code box and we'll say it's python put up here so if you don't know i should shout out a different playground because it's really cool um so ate a fruit playground is this um it's kind of the same code that runs learn but it's a place for us that work for a fruit but also other people to put um kind of like less polished information where learn guides there's like a certain bar that we try to uphold in terms of like you know it's kind of like an end-to-end project but there's some like um there's also some like leads to take them other places uh but the ate a fruit playground you know is kind of like learn um and this was a really cool tip that i just saw um i saw it on the ate a fruit blog actually but fed a to who is sometimes around but i don't think popped up today did this really cool post about how to fail with circuit python and gives this tip of using um using supervisor set next code file and then saying reload on error um which is really um which is really interesting um as a way of like usually circuit python will when it crashes it stops but this is a way to tell circuit python when you crash just run me again which i thought was really clever and a perfect use of um in every playground um the one that i like the only one i've written up are these uh custom storage boxes that i still like have been raving about uh to people um so if you need a way to store a lot of dev boards this is my go-to uh go-to way of doing it and in fact now that we have bench cam maybe i should take video of me folding some of them because i have a a box full of boxes that i need to fold um marx says i somehow broke one of my playground pages earlier this week fixed now i'm not sure what happened so if you do run into issues playground is very new um so if you do find find issues let me know um because we can pull in some of the other devs uh if things happen there was there was a beef moment where like people lost all their work uh like really early on uh when it was there like i did mine on November 1st so like right around no early November there was a couple cases where things got lost but um but now i think it's really cool they're like making it uh more visible and they've got these badges now by love by Adafruit which kind of promotes them so um those are cool faster sd writes with esp32 and stio so highly recommend as a way to uh marx says support helped fix it yeah i'm sure they brought in the right people um okay so let's go back so it the editor is very similar like it's a lot of the same stuff that learn guides use internally um so let's do a markdown so pulse in most basic mode is free running rug you want to measure to continuously measure the duration of two pulse components you can use a pwm i o pwm out to verify this is working tamon says oh yeah that's a great tip actually um one reason why i'm sometimes afraid of using circuit python for unattended little projects that i just want to keep going if they hit edge cases that i didn't anticipate but also probably don't care much about yeah and then it'll be interesting to see a follow-up because you can use that mechanic to actually you could have an error dot pi so you could say net sex set next code file error dot pi and then there's a way to read the string value of the error so you could write it to like an sd card and then loop back around again um back to your code dot pi if you want to if you wanted to do some logging like that i don't think somebody's done it but i think it's technically possible um another thing you could do using that is like ota python files so like you could say i'm gonna run this thing i downloaded from my trusted source for python files um and if it errors i want to go back to the script that downloads it for example um there's all sorts of stuff you can do with that and that set next code file was actually created by a community member not by an adafruit funded person um so it's a little weird and it hasn't been documented very well but i think it is like super powerful okay so test rerunning pulse is most basic mode is rerunning mode where you want to continuously measure the duration of two pulse components you can use pw amount to verify this is working make sure that the first duration uh matches the length duration of the fuller of the first non idle pulse uh this is this is like so in the weeds but that's what this is about so we'll drag this to the top and there we go tyus says is there something like safe mode dot pi that can be used in events of hard falls so you can restart this the micro controller from safe mode dot pi i think to get back to normal mode i don't think you can you won't be able to set um um you won't be able to set the uh is that true i don't think i think you safe mode dot pi you can actually get uh cause it to escape um i think you can go get out of safe mode from safe mode dot pi uh david says you can use that mechanism to have your project run and in a loop on a silly error at the beginning of the code and you get a hard time to stop it so only enable that once you know most of your code is working yes and that's why it's not that's why it doesn't work that way by default and does that run if a c pi hard fault happens i thought safe mode dot pi would run if a hard fault happens i think you can escape it if you really want to like you can get you can get from safe mode dot pi to like out of safe mode out of safe mode i think dan's guide probably covers that like he wrote a learn uh safe mode circuit by the safe mode safe mode reasons so you can you can detect from your safe mode dot pi why you got into safe mode um you can get into programmatic safe mode you can do manual safe mode and then safe mode dot pi doing a reset and safe mode you can do you can okay so you can do a full reset if you want to get back into non-safe mode um you can do conditional resetting so you can you can check the reason first um yeah so this is a good guide for safe mode for sure i would love to see more like that for how to do simple error handling setups or cases where you just want to keep chugging as much as possible without writing the code itself to all all too airy handy handily yeah logging the edge cases the sd card would be rad sounds like that could actually be a useful core edition i've thought about it i've thought about doing more debugging to sd cards from the core particularly for like somebody comes to us and says after three hours my esp crashed and it's like i don't want to run something for three hours to be able to catch that so i've been debating it a bit i think you know at least on esp where we have this ur output it might be best to just have the ur output going this like some sort of like spark fun has these open logs that they've had forever um like but you could totally just make uh any circuit by the number to do it to where you just like read the ur input and you write it to an sd card um like it's super basic but it's a great idea like these have these open logs so it's just like you just spit out serial to it and then it logs it to the sd card for you um tya says is there a way to retrieve the previous back trace on reboot there is not so if you hit a hard fault you're not going to get a back trace unfortunately um you can get the back trace if you're if it's caught if your program ends due to an exception but you can't a python exception uh if you're running circuit python debug mode for esp 32 uh there will be a back trace that goes out that you are which is what i i guess i didn't show that but um that's definitely some something i've been doing a lot of but you know like that sort of thing is interesting i think the idea with hard fault with with safe mode and specifically hard faults is like we don't know if memory is correct anymore so like do even doing a back traces potentially risky um i don't know there is an open issue for like how do we have better debugging for stuff like that open log Artemis i didn't realize they had a new version hmm i wonder if they're doing it because they could do at some point you're going to be bottlenecked on the sd card too with sd i meant more just any available flash storage worst case the internal flat file system yeah that's something we're thinking about had to decode a back trace this week and and to have that shoved an nvm and displayed next reboot would be next level yeah i mean i'm a little torn between like having circuit by then do it all on its own versus just fitting it out like and especially if it's reproducible then you can have it just spit out the ur and then decode it yeah log rotation yeah the problem is that yeah it's i was thinking about more general logging to like a well-known place like like the external open log would would give you just like all the logs um whereas like if you're circuit by them we could do like an in-memory buffer that only on crashes gets written out but even then you're likely doing you probably want printf debugging and if you want printf debugging you're going to be printfing to this buffer that you're not even seeing and printf is slow um so i don't know it's something i'm thinking about but i haven't decided on like the the direction that i want to take it um so yeah if you have ideas let me know or implement them any anything you want to implement in this space like ask ask first but i'm happy to happy to merge stuff in um okay so we have 20 minutes left so let's just um now that we save this off let's actually uh switch from pwmio to pulseio um so instead of pwm out let's do pulse out and then we don't give it duty cycle and we don't give it frequency unless we want a carrier so yeah we don't want a carrier right now um that's right so for infrared you need a carrier but if you set ff ff you don't get a carrier so no carrier for now um and we don't need to do this anymore because we're not gonna do like free running mode instead we're gonna do and you know what i found an example because it like the docs do have simple cases that i already did so here we're gonna do out send pulses and i'm gonna do a lot shorter pulses i want to do like 200 100 um let's push the 20 10 i'm trying to i'm trying to make it like slightly like different numbers 70 suggest this on off so we're gonna send that no carrier and let's um for pulse and let's say max length equals six so we're gonna send five pulses we're gonna say our max length is sixth and um what we could do instead is we can do while in i think and then we can print in pop left let's get a little wild so this is the other way that you can use pulse in where it's um it removes the oldest one and makes more room can they be weird numbers like 13 or 47 yeah they should be able to 47 and 13 let's try that um it should be microsecond level but um the implementation is gonna do even numbers um so we don't need to do a rebuild because this is python so let's just hit save and hope that it oh cancel so we need to mount it comes up and i know i'm behind on discord i'll look in just a second save okay so i think it ran too quickly um so the reset port happened before we got our signals back in so let's um we were a little too aggressive so let's say i equals zero and we'll count we'll count so i plus equals one and then we'll say you know we're waiting for five of them pop from an empty pulse in okay so we actually need to wait for it too so we're we're getting faster than the transmit so we should say while not in pass so that should cause us to wait there we go okay uh gun look down the route of boot dot jason safe one jason and errors jason could apply someone says yeah i think it's different use cases you already if you want full varroa logging log file more for fatal crashes that are rare and intermittent yeah i would think about implementing that if you're open to the idea yeah for sure and in fact um we have an issue for it where we're talking about better logging but yeah there is one i just forget what it is zornlin says uh why are the numbers 202 instead of 248 instead of 47 so there is it is a little lossy um it's not gonna be perfect it's not going to be perfect so it's microsecond resolution resolution or units but um it's not exactly spot on so this is actually quite good um and then we should be looking at the i'm taking it off screen um so we did 200 147 so the 47 is not going to work because um internally we're basically dropping that one's place like the one bit so on the way out it's going to be an even number or no on the way in it's going to be an even number um and so yeah there's just a little wiggle room it's not going to be perfect and in fact uh for like infrared remotes it's like within tens of microseconds is just fine um so even though it's the unit is microseconds the accuracy is not going to be exactly one microsecond um so i'm actually quite pleased that they're within plus or minus two um like that's still quite good that's more than enough more than enough for um for what we're doing it is also interesting to me that they got a there are two others two other pulses that it came in um which doesn't seem right to me because the pulse in should so the 72 is the last high and then there's one really long but that's reset port still happening at off screen so what i'm looking for here is trying to figure out um raw size symbol raw size is 16 so we got 202 148 1472 all good but then we got these other two pulses but we got these other two pulses after we had started resetting pins and if you reset the pins on the outside of the chip basically you can cause internal signals to change and so like these are noise i wonder um let's just do while in let's do another print uh let's just say extra extra pulses there shouldn't be any print in the underscore is because regular in is a keyword so let's take a look here so we got one extra pulse for a pulse that's like as long as it should get which is not the end of the world but we really shouldn't i guess we shouldn't do that so that's caused by um this zero here that zero is saying um um like like the underlying rmt has an idle and maybe this is all right we could just set find first again when that happens and it would ignore so let's do let's do this test dcd says interesting 16 bit number zero x f f f that's right um so the durations are 16 bit microsecond integer they're 16 bit in unsigned integers that represent microseconds so for any pulse that goes higher than that range like the 65 milliseconds it gets capped um at the at the maximum uh number and you could see that in here well the the rmt is doing it itself but i think um actually let's take this i wonder if we should i think it's fine i think it's fine to have that extra one um but what we don't want is to see another low one we want to set find first we want to make sure that the next like if we hit that state of like it's low for a long time and then we read again we want to make sure that we're reading um the next pulse so um let's just do a second read let's just do this again and we'll just do like one one what's a number that's different enough like 155 pulse and now we want to do this again actually you know what we could just do um wait for that pulse to come in print it and then print the rest so we just want to make sure that like we're not having extra pulses that would mess up logic that's kind of keeping track of which one's high and which one's low which i think is this is correct so um so this is right what if you change max length to five it should still work with five although maybe it'll get dropped that's a good question um but max length you know i think it might air no it didn't air i wonder if it should air i wonder what we should do is we should make max length forced to be even um and that way you're even if you're overwriting you're not not toggling or you're always if it's even you're all you always know the zero thing is going to be um the right polarity which i think is what you would want and that's not that's a that's a change to shared bindings so let's just do that i think it makes sense to me pulse io pulse in all right folks have any other questions now is a good time max length maximum number of pulse durations to store at once must be even pulse polarity is consistent make sense pulse polarity is it's a little weird like it defaults to i don't know if we have a validator that you know what instead of validating we could round it but no i think i'll do that um if size t max length this and then i wonder if there's a checker for this already maybe not our check first all validate int greater than less than between different types at a range do we want to if we raise value error translate q must be either that will that translate okay q string i feel like we have other warnings like this already event event no i'm like trying to scale dimensions must divide by three uh i don't see what uh david asks would it not be that if odd rather than even you flip the polarity at the end and fine and reset fine first um yeah we can do that i think it's simpler if we just required to be eaten i mean we will break stuff like maybe there's a chance somebody gave it an even number or an odd number but yeah so dcd asked what's the process when you add a new string to be translated good question so um translated strings are surrounded by this translate thing there is a script that searches for all of the source code for this translate call and then it's also a function that does stuff um so what happens is that you will run um you can run make translate at the outer level this is the thing that finds these strings and then puts them in um in the dot p o file so if i go merge just so if we look at my sublime merge so this is the stuff that i'm currently working on um we can see this locale that circuit by the dot pot was updated these are just some things that got removed um and it doesn't include the new one which i expected it to it should it should have picked that up and i'm not sure why did oh you know what i bet it is no i saved it i don't know the bill did i edit the file in the wrong place i did not look for odd i don't think odd like string i'm actually surprised there's not one that's like modulo or something okay so it's building and i want to put this in boot mode because it's going to flash implicit declaration of translate oh it's not translate anymore that's why it didn't get picked up i'm it was changed to empty rom error text or something you know other file i don't know no other errors here yeah empty error text sorry translate is the old way uh it was switched to this empty error text because micro python started doing compression of error text they do not um they don't do um they don't do translations yet but it's kind of like the same same mechanic it's a little fix that does it make sense that it has to be a power of two i think it does because if you run off the end then you're gonna switch otherwise it's a weird it's a weird thing like pop left works weird yeah actually pop left mess misses it all up because if you call pop left and then get the 0th index of something the 0th index will no longer be i don't think it matters i don't think it matters if it's even sorry i'm thinking i'm thinking this through i don't i don't want to add this requirement necessarily because it'll break it if you don't use pop left you probably want it to be even if you're running in this like free running mode if you're not running in free running mode you probably gave it a max length that captures everything you want and you probably want it to pause before overwriting because if you overwrite and then do pop now you don't know where you are this this api was designed like five years ago now so i think i just somebody found an issue said like when it overflows it should pause instead i think that's right i think we should add a pause on overflow keyword arg um yeah so i don't think we should actually do this check but let's just see if it works just to show and then and then we'll call it kind of call it so if we while we're doing that let's run make translate again just to show that it should actually get picked up now so if we look here yeah so now it's now it's picked up the new um the new error message i just had like the translate function thing was wrong it might i'm out of date um so i'm just gonna i'm gonna undo this because pop left pop left makes it weird like it's it's a weird thing and what we need is we need this like hey if you overflow like don't mess it but for now i'm just re-implementing it i don't have to fix all the words while i'm here so i i backed it out and now if i run make translate again it should be gone so um when you add a new string it goes into the circuit python dot pot file and then um the web late picks it up so web late is the way that you can circuit python dot this here we go if you just search for it um so this actually has kind of get access so once it's committed to the main repo the text will show up here and then you can sign in here with your github account make the changes and then web late will automatically create pull requests back to the main repo with the new translations um it's a little tricky um but yeah that's kind of how translations work i think that's that's about it didn't we decide that it was working otherwise i just do control d oh i'm still doing the version that's checking um all right well while we let this compile let me wrap up my name is scott i go by tanute online i work for aida fruit and open source hardware soft hardware and software company based down in york city i work remotely so i'm in seattle here um and i do this 2 p.m fridays 2 p.m pacific fridays uh if i'm not able to make it tim aka filmy guy will be in this spot usually thanks to tim as always uh thanks to dcd who usually takes time code so if you're watching this later on youtube and you see that there's all these nice time codes that's dcd in the chat that does that which is nice um paul s k says before you end can you please show the usb s3 dual usb close up please i want to order a few i see someone amazon yes i will um if you want to join the discord um you can go to the url a da fru dot it slash discord um and i'm still building and i'm still waiting to download i will show a different one um so this is an s2 version let me gently press the product showcase button um so these are official expressive dev boards um and they come in two forms so this this sticker here the s2 solo is my label but this label here can shows you what exactly it is and i'll read it off it says esp 32 s2 dev kit c dash one um so there there's c there's dev kit c's and there's dev kit m's um and there this is an s2 version but they also have s3 versions of this as well um that are really helpful um and they'll come so the board is literally the same and then they just swap the module um that's why i had to add this label for what modules on there um so they they literally had the same board and then the module changes for different amounts of like flash and ram um so yeah it was great that they went back and added s2 versions of this so the s2 original ones were called salas and they were fine but they were not as good they didn't have the dual usb um and now with these dev kit c's and dev kit m's they have the dual usb at least with the s3 and s2 i don't know if the dev kits for the other ones are called that um there is a really good expressive page for this stuff too if you go to expressive.com and you wait and you wait and you wait and you wait um hardware dev kits let's look and see here so here's the s2 series so here you can see okay so there's s2 dev kit m's one plug which i thought was the mallah of the salah um but there's a dev kit c yesy so there's the older one the salah and that they were like straight up discontinued it i don't know why the dev kit m here only has one usb i would not get that i would not recommend it um but this is the page this dev kit page will show you like the two usb variants are the ones that you want um and you can see under flash and ps ram the different module variations like this comes in a four megabyte flash only but also and then also a eight megabyte flash plus two megabyte ps ram version so that's for the s2 and then the s3 you can see there's dev kit c's and dev kit m's um and they have all these different versions of them as well so yeah they're official yeah so dev kit c's for the c2's don't have dual usb see the c series does not have native usb so it's not going to have two anyway but yeah i i would say just generally like look for the two ports and i'll send a link there david says did anyone ever build on your poly stack project um not that i know of i sold maybe like 10 tops before i decided that selling these things that nobody wanted to buy was not not a fruitful idea um and i got the ate a fruit gig and didn't know a microbiome until then so it was yeah not that i know of um it was trying to fill a niche that didn't really exist um i'm not a great business person i work much better in this case where lamorn phil will have to figure out the business side and i do all the and i do engineering in my in my lane um so this looks okay um it's okay that it has a long pulse i wouldn't expect it's fuzzy enough i think it's okay um although this is interesting but yeah this is not right actually because we got a 65535 at the very start which is not what i would expect although that's the overriding right this is what this is this is why the overriding happened um so if we go to code up high and now we have to we have to mount it again i'm just happy it's not crashing i spent all day yesterday dealing with rgb matrix stuff where it was like literally a hard fault thing um so max like five so so this is what's going all the way around so we're getting a long pulse at the start and then we must still think we must when we're doing that overwrite we're still knowing that we have that many things so we're getting it again which is weird um but yeah i think it's not uh yeah i'm sorry is saying what i i got to it's just there's a delay yeah that's kind of interesting well um i'm pretty happy with that i am going to do the thing i did before which is um testing pulse out and i'm gonna put it in my learn guide as a way to save it just save that in there uh the next step i plan on doing is i'm gonna actually um the reason i wanted to do short pulse lengths is i actually want to turn the carrier on and see if i can detect the carrier with pulsing um because like a 38 kilohertz carrier should give me like 20 something long pulses individually so i think i can actually test the carrier portion using pulsing as well as long as the carrier is slow enough so um um i'm worked on that um i have to do count i o and rotary i o still i test the neopixel i tested rgb matrix so um and count i o i should be able to test with pulse out as well um so i can say like send one pulse and see if my count goes up by one um which is nice too so i am making headway and uh i do want to like i have to do bus i o which i think is the thing that i need to do before i um make at least parts of this guide public um but yeah anyway that's that if you want to support me you can go to adefruit.com and purchase hardware there and um i will hopefully see you next week i think i'm around uh if not i'll talk with phone the guy and maybe he'll fill in for me as well uh thank you all i'll see you on discord have a great weekend and maybe i will do a little window like i'm about to go out for a run and this is the weather while i do it uh if it was raining i probably wouldn't but it looks kind of nice and uh yeah have a great weekend everyone and i'll see you