Rust-y Firmware For Waveshare Smartwatch

Waveshare makes a nifty little ESP32-S3 based smartwatch product, but its firmware is apparently not to everyone’s liking. Specifically, it’s not to [infiniton] a.k.a [Bright_Warning_8406]’s liking, as they rewrote the entire code base in Rust. No_std Rust, to be specific, but perhaps that doesn’t need to be specified when dealing with ESP32.

On the Reddit thread about the project, he lists some of the advantages. For one thing, the size of the binary has dropped from 1.2 MB to 579 kB while maintaining the same functionality. More interesting is that he’s been able to eliminate polling entirely: the firmware is purely event-driven. The CPU is not just idle but parked until a timer or GPIO event wakes it up. For this form factor, that’s a big deal — you can’t fit a very large battery in a watch, after all.

Getting drivers for the AMOLED display, touch sensor, audio, and RTC modules written from scratch is an impressive accomplishment. Apparently the screen driver in particular was “a nightmare” and we believe it. There’s a reason most people go for existing libraries for this stuff. [Bright_Warning] did not post screenshots or video, but claims his version of the watch watch can make HTTP calls to Smart Home, play MP3s, play the old phone games– Snake, 2048, Tetris, Flappy Bird, Maze– and even comes with a T9 keyboard for text input.

If you’re looking to get closer to bare metal, and don’t mind it being Rust-y, take a look at the code on GitHub in the first link above. This author isn’t enough of a rustacean to say if the code is as good as it sounds at a glance, but nothing egregious jumps out. The documentation describing exactly what’s going on under the hood isn’t half-bad, either. If you aren’t into Waveshare products, you could easily adapt this code into a more DIY ESP32 watch, too.

If you’re not into Rust, uh… washing soda and electric current can get it off of steel, and probably microcontrollers too. We can’t say that the chip will work after that, but hey — no rust.

Digging Into The Twilight Hack That Brought Us Wii Homebrew

With each new game console, there’s an effort to get around whatever restrictions exist to run your own software on it. In the case of the Nintendo Wii, the system was cracked through one of its most popular games — The Legend of Zelda: Twilight Princess. How this hack works was recently covered in detail by [Skawo].

The key for this ‘Twilight Hack‘ is to use a modified game save that allows you to run arbitrary code from an SD card, something which was first patched out of the Wii firmware with version 3.3. As shown in the video using the source code, the basic concept is that the name of Link’s horse in the game is changed in the save file to be longer than the allocated buffer, which leads to a buffer overflow that can be used to reach the application loader code.

Interestingly, while the horse’s name can only be 8 characters long, and the buffer is 16 bytes (due to ShiftJS two-byte encoding), the save file loading code allocates no less than 100 bytes, for some reason. Since the code uses strcpy() instead of strncpy() (or C11’s strncpy_s()), it will happily keep copying until it finds that magic 0x00 string terminator. Basically the horse can have any name that fits within the save file’s buffer, just with no null-byte until our specially crafted payload has been copied over.

Although it took Nintendo a few months to respond to this hack, eventually it was patched out in a rather brutal fashion by simply searching for and wiping any modified save files. Naturally this didn’t stop hackers from finding ways to circumvent this save file check, which led to more counter-fixes by Nintendo, which led to more exploits, ad nauseam.

Even with firmware update 4.0 finally sunsetting the Twilight Hack, hackers would keep finding more ways to get their previous Homebrew Channel installed, not to mention so that they could keep watching DVDs on a Wii.

Continue reading “Digging Into The Twilight Hack That Brought Us Wii Homebrew”

The omatraumatone. Or something. It's a synth.

Otamatone Hacked Into Different, Cooler Synth: Trautonium

Analog synths are fun because they combine music, which all humans seem hard-wired to enjoy in one form or another, and electronics, which… uh, this is Hackaday. If you don’t like electronics, we’re not sure what to tell you. This hack from [Sound Workshop] takes the cheap, toy-like Otamatone and turns it into an older and more capable type of synthesizer: a Trautonium. The video below also includes a dive into the different types of early synthesizers, with examples of them playing, so it’s worth watching for that alone — if you know the history, skip the first five minutes or so.

For those of you more into the electronics than the music side of things, the Otamatone is kind of like an electronic slide whistle, but adorable. Shaped like an eighth note or a tadpole, you control pitch by sliding your fingers up and down the ‘tail’ and activate the voice by squeezing the ‘head’ to open the mouth. It is one of the newest electronic instruments on the market, having debuted as a Japanese toy in 2009.

Continue reading “Otamatone Hacked Into Different, Cooler Synth: Trautonium”

A Mercury Rover Could Explore The Planet By Sticking To The Terminator

The planet Mercury in true color. (Credit: NASA)
The planet Mercury in true color. (Credit: NASA)

With multiple rovers currently scurrying around on the surface of Mars to continue a decades-long legacy, it can be easy to forget sometimes that repeating this feat on other planets that aren’t Earth or Mars isn’t quite as straightforward. In the case of Earth’s twin – Venus – the surface conditions are too extreme to consider such a mission. Yet Mercury might be a plausible target for a rover, according to a study by [M. Murillo] and [P. G. Lucey], via Universe Today’s coverage.

The advantages of putting a rover’s wheels on a planet’s surface are obvious, as it allows for direct sampling of geological and other features unlike an orbiting or passing space probe. To make this work on Mercury as in some ways a slightly larger version of Earth’s moon that’s been placed right next door to the Sun is challenging to say the least.

With no atmosphere it’s exposed to some of the worst that the Sun can throw at it, but it does have a magnetic field at 1.1% of Earth’s strength to take some of the edge off ionizing radiation. This just leaves a rover to deal with still very high ionizing radiation levels and extreme temperature swings that at the equator range between −173 °C and 427 °C, with an 88 Earth day day/night cycle. This compares to the constant mean temperature on Venus of 464 °C.

To deal with these extreme conditions, the researchers propose that a rover might be able to thrive if it sticks to the terminator, being the transition between day and night. To survive, the rover would need to be able to gather enough solar power – if solar-powered – due to the Sun being very low in the sky. It would also need to keep up with the terminator velocity being at least 4.25 km/h, as being caught on either the day or night side of Mercury would mean a certain demise. This would leave little time for casual exploration as on Mars, and require a high level of autonomy akin to what is being pioneered today with the Martian rovers.

Top image: the planet Mercury with its magnetic field. (Credit: A loose necktie, Wikimedia)

It looks like osu!, but it's actually Trombone Champ

Implementing A Rhythm Game Entirely In A GPU Shader

Most rhythm games have a community creating custom charts, and Trombone Champ is no exception. What is exceptional, however, [CraftedCart]’s osu! played in a Trombone Champ chart.

It all started as a challenge to make the most unserious chart possible. Among some other ideas, [CraftedCart] eventually decides to make an osu! chart but play it in Trombone Champ. Okay, not a problem, let’s just–oh, you can’t run arbitrary code without a making a mod. So instead, they decided to use shaders on the GPU. There are, of course, all sorts of problems with such an idea. Being stuck in the fixed render pipeline of a game, you can’t just add any resources to your shader you want. This leads to using textures as memory, both the game state and the osu! chart are actually textures. Another interesting one is getting user input into the shader. [CraftedCart] solves that by connecting the position of the game object the background is rendered to to the cursor; then, the shader reads the world to local transform matrix to determine the mouse position. Finally, the graphics the player ends up seeing are rendered using ray marching.

Video after the break.
Continue reading “Implementing A Rhythm Game Entirely In A GPU Shader”

Battle Born Explains How Its Battery Thermal Safety Works

Autopsy of Battle Born LFP battery with the 'thermal safety' on the bus bar. (Credit: Will Prowse)
Autopsy of Battle Born LFP battery with the ‘thermal safety’ on the bus bar. (Credit: Will Prowse)

After users of Battle Born LFP batteries encountered issues such as a heavily discolored positive terminal and other signs of overheating, multiple autopsies showed that the cause appeared to be the insertion of a thermoplastic between the bus bar and the terminal. Over time thermal creep loosened the connections, causing poor contact and melting plastic enclosures. According to Battle Born, this is actually part of an ingenious thermal safety design, and in a recently published article they explain how it works.

The basic theory appears to be that if there’s a thermal event, the ABS thermoplastic will soften and reduce the pressure on the bolted-together copper bus bar and brass terminal. This then allows for an aluminium-oxide layer to form on the aluminium connecting bolt courtesy of the dissimilar copper/aluminium interface. Aluminium-oxide is non-conductive and thus interrupts the flow of current.

Of course, there are countless issues with that theory, least of all the many reports of in-field failures. We recently covered [Will Prowse] studying the death of one of these 100 Ah LFP batteries from brand-new to failure under controlled circumstances. This clearly shows the thermal creep loosening up the connection and causing poor contact between the bus bar, the bolt and the terminal, with poor contact and thermal issues resulting.

Continue reading “Battle Born Explains How Its Battery Thermal Safety Works”

Using Metal Screws In Plastic Parts

Machine screws aren’t made for wood or sheet metal, they make specific screws for those applications. You probably also know there are special screws for plastic. But did you know there are at least two distinct types? In a recent video, [Lost in Tech] show us different types of plastic screws, including thermal camera shots of screws driving into 3D printed parts, along with tests using a torque driver.

We have often used “any old” screw in printed parts, which usually works OK. We’ve also used threaded inserts or captive nuts, classic choices. One of the issues with screws or inserts is that you have to get accurately sized holes in your 3D prints.

In addition to learning about the types of screws and how best to accommodate them, he also developed a free web-based tool that does all the math for you.

Of course, there are cases when you do need a threaded insert. In particular, the plastic screws will tend to wear the plastic each time you insert them. If you expect the screw to go in and out many times, this might not be the right technique for you. On the other hand, if you think you might remove and replace the screws a few dozen times over the life of the part, this might be attractive.

We’ve covered self-tapping screws in plastic before, but, as the video shows, not all of them are created equal. And, of course, there are always heat-set inserts.

Continue reading “Using Metal Screws In Plastic Parts”