 It's John Park's workshop and it's me, JP. Welcome, thanks everyone for stopping by. Was just chatting with people over in the Discord chat. Look, here they are. Right here, that's the Discord chat. So if you're wondering who I'm talking to, it's probably them, them, them. Also, I see we're up and running over in YouTube. See if I can get the chat up for that too. Chat's looking slightly broken over in YouTube. I'm not sure what's going on. I don't see a chat there. All right, well, if you're still with us, that's great. And we'll get going. So first of all, I had a couple of things I wanted to get to. First of all, we have our jobs board, so don't forget it. If you head on over to this site right here, oh gosh, my broadcast software is acting super slow. So hopefully you can still hear me. It's getting weird on me as I try to change views. Oh boy, I hope we don't have to restart. We'll see. Yes, it is ground to a halt. But that right there, hopefully I'm still broadcasting using me, that is the jobs board. And you can see a bunch of positions there that are available and it's entirely free to use. So if you're interested in, oh, and there goes a camera. Oh, we're losing them. I'm dropping like flies, which reminds me, it's a little hot in here, so I'm gonna turn on this AC if I can. There we go. I'll at least keep one of my cameras from crashing on me. All right, I think my broadcast software is down. So if it's still broadcasting, that's weird. I'm gonna have to reboot it. Sorry, everyone. Oh, look, there I am. It's not quite. All right, I'm broadcasting again. It might take a minute for things to catch up. No, I don't think you missed any fun stuff, Mr. Certainly, over there in the chat. I crashed my broadcast software. And it should have just, yeah, I think the, oh good. Yeah, I think the stream continued. It has some period of time it can continue there while you restart your stream software. And it keeps broadcasting. All right, thanks, David Bates. David Bates says we're looking good now. Looks like I'm still live over in Facebook and YouTube as well. I'm guessing Twitch is live. All right, broadcasting again, yay. All right, let's do this. You ready? So, to play catch up because Scott is going on it too, so I can't take too long with things. I mentioned the jobs boards. I head to jobs.datafruit.com. See Grover posted over in the Discord this very flattering pose that it paused on, mid-face. We call that mid-face. So, next thing, let's see. I'll mention and give you a little recap of my product pick of the week. So I do a show on Tuesdays. It is this, the product pick of the week. And this week it was the AMG 8833 thermal sensor. Really cool thermal camera sensor. So I'll show you a little one minute recap of that. But the product pick of the week is the AMG 8833 infrared thermal camera. I have a Pi portal and I'm running an Arduino sketch with the AMG 8833 plugged in over I squared C. It is using its eight by eight infrared sensors to measure the temperature using infrared of objects in front of it. And then this program is actually interpolating that to the 124 pixels. So you can see we get a really cool sort of predator thermal vision look at the world. You can see pretty clearly me waving my arms here. As I get closer, it'll detect the heat getting closer. So there's my face. You can see my forehead is the hot part at the top, my mouth down below. It's the AMG 8833 thermal camera. And if you didn't know, that's right, bringing my mic back in. When I do that show on Tuesdays, four o'clock Eastern time, one o'clock Pacific time, there is a discount, usually 50% off. It was 50% off on this one. So that's a great savings and it's available just during the live stream. So make sure you tune in during the live stream. You can watch the video inside of the product page itself, which I reveal right at the top of the live stream so you'll know where to go. And then from within there, you can purchase the product of the week and get up to 10 of them at the discounted price. So if you have a project that involves a lot of that particular sensor that I was showing, that would have been a good time to get them. So come on, tune in next Tuesday and we'll see what we've got. All right, let's see what else I wanna do. I've got a bit of a sort of a circuit Python tip that I wanna show. So let me set up some windows and things here. How about that there, that there, that there? Okay. Yeah, I'll need to switch between a browser view and that finder view here. So one of the really cool things about circuit Python is how quick and easy it is to get a microcontroller set up running the circuit Python firmware and now running your project code, including libraries, assets and the code. So what I wanna show is the full process from a board that's currently running a, it's not even running circuit Python. So I'm gonna plug this in. This is actually the one I had running that Arduino code that I was doing for my thermal camera. So this is currently doesn't have circuit Python on it. And I'm gonna show you how easy it is to get set up running circuit Python. So the first thing we do is we go to circuitpython.org head to the downloads link right here and then you can search for or type, you can browse or you can type in a search here. I'm gonna use PyPortal. So this is the PyPortal, this one in the center here. That's the board that I wanna get these latest circuit Python firmware onto. So I'll click here and then over on the right, this download UF2 now, this nice big purple link, that's usually the one you want. So I'll click that, that's gonna download a zip file and that's gonna place that into my download folder in my finder. And then we can take that UF2 file and we can put it right onto this drive by double clicking the reset button on it. And that will put us into bootloader mode. Once that goes into bootloader mode, we'll see a drive appear in my finder here called PyPortal boot. And I'm just gonna drag this UF2 file onto the PyPortal boot. What that's gonna do is flash the memory so that it now runs circuit Python. So there it goes, it has already booted into circuit Python. And now it's really got no code or libraries or anything on there unless you had some leftover from another project. So what I'm gonna do now is let's jump back to my browser and I'm gonna go to a project that I wanna use. So here is this really cool Neopixel color picker that Katni created. And what you do is head to the code page and this is the, let's go to the full code here. This is the new project bundle link. So when I click on download project bundle, that's gonna, again, download a zip file to my downloads folder. And let me switch back to, so I can uncompress that, double click that, uncompress that, I'll switch back to my finder here. So you can see what it uncompresses as is this folder with the name of the project and inside of it is the libraries readme, the code.py and a sample secrets.py. So now, since we restarted that machine, this board here restarted itself as a circuit Python board, it's now got the circuitpy drive that shows up. So all I need to do is drag these contents, actually I'm just gonna drag its contents itself, just take these, put them onto the board. And now, once that copy's over, it's gonna take it about a little less than a minute. It's showing me, I don't think you can see that, but it's showing me the progress as it's copying. It might be faster over a better USB connection among on a slow hub here. And once that, once those files are downloaded, it will restart and run whatever the code.py file is in there. And in this case, it's gonna find any assets or libraries that it needs. So here it is restarting and, oh, it's trying again. There it goes. So that's it, it's launched the code. This code runs a little, I've plugged in a little strip of NeoPixels and it's a color picker. But whatever your code is, the project in the Learn Guide system using Project Bundle will contain all the parts that you need. So that is one of the really powerful things about Circuit Python is how quick it is and how easy it is to go to that circuitpy.org site, find your board, we've got over 200 boards supported now and not just from Adafruit, from makers all over the world. And we can get the firmware onto there, latest version if that's what you need of Circuit Python and then if we're running a project from the Learn Guide, we can go to the Project Bundle, download the zip and put all the pieces and parts that we need on there. So that is your Circuit Python parsec. Okay, we haven't decided if I'm calling it that yet, but that's my tip of the week for Circuit Python. So let's see, you know what I'm gonna do. I can see a lot better if I put on these, at this distance, I'll put on these reading glasses here and check our good friends over in the Discord. Oh yeah, Ken Sentema says that was nice getting the half off on that sensor. Excellent, I'm glad you picked one up. All right, so let's see, next thing we're gonna do is dive into this week's project. So let me do a little camera management here. So I'll give you a little sample, a little demo real quick of the project. Let's see, you might be able to see it better through this view, maybe. You know what, let me show it to you from this view first. What I'm gonna do is just gonna walk over to the workbench here and you'll notice when I do so, my light bulb just turned red. This guy right here, keep an eye on that. When I walk away, it's gonna switch back to green. It's a little bright so it's hard to see the colors there. And pause for a second and answer Todd Botts question. He said it's not called bundle fly. All right, I had it wrong or we came up with a change since last week. The mascot is bundle fly. The thing itself is called the project bundle. So you're downloading the project bundle, but we do have a mascot in the works, possibly a less gross version of the bundle fly. So don't fear, that name is alive and well. All right, so back to the matters at hand here. Let me go to a little bench top view here and I'll do this little view here. Sorry, my air conditioner, the fan is blowing that camera a little bit. I need to tighten that mount that it's on. So here you can see, I've stepped into view of this PIR sensor and now my light has changed to red. If I step back a little bit and let it go to green, you can see it very quickly transitions to the green color on this bulb. So if I wave my hand over it, you can see it just turned the bulb red. So how's this working is the question, right? This is not Neopixels. This is not a sort of DC powered five volt or three volt Neopixel, this is in fact, I think this is on half brightness right now. This is an 800 lumen. No, this is actually an 1100 lumen bulb, I believe it is. And this is running on 120 volts AC. It's plugged into a sort of standard lamp socket here. I'll show you some info about the bulb in a second. But the way this is working is when I step back here and the PIR sensor stops sensing this big infrared reflecting or emitting blob like me, then it's sending a command over Wi-Fi to this bulb. So what I'm using here is the ESP32S2 on the funhouse board. If I flip this around here, you can see it right there. That's the ESP32S2. So this is a really powerful chip and it has a couple of great features. It has the USB built into it. So we're able to do circuit Python very easily. This is running circuit Python and it has Wi-Fi built in. So this is able to, using the Adafruit requests library, able to send Wi-Fi commands to this Wi-Fi light bulb via the internet. So the loop is not any sort of ad hoc direct thing. This is going through the internet, which means we can talk to this bulb with kind of any connected device if we want to. And what I like to do is show you how that's working in code as well as the libraries. Talk a little bit about the development of this, where it's going, and some ideas for how to use it. So first of all, for ideas on how to use it, you can see this, right now I have it acting as kind of like a warning indicator. So this might be useful if you have a recording studio or a dark room and you need to know that someone is approaching and you don't want to sound, right? So you don't want an alert sound, you just want a color change. This is a nice way to do it. You could imagine if you're in a dark room, this going red or off might be helpful so you're not ruining chemicals in case there's people still doing photography as a hobby. And then of course, there's other uses. You could do things like just a mood light. Whenever you get near it, it changes to some random color that you like. And the other things you can do with it are sort of the typical, the way a typical PIR sensor in a light switch works for something like a room, a bathroom and an office building is you're doing energy saving. So lights stay off until someone walks in, lights come on for maybe 10 minutes and then they shut off automatically. So let me head over to my workstation here. I'm also getting pinged and I wanna make sure that that's not something critical like if we're losing, no, okay, that's Brent actually, Brent piping in. So that's good timing, because Brent Rubel, he just pinged and said that they mentioned something else to me about the LIFX bulbs or LIFX, LIFX they pronounce it. So this LIFX bulb, I think I forgot the, I left the box elsewhere, but I'll go ahead and turn this one off and this one just has a fancy shape for the sake of fanciness, but most of their bulbs just look like a light bulb. And you can see it's a standard mount. I think, is that a call it an A19 mount or is that the shape I can't remember? But it's a standard US light socket at least mount for screwing into a 120 volt. I believe these work up to 220 volt also. So these are kind of international. So obviously they have a step down converter in there that's getting probably five volt DC for the microcontroller, three volt DC, maybe 12 volts for the diodes in there, I'm not sure. Probably someone's done a tear down of these. Andy Kelly says the E27, thank you. That's the mount there. So I'm gonna mute that so we don't hear ding ding. Brent doesn't know I'm, clearly doesn't know I'm broadcasting because he's still pinging me cool stuff about light bulbs. So the reason I keep bringing up Brent, not only he's pinging me, but Brent is, I believe the one who originally wrote the first project that we have using the regular ESP32 with this and a library, the LIFX bulb library that we have for circuit Python. I'll go ahead and screw this back in and I will grab my microcontroller here, the FunHouse and we can plug that in. So I'm just plugging this in over USB-C and now I'll get power and data to the board. Yes, so David Bates mentions Google Home Local API has some standards, each vendor has different implementations. They have, yes, Todd mentioned they have a cloud API, I can bring this up so people can read along, they have a cloud API that LIFX provides that you can use to talk to the bulbs from a web browser, curl commands, Python, things like that. So there's a lot of ways to talk to the bulbs and not just the official app. The official app actually is really nice and you can also use it with, I set up one of these with the, is it HomeKit, the Apple implementation? So the Apple HomeKit lets you add these bulbs and then you can talk to your S-I-R-I, I don't wanna say her name or things will probably happen. So let's have a look at some of that. Some of this is actually just recently updated. So Todd Kurt, Todd Bot in the chat, made a pull request that I think was just merged maybe on the updated version of this library so that it'll run on the ESP32-S2, which is the chip that we have here in front of us inside of the Home, the Funhouse. Let me see, did I turn this off? Let's turn it back on. You'll see that doing its thing back there. So let's have a look at some of the code. This is hot off the press. Here is my atom, let me find it myself. Okay, so again, I wrote some code for the PIR stuff, yesterday the day before, Todd made the updates and code for the Lifex bulb last night. So this is very thrown together. I'm sure there are optimizations available and you'll probably see a bunch of stuff commented out. So apologies for that. But here we can see the basic stuff going on. I'm importing a bunch of libraries. So the board for pin definitions, bus IO, because I think I have some I squared C stuff with sensors. Oh, I might not right now. I'm importing the digital IO, so I'm using digital IO for reading the PIR sensor as a switch. Wi-Fi, socket pool, SSL, Adafruit requests, these are all part of what is getting us online and sending commands. The Neopixel library, because I'm lighting up those Neopixels up at the top of the board there. Actually, that's not true. That can be yanked out. This should be using .star. And I think that's inside of the FunHouse peripherals. So I don't have to import it directly. Couple of the sensors built onto the board there on the FunHouse. And then there's this I import Adafruit LifeX. That is the library that we're using for all of the communication with the bulb. In the Secrets file, which I won't open, but the Secrets file, it keeps our secrets separate from our main code here so it doesn't get committed and accidentally shared. In there, I have sort of two critical things for this project. I've got my Wi-Fi credentials and I have a LifeX bulb developer key. I forget what they call it, a token. The LifeX token. And it's a long string that's generated on the LifeX cloud site when you get your bulb and create an account. You get this so you can then communicate with your bulb. So that's used when commands are sent to the bulb, but we store that in your Secrets file so we're not sharing that all the time. Then we have ESP32-S2 Wi-Fi set up here and connection to creating the Wi-Fi object and telling it to grab the SSID and password for your Wi-Fi inside the Secrets file. We set up requests for HTTP sessions so it can send those commands. And I'm not gonna show this directly, but if you look at my bulb back there, I have a different terminal open where I'm just sending a command over HTTPS. It's a curl command in a terminal. And that's just gonna toggle the bulb on and off. So if you watch the bulb right above my finger there, I'll toggle it on. I think it's on. And there we go, I've toggled it on. Since I'm sending commands to it from my fun house also, they're arguing with each other, so it didn't wanna stay off, the fun house brought it back on. But that's a, there are examples, lots of great documentation for how this works. In fact, if I head over to, let me do it this way, head over to my Chrome browser here. This is the Lifex, you can buy them, I got them on Amazon, but you can probably buy them at home stores or directly. And if you head to their developer portal, here you'll see some of these commands. They even have a little tryout here, so you can tryout code and send it directly from this documentation webpage, which is pretty cool. And this will tell you things like how you send, here's an example, curl command, how to send different colors. You can send, one of the really nice things about these bulbs for people who are doing video or photography is that you can specify your white light in Kelvin color temperature. So these have, I think probably, maybe four, maybe six diodes in them, red, green, blue. And then I'm guessing they have two or three white LEDs in there to do different LED white color temperatures so it can mix between a neutral, a cool, and a warm white because it definitely does not, when you use the white light modes, it definitely is not RGB being mixed, it's a much nicer light. So that's my guess is that they have five or six diodes in there to handle the color temperature things. They might be able to get away with five if they have a neutral white, a warm white, and then maybe they're mixing in the blue diode, but the color quality is really nice. So I'm guessing they have six diodes. All right, so back to the code here. Then the token, the variable for the token to the light is created by grabbing that on the secrets file. And then this is part of, I named my bulb lamp. You could name it Lars, you could name it FooFoo, you could name it lamp 17, whatever you want, that name is actually associated with that bulb, so you can have multiple bulbs and talk to them individually. And this is the only place that you'd need to change that in this type of code. In the app, there are things like I have home bulbs and I have workshop bulbs and I have home upstairs, home downstairs, so it has this notion of sort of a grouping hierarchy so you can turn all the lights in one area to a certain color if you want. Then we initialize that client using this HTTP session and this token, and then it actually lists all the lights. I told it to print this, so I get a whole bunch of info. Probably some of that is secret info I'm not supposed to share, so let me scroll up here and see if I can find, when I last did that, there's a bunch of temperature readings coming from my other parts of that project. You know, I won't mess with that now, but you get essentially all the characteristics of the bulb sent back to you, including if it's currently on what color it's currently set to, all of the settings that have been stored on the bulb, and so on. And then I'm doing some of the stuff with the FunHouse, setting the background color of the screen, setting up the sensors that are on it using I squared C, setting my PIR state, so I'm only making this color change, here it should go red, only making this color change, I don't wanna keep sending the same command to the bulb over and over, so I'm only making that change when there's a sort of edge detection, a state change. All of the dot stars up here are being set to rainbow colors at the beginning, and then I sync those up, right now you can see it's red if I get out of the way of the thing a little bit, and it goes back to green. Oops, my window's right in the way, there we go. So those dot stars up there I'm using to mimic the light pattern that's going on. And then this is the setup for the PIR sensor. I might try to see if I can use the debounce library for that because that makes the code just a little bit neater, because you can do things on rise and fall, setting some labels of things that are on the screen. This is all from sample, sort of the main Funhouse sample code. And then here's where I'm doing stuff with the light. I start the light when this boots up, I turn it on, set the brightness, and I set it to white, which is just a predefined color in the bulb. You can set it to hex values, RGB values, color temperature, hue saturation value, brightness. Any way you want, you can send it to color data, which is very nice. And then here's the main loop here. If the Funhouse peripherals PIR sensor is true and the PIR state is at zero, then we're gonna act like I've been detected and it goes to red. If, and we switch that PIR state, this is the command right here. So, Lyphix.setColor, this is from our Lyphix library. Lyphix light, power on, color red, brightness is set to 0.5, but we could make that vary as well. That's the whole command that we're using and it's just a subset of the possible commands in the library. And then when the, when I back away, you'll see that turn green here in a second as it, my PIR sensor stopped detecting me and it just switched to green. That's this right here, said we did not detect you, the PIR state is that it was on, so we're gonna go off, change my colors of the dot stars to green. I print out just for the serial output for my own debugging that we're going to green, so that I see, did it really go to green? And then we send this, basically the same command with this one change right here. The rest of this is just updating things on the fun house from the demo code. I left off some of that there. And that is it, so it's quite straightforward. And if you watch here, you'll be able to see again, there's my bulb, it's set to green. Put my hand in front of it there, and off it goes to red. That's enough of that, and it goes back to green. All right, so let's see, any questions in the chat? I'll bring back the Discord chat here. Yes, sorry, YouTube, I don't have a chat window for you today, something went wrong. My browser window never gave me a chat window, so if you're wondering who I'm talking to, it's at discord, it's adafru.it slash discord, you can head on over there. Let's see, someone asks if there's an equivalent library or API for the CASA bulbs, K-A-S-A, that's a question from Don K. I don't know those bulbs. I believe right now, as far as Wi-Fi bulbs goes, if that's a Wi-Fi bulb, we have a library for Phillips Hue, and we have this library for the LIFX. And then we have Bluetooth libraries that work on a few different makes of bulbs. They tend to come under a bunch of generic names and you have to basically sniff the Bluetooth LE to find out which kind it is when you get it. It's a little harder to know. Let's see, anything else? That's about it, yeah, so one other thing I'll show you on the bulb, I think they're really neat, is the app here. I have this running on a iOS device, but it's available for iOS and for Android. So if I launch the app right there, you can see it has updated itself to whatever the bulb is set to. So if I step away from my PIR sensor, bulb is gonna turn green there, and the app just updated itself as well. So it's getting, I don't know if it's pushed. I think this uses REST API. That's what Todd was saying after looking into it. I think it pushed that to the app, which is really cool. I can also adjust that, so let's say I'll go blue now. I can make it brighter. And when I now go and put my hand over the PIR sensor, that's going to send a command that kinda updates the whole shebang. It's gone to green, and after a few seconds, my app just updated, which is really nice. I mentioned the white lighting, so they have this sort of color wheel here so I can go to like a really nice warm light there, a cool light there, so you can see that bulb updating. And then these are in color temperatures. This is a 4500, this is a 4K, 3500 neutral, and so on. And then there's of course all these integrations and things, so in the app you can go to different rooms and turn lights on and off just from here as well, set whole rooms to one color and so on. So a lot of neat stuff in there. And then there's the integrations with your Echo devices and your S-I-R-I devices, I'm not gonna say their names. Actually, I was watching a video about LIFX and they out loud said to their Echo device to do something, and my Echo device, which is actually hooked up to a completely different bulb over there, got a close enough match that it went and turned on that light, which is kind of bonkers. Let's see if that one works. Alexa, turn on the light. Yeah, so turn on that light over there, which is a totally different bulb, that's just a switch actually, not a bulb thing. David Bates' question was gonna ask if it kept some kind of log around activations from the motion sensor portion. I'd like to know when it was activated. Let's see, I think you may be able to access the history on the cloud API site for that bulb, possibly, but it would not be too difficult to add, and I think I'll do this as I write the guide, I'm gonna add another component to this, which is just write it to Adafruit.io. So anytime I trip that PIR sensor, it's gonna kinda do two things. It's gonna tell the bulb to do what it's gonna tell the bulb to do, but then it's also going to update my Adafruit.io feed, a data feed, with the fact that the alarm got tripped, and then you'll have a nice graph of it, and you can export that data, you can make a dashboard with it, so that is like the perfect use for Adafruit.io. It's ideal for that, it's easy to set up, and I'll probably show that next week, since I didn't prep that for this, but as I work on that and I work on the guide, maybe next week I'll show how that's set up. Someone's trying to deactivate Lars, where is old Lars? Oh, he's way over there, you probably can't see him, can you? No, I can't get that camera around enough. Lars would be a good guy to put in front of that light so you can see what's going on, right Lars? Right, it's gonna fall over, he's sleepy. Yeah, other people saying they're Alexis are doing things, mine's probably gonna spin her little lights there. I think that is it, so let me know if you have any other questions in the chat, again, I apologize for not being able to see the YouTube chat today. The learn guide, I will mention, actually let me jump over to my Chrome browser again real quick. Learn guide for this will be going up in zoom out a bit here, in learn guide news, let's go to learn, make this a little bigger so I get the full UI, come on, gonna shrink you a little, there we go, explore and learn, all right, I'll just do, what was the previous one, was it the cyber deck? Now I'm not remembering, let me do author name is a good way to search things. Oh, my web page is broken here, hold on. There we go, if you click an author by name, you get a chronological with newest first, yeah, so here's the latest guide, analog knobs on Raspberry Pi 400 with cyber deck hat, that is up now, so you can go and see what we worked on a couple weeks ago, and this will take you through that, and next up will be the, what did we work on last? The Raspberry, no, it's the door sensor, yes. They're all running together, sorry about that. Yeah, I don't have a door sensor guide up yet, I do have a video up, I think they showed that on Ask an Engineer last night, and I put that up on the Instagram and YouTube and Twitter, so you can go check that out. And the learn guide for that one is in the works, just Melissa's been making some updates to the Funhouse libraries, so that's working well with both notifying to the dashboard as well as sending out g-mails, and this will be the next one up after that. So that's gonna do it, and I will mention that our good friend, Scott Shawcraft, has his show coming up, he's gonna do a deep dive at two o'clock, I believe it's today, right? We can actually type in the chat over here, if you didn't know, in Discord you can do show times, someone beat me to it, that'll show you when the shows are, we don't actually update that. Oh, so tomorrow, Mr. Certainly Says He Thinks It's Tomorrow. Sorry about that, yeah, I think I saw a tweet, so maybe watch your inbox, maybe just come back in about 19 minutes and see. Mr. Certainly Says He Thinks It's Tomorrow, but I feel like I saw a tweet or something like that from Scott. Either way, we got lots of great content for you, and we hope you tune in again real soon. So I'm gonna see you next time for Adafruit Industries. This has been John Park's Workshop, and I'm John Park. Bye-bye.