Date and time handling is hard, that’s an ugly truth about software development we’ll all learn the hard way one day. Sure, it might seem like some trivial everyday thing that you can easily implement yourself without relying on a third-party library. I mean, it’s basically just adding seconds on top of one another, roll them over to minutes, and from there keep rolling to hours, days, months, up until you hit the years. Throw in the occasional extra day every fourth February, and you’re good to go, right?
Well, obviously not. Assuming you thought about leap years in the first place — which sadly isn’t a given — there are a few exceptions that for instance cause the years 1900 and 2100 to be regular years, while the year 2000 was still a leap year. And then there’s leap seconds, which occur irregularly. But there are still more gotchas lying in wait. Case in point: back in May, a faulty lunar leap month handling in the Chinese calendar turned Samsung phones all over China into bricks. And while you may not plan to ever add support for non-Gregorian calendars to your own project, it’s just one more example of unanticipated peculiarities gone wild. Except, Samsung did everything right here.
So what happened?
Continue reading “Samsung’s Leap Month Bug Teaches Not To Skimp On Testing”
Testing is a key part of any product development cycle. Done right, it turns up unknown bugs and problems, and allows for them to be fixed prior to shipment. However, it can be a costly and time-consuming process. The [Bay Libre] team needed to do some work on power management, but the hardware required was just a little on the expensive side. What else does a hacker do, but build their own?
Enter the Thermo-Regulated Power Measurement Platform. It’s a device designed to control the die temperature of a chip during process characterization. This is where a chip, in this case the iMX8MQ, is run at a variety of temperatures, voltages, and frequencies to determine its performance under various conditions. This data guides the parameters used to run the chip in actual use, to best manage its power consumption and thermal performance.
The rig consists of a Peltier element with controller, a heatsink, and a fan. This is lashed up to a series of Python scripts that both control the chip temperature and run through the various testing regimes. Thanks to this automation, what would normally be a day’s work for an engineer can now be completed in just two hours.
Through a few smart component choices, the team accomplished the job at around one-tenth of the cost of commercial grade hardware. Granted, the average hacker probably won’t find themselves doing process characterization for cutting-edge silicon on a regular basis. Still, this project shows the value in building custom hardware to ease the testing process.
Testing is key to success in production. Custom jigs can make for light work when large orders come in, and we’ve run a primer on various testing techniques, too.
When you build one-off projects for yourself, if it doesn’t work right the first time, it’s a nuisance. You go back to the bench, rework it, and move on with life. The equation changes considerably when you’re building things to sell to someone. Once you take money for your thing, you have to support it, and anything that goes out the door busted is money out of your pocket.
[Brian Lough] ran into this fact of life recently when the widget he sells on Tindie became popular enough that he landed an order for 100 units. Not willing to cut corners on testing but also not interested in spending days on the task, he built this automated test jig to handle the job for him. The widget in question is the “Power BLough-R”, a USB pass-through device that strips the 5-volt from the line while letting the data come through; it’s useful for preventing 3D-printers from being backfed when connected to Octoprint. The tester is very much a tactical build, with a Nano in a breakout board wired to a couple of USB connectors. When the widget is connected to the tester, a complete series of checks make sure that there are no wiring errors, and the results are logged to the serial console. [Brian] now has complete confidence that each unit works before going out the door, and what’s more, the tester shaved almost a minute off each manual test. Check in out in action in the video below.
We’ve featured quite a few of [Brian]’s projects before. You may remember his Tetris-themed YouTube subscriber counter, or his seven-segment shoelace display.
Continue reading “Custom Jig Makes Short Work Of Product Testing”