 And welcome to Lady Aiden. Hi everybody and welcome to my desk. It's me, Lady Aida. Got my hair dead. Last weekend we were out as a family, but we're back and back to hacking on electronics. Do you have any news or updates, Mr. Lady? Yeah, regular shows this week and more tons of new products. Lots of surprises, big week for us. Also having some visitors in town, so maybe we'll have some extra content. It is a good week. Okay, let's take it. So two weeks, two weekends ago, wow, it feels like it was months, but it's two weekends ago, I was still working on the Teddy Ruxman hacking, trying to get audio working. I think we had gotten the eyes modified using our Ruxman analyzer script, but I was still working on getting the audio working, which was like kind of complicated. And then not this Wednesday, but the 10 days ago Wednesday is when I got the audio working in the morning. And I don't see which version this is. So now, let's get this. Iggy, sticky bubble gum, sticky bubble gum makes your cast into your head. So now I've got it playing custom audio. So that's a song, Iggy, sticky bubble gum that our Ada Kitto likes to listen to. So that'll be funny if we load it on the bear and it's just kind of very fast encoding. That just shows that you can actually get audio encoded and working on here. And that was a long process. I think last week, I was talking about how, sorry, two weekends ago, I was working on running this library file on a Raspberry Pi and it wasn't running. And so I was using Udra to decompile it and like try to change this flag. And then the audio that came out of it, I'll look at it again, at the time I wasn't able to get it to play on the bear like it came out all like squiggly and weird. I'm still trying to figure out why some encoded libraries are working and some aren't. But I kept, you know, I wasn't willing to give up foolishly or not. So I kept Googling around and I ended up, you know, the computer, I'll show what I ended up finding. So a lot of like reverse engineering is like you just keep searching for stuff. So, you know, searching and searching, you know and I have this notes file even of like all the stuff I tried and like I tried this library and that library and like decompine on this, decompine on that. And in the end, what I found was there was in a repository that the SDK repository for the Sonic's chip set had a zip file and in the zip file there was a library, a different library file for Android. And that file I Googled around for it's called libaudio32encoder.so and it was a Java library for Android. And what's fascinating is we actually have an Android developer on, you know, on staff on contract. Antonio, he's written the Android applications that we use for like Bluetooth Connect and PyLeap and all that stuff. And I gave him that zip file with the Java library and I said, hey, can you like figure out if you can get this to, you know, there's a function like audio encode, can you like try encoding the audio? And he did and he actually wouldn't, I try again, it tried putting it on the bear, it didn't work. And so we were like kind of annoyed and it was like, why isn't it working? It's like, it's a Sonic's SDK, this is a Sonic's chipset, why is it working? But when I searched GitHub for this file, the libaudio32encoder, I came up with, it came up this GitHub repo. And I was like, ooh, Cloudpats. And then it was like hacking unicorns. And it was like some, so the, the blog post doesn't exist. But if you Google, like, you know, the, he, this guy worked for a company that was in bought by Accenture. So like goody for him. But, you know, I wanted to see what the original article was. And it was, it was all kind of, you know, similar. I was like, okay, there's this toy. And it uses like the Sonic sound processor. So that's good. And it has Nordic NRF, which is actually similar, right? Remember, we looked at the bear inside either on DeskGladiator or in My Little Hacker. And we saw that it had the Sonic ships and NRF. So I was like, okay, maybe it's the same company that did it. And then Skye's like, did the Bluetooth stuff, blah, blah. And then, you know, very similar, like commands that were sent, but I don't really care about the Bluetooth stuff. But then somewhere down here, he's like, he's like, oh, there is this Kodak. And, you know, much like everybody else, like, you know, my entire life is people being like, hey, it's the G7 221 NXC Kodak. Why don't you just use the G7 221.1 NXC Kodak? And it's not, it's not exactly the same. I tried the standard Kodak and the Kodak. I mean, I'll keep looking at the Kodak now that I've gotten something working, but it's not the exact Kodak. But he did open up the Android app for Cloudpets. So if you go to like Google, use it for Cloudpets, APK. There's these like APK download, you know, like the archive sites and they kind of, they store every APK and you can download APK. So this is the Android app that originally was for this toy. And then, hold on, I don't think I actually downloaded it. Okay, so now I download, so it's really big. So an APK with the Android app that's running on, I guess with this other toy, this magical unicorn with Bluetooth, you record the audio on the Android app, you say like, hi, I'm a little unicorn and you press go and it codes it into this audio 32 Kodak, sends it over Bluetooth though, I don't think it's compressed. So it's, you know, the Kodak is a compression Kodak. It'll save you, you know, 75%. It'll do like a 25% compression. And then the device will play that audio, you know, the toy will play the audio clip. So what you realize is that when you open up the XAPK or the APK inside is a Android linked library called lib audio 32 and code. And if you're on Android and you're running Python on Android, which, you know, it's just Linux, you can run Android on it. So I'll show this in the folder. So this is the cloud pets app. And then if you rename this zip, because they're just zips and I've already downloaded it before. So it's like, you've already done that. There's another APK. So you can download the second APK. There's an APK inside the APK. And then you rename this zip and then in here is library class. So the library files in here, so there's like, you know, there's, and there isn't x86 unfortunately, there's only ARM A, B, Y, A, B, I, and ARM A, B, I, V, seven, A. So two ARM cores. So this library is an encoder that will let you encode audio into the correct format. And so this person, PDJ Stone, wrote an encoding script, a Python script that opens this DLL in Python. It's a C types DLL. And then what was really nice was like, oh, hey, look, there's that AU, like that's familiar and the sample rate. Okay. Like all of this header like looks correct. So it's kind of getting excited. Cause it was like, ooh, this seems like it's the correct encoder. Like there's apparently a couple of things called all your 32, but maybe this is the right one. So then the trick was this was written seven years ago. And so I was like really excited. I was like, okay, I'm going to like, you know, I had a Raspberry Pi and I saw Android on it. There's a version of Android called, hold on, all these likes. LiniageOS, I saw LiniageOS and I'm like booting my Raspberry Pi. And I'm like, I'm like ready to, you know, I install Python on the Arduino. That's how the Raspberry Pi running Android. And it doesn't work because what happens is, you know, and this is like how you install it and you're like, okay, my Android might four and I want it. And you end up getting this error, which is, sorry, I'm in the editor mode, that it has text relocations and you can't run it on anything before, sorry, after the API level 23. So basically this, when this person wrote this Bluetooth toy hacking script and that app was written, it was for Android 5. It was like a very early version of Android and you're not permitted to run that code anymore on modern Android and there's no like workaround. It's like deep inside the operating system will not let you run it. And so I did, you know, and I talked about this in the video, you know, I got Nexus 7 because like everyone has a Nexus 7 and the Nexus 7 can run Android 5. And like I still have like a Nexus 7. I have two, I have one of each edition, I think. And I did get it running. I charged it, effectively reset it. I ADB'd in, I installed Turmux, which is the Linux for Android. And thankfully Turmux has a version they still publish for Android 5. And then I was able to like log in and then I was able to ADB the files over and through the command line, I was able to run the script and it complains. It says like, hey, it has text relocations. This is wasting time that it's security and it's a bad idea, but the code runs. And it generated a bin file. I took that bin file, I pasted it into an existing story file for the bear. And then I put on the bear and it worked. And so that was like magical. So the only thing was is that like, you have to have a Nexus 7 and you have to go through this ordeal. And like Nexus 7s are not like fast Android machines. Like, you know, even running the stock Android that it came with, you're like clicking and then you're like, I'm waiting patiently. And then you click again and then you have to take a deep breath because it's extremely slow. There's a reason they gave them away. I don't think anyone bought a Nexus 7. So what I've been doing since then, and now I can code audio. So it's like, we can code audio. The rest of the file is parsable. The eyes can be modified. So what we wanna do next is two things. One, make it so you don't need Nexus 7 to do this encoding because even though everyone has one, I mean, I talk to some people on my team and they're like, I threw mine into the ocean and I'm like, well, okay, cool. Or they lost it or they threw it away, which you're not supposed to do. You're supposed to keep it because you can't get to sanctuary unless you have your Nexus 7 when you die. So the next trick is how can I get it so you don't need a Nexus 7? So I've been documenting this as an unpublished guide. But the next step is that you can run Android 5 on a Raspberry Pi 2. There is a build available that you can download and I have like an image file that you can use. And you can ADB into your Raspberry Pi on your desktop. And that worked also, it actually wasn't too bad. It wasn't very slow at all. And you can get the files on and off and you can do the encoding and all the marked up table stuff. But the problem is that Android 5 wasn't available for the Pi 3 or Pi 4. Like for whatever reason, it was only built for the Pi 2 and you can't, it's the kernel, it's like Pi 2 kernel. So then I tried a Android 5.1 emulator through the Android SDK. It turns out that really sucks also. Like you can emulate ARM32, but it's like even more painful than the Nexus 7. It just takes minutes to get anything done. So that was not a good solution. But then I kind of like put this bug into Antonio's ear, our Android developer. And he was like suddenly like, this is really interesting. Like, okay, I like how do you, how are we gonna get this working? And he realized that if you look at the author of Cloud Pets app, Spiral Toys, and actually I kind of took screenshots, I'll just do this. So they made this app called Cloud Free, Cloud Pets Free, and this thing called Toy Fight. This is actually kind of interesting. This company, like I read about it and they like they kept changing their name and like they were totally like going to make like the future of toys and then like they went on business. And then this Wiggy toy app is like some weird Bitcoin thing. Anyways, but they did the Cloud Pets app and that was again only Android 5 compatible because the library was very old because it was like about in 2018 or 2015. And they never, this didn't get updated. And then they formed another company and they made another toy called like the Wiggy, Wiggy Bank. And this also is like, look at this like scary ass toy. So this toy also you would like, you could send it audio over Bluetooth. And so Antonio's like, oh, maybe like this other app, the Wiggy toy app has in more modern, it's from 2020. So he downloaded the APK and opened it up and realized that there was a post API 23 version of the .so files. So now what I've got on here on my desk, which I'll show on the overhead somehow. Hold on, there's pieces, I'll wrap up this because there's been gone off for a bit. There is, this is my, this SCP was winning CircuitPython, but it's no longer, this is a Raspberry Pi 4 running, maybe you can go to me full, can you put, go to me full screen? Yeah. So now this is running, this is running Android, like whatever the latest is, TermiSea or whatever, on a Raspberry Pi 4, this is a lineage ass build, which is really easy, just download the image, you burn it and you run it. And I've got it running Termax on here and I swapped in that new .so file, the link library that is now modern Android compatible, and I'm running SSHD on here and then if you go back to the computer, what's nice is that now I can SSH and SCP, and so I messaged into the Android, enjoy you name all, so this is a Android builds from like 2020, I think it's maybe the Android 11 or Android 9 or something, but I've got the Cloud Pets, I guess I get status. So, I've updated the lib audio 32 encoder file and now I can encode audio, so this was the way file that Mr. Lee gave me of the song and then I've converted it to a binary file and then I SCP it off and then I can paste it into the story file for the bear and it works, so that's way easier than, to be honest, dealing with Android phones. You can do it on any Android phone, but it's kind of nice, I just have ethernet plugged into my Raspberry Pi, a SSHN and it's good to go. So, I'm still working out different ways for, like at least now you can use any Raspberry Pi, you don't need a Pi 2, you can use any Raspberry Pi, that's modern, to run Android on it and you can run the script. It is a skin arm, it's only arm 32 and arm 64, but if you're on a Mac, a modern Mac, it is arm 64 compatible and so you can, I'm running Windows on an x86, but if I had a Mac laptop or a Mac computer, which I do have one, you can run the Android emulator with an Android studio and boot up a, like here I've got a virtual device, you can boot up a virtual device, so you could actually do this all within software, but unfortunately emulating the ARM core on the next day, six, six, totally sucks. And he's just QEMU and then it's not very fast and you can't run QEMU without like the whole Android thingamermob, so I should delete this because this totally didn't work out, tried to like emulate a pixel too and it like, it didn't even, it just crashed. It was like, I can't do this, I'm giving up, I'm leaving. So I learned a lot, but we didn't get audio working. The only thing that's a little sad is the audio quality isn't as good, it's 16 kilobit per second, not 32, because that encoder was meant to do only Bluetooth low energy transmission, not drag and drop over USB, but it's a lot easier to, once you have something working, work your way back into getting better quality and like easier functionality, and so you can see I'm like sort of filling out this guide, I'm like, okay, how I can make it much easier to do a conversion because once you have an easy way to do the conversion, then I can look at this like G7221 codec thing because I might be able to figure out what tweaks they made to whatever table or whatnot to get it working and then I can run like anything on any computer because it would just be a simple executable that just takes in the way file and then gives you like the highest quality audio out. So it's happening, but it's happening slowly, I'm kind of like redoing a ton of work, but the cool stuff is that there's, I've seen so many people be like, oh, I wish I had an audio 32 encoder decoder, at least now there's gonna be a documented way of doing it and I think that'll be really cool. All right, so that's what's on my desk. It's like bears, all bears all the time. So let's go to the great search. Let's do the great search. The great search brought to you by didyki and Anna Frith, thank you, didyki. Every single week, Lady Data, user power of engineering to help you, yes, you find the things you are looking for Lady Data. What is on the great search this week on didyki.com? Okay, so this week on the great search, we had a request and I love requests, so send them in. So Puppy2331Puppy asks us to please find them in analog magnet sensor. So we've covered magnetometers before where you have I squared C or SPI output. You know, I have a couple of favorite ones like the TMag series, I think. I'll show it, this is an I squared C Hall Effect 3D sensor so it can read magnets but it's digital output and it's surface mount. So I'm gonna guess that this person wants a through-hole, easy to use analog output magnet sensor that is, because they said analog, I'm assuming they don't want just a switch. It's easy to do a switch where you just detect whether the magnet is nearby or not because it turns on and off a switch. There's read relays that do it. Those are super inexpensive, they're mechanical. There's Hall Effect sensors that have digital output or open drain output, but they specifically said analog. So let's find a magnet sensor that will read north or south on a magnet and give you an analog voltage depending on how close it is and that will be used for proximity sensing. So we're just gonna start by searching for magnetic sensors and that is a whole category. So there's a couple different categories available here. So we don't want switches. So there are solid state switches that are not mechanical, they're not reads. They're not read relays. They're not like a mechanical switch. They do use the Hall Effect but they have a switch output. So it's like digital output even though it's not a digital protocol. We're not gonna do that. There's also modules that are like fully enclosed. If you're building like a finished good or a robot or like some automation you might wanna ready to go, you know, enclosed module but we're gonna go with a linear compass IC. Even if it's not a 3D, they're kind of called compass ICs. Okay, so first up, we definitely let's put back to stats. We can see all of our options, so many options. So let's go with active and let's go with through hole. Remember we wanted a through hole part for this person. And I want some that's in stock and I'm gonna exclude the marketplace products. You can see like just before even getting into like our specs it's already down to, you know, about a hundred options. Okay, then the output types. So remember they wanted analog output. So, you know, there's this dash and all that means a Wheatstone bridge would mean that it's a resistor so you'd have to like do the Wheatstone bridge amplification. I wanted something that does require external circuitry. PWM I'm assuming they don't want because PWM is hard to read because you have to read the pulse width. I'm assuming they really do want analog current or voltage. The reason I say current is because you can always put a resistor to create a voltage from the current. So let's see how this goes. So let's apply. Okay, cool. Let's see a couple of options we've got here. So these are looking really good. There's these through-hole components. Let's next up do voltage. So they didn't specify a voltage and they didn't specify a sensing range. That is actually kind of important because depending on how strong your magnet is you might want to either measure the Earth magnetic field or a weak magnet. It could be like under those kind of like fridge magnets or it could be a really strong rare Earth magnet. They didn't say, but let's do the voltage supply first. So I want it to work with three volts and five volts. That's kind of my preference. So let's look, this is within range. And I'm just shift clicking to pick up all of these three to five volts and three to higher volts. Versions now are kind of cut our options in half. And then the next question is the range, the sensing range. Again, they didn't mention it, but I'm going to say maybe plus minus 20 and above so fairly strong. You want to have it be the range of your sensor should be matched to the magnet because you don't want it to saturate if it's too high and you don't want to have the voltage kind of go up and down enough to be measurable by your microcontroller when it's low. So let's let's look here. Okay, so we're down to 40. I feel like that's a good place to start. So let's look at pricing and see where we end up. So one thing I notice is that the kind of the front the front page of Digina when I search by price is all this DRV 55X series and that's kind of promising. There's a lot of them in stock they seem very popular and they're 50 cents a piece. So let's look at one of these, you know, looks like it's DRV 5053 and then letter, letter, letter. So in the data sheets, and a bipolar hall effect sensor. That sounds right. Linear output, Hall of Sensor. Looks like there's a bunch of different sensitivities available. So it can be as little as 11 millivolts per millitecela. So that's good. If you have a very strong magnet to 90 millivolts per millitecela, that's if you have a very weak magnet available in both surface mount, sought 23 and sought to 92. So through hall, see wide voltage range, no regulator required, kind of nice. And what's neat is it's stabilized. The analog, the zero to two volt analog output responds linearly to the applied magnetic flux density and distinguishes the polarity detection as well. So that's kind of nice. So you can detect whether it's north or south. A lot of hall effect sensors will only detect one like either it's south measuring or north measuring. It doesn't tell you which one. What's nice about this is it looks like the output, which is two volts. So it's zero to two volts output. It starts with the strongest north is up to two. And as it goes down to the south side of the magnet, it will go down to V-min, which is probably around zero. Sounds like V-min. And it looks like there is, oh, you can get it in negative or positive polarity sensitivity and that they'll just be the opposite way. So you can decide whether you want north to be positive or north to be negative, north to be a high voltage or north to be a low voltage. Let's see in V-min. They don't actually see what V-min is, but I bet it's just zero volts. I think they're just saying like zero. Okay, output voltage point two volts to 1.8 volts. So yeah, it's about zero to two. And at zero millitesla, like so no magnetic field detected at all, it's about one volt. So, you know, it sounds pretty good. You can use this with three volts logic. So your feather or your Raspberry Pi Pico, or you can use it with an Arduino. You just won't get, you know, you just make sure you know that you have to divide your five volt range down. When you get the analog reading out, you'll have to like kind of scale it down to get to the zero to two volt range. But this looks pretty good and it's available in a lot of different sensitivities and looks pretty solid and it's really inexpensive. So this is going to be my pick for the great search and there's a ton in stock. So you're in luck. If you need it, if you happen to need 7,668, go to town. Great search. And that's our show for this evening. Thanks so much for joining us. We've seen everyone during the week and more. Got that teddy bear at home. Or if you need to get one off eBay, get ready cause it'll be a lot of fun stuff to do. Yeah, I'm slowly but surely writing this like massive guide and we're also going to be experimenting with how to do digital puppetry to get the mouth to move as if it's singing so it like looks like it's doing the right thing. Although we've noticed that as long as it's moving while there's audio, it doesn't seem to, your brain kind of fills it up. Okay. Thanks everybody. Have a great night. Bye everybody.