Supercon: Ruth Grace Wong And Firmware From The Firehose

Firmware and software are both just code, right? How different could the code that runs Internet-scale distributed web stuff be from the code that runs a tiny microcontroller brain inside a personal hydroponics device? Night and day!

Ruth Grace Wong works in the former world, but moonlights as a manufacturing engineer with some friends. Their product had pre-existing firmware that contained (at least) one bug, and Ruth’s job was to find it. The code in question was written by the Chinese PCB engineer, who knew the electronics intimately but who had no software background, providing Ruth an opportunity to jump head-first into the rawest of raw embedded programming. Spoiler alert: she found the bug and learned a lot about firmware along the way. This talk follows her along the adventure.

“The code is very well documented, in Chinese” but the variable names are insanely non-descriptive. Similarly, while the PCB engineer knows full well what a 24C02 is, if you’re a software geek that might as well be Chinese. As you’d expect, web searches came to the rescue on both fronts.

The bug ended up hiding in a logical flaw in the PWM-setting code inside an interrupt service routine, and it kept the fan from ever coming full on. Once found, it was easily fixed. But getting to the point where you understand the codebase deeply enough to know where to look is four-fifths of the battle. Heck, setting up the toolchain alone can take a day or two.

If you’re a fellow software type, Ruth’s talk (embedded below) will give you a quick glimpse into the outer few layers of the onion that is embedded firmware development, from a familiar viewpoint. Give her quick and value-packed talk a watch! Grizzled hardware veterans will nod along, and maybe even gain a little insight into how our code looks to “them”.

Continue reading “Supercon: Ruth Grace Wong And Firmware From The Firehose”

Hackaday Podcast 007: Everything Microcontrollers, Deadly Clock Accuracy, CT X-Rays, Mountains Of E-Waste

Elliot Williams and Mike Szczys look at all that’s happening in hackerdom. This week we dive deep into super-accurate clock chips, SPI and microcontroller trickery, a new (and cheap) part on the microcontroller block, touch-sensitive cloth, and taking a home X-ray to the third dimension. We’re saying our goodbyes to the magnificent A380, looking with skepticism on the V2V tech known as DSRC, and also trying to predict weather with automotive data. And finally, what’s the deal with that growing problem of electronic waste?

Links for all discussed on the show are found below. As always, join in the comments below as we’ll be watching those as we work on next week’s episode!

Take a look at the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!

Direct download (60 MB or so.)

Continue reading “Hackaday Podcast 007: Everything Microcontrollers, Deadly Clock Accuracy, CT X-Rays, Mountains Of E-Waste”

Building A Simple Python API For Internet Of Things Gadgets

It’s no secret that I rather enjoy connecting things to the Internet for fun and profit. One of the tricks I’ve learned along the way is to spin up simple APIs that can be used when prototyping a project. It’s easy to do, and simple to understand so I’m happy to share what has worked for me, using Web2Py as the example (with guest appearances from ESP8266 and NodeMCU).

Barring the times I’m just being silly, there are two reasons I might do this. Most commonly I’ll need to collect data from a device, typically to be stored for later analysis but occasionally to trigger some action on a server in the cloud. Less commonly, I’ll need a device to change its behavior based on instructions received via the Internet.

Etherscan is an example of an API that saves me a lot of work, letting me pull data from Ethereum using a variety of devices.

In the former case, my first option has always been to use IoT frameworks like Thingsboard or Ubidots to receive and display data. They have the advantage of being easy to use, and have rich features. They can even react to data and send instruction back to devices. In the latter case, I usually find myself using an application programming interface (API) – some service open on the Internet that my device can easily request data from, for example the weather, blockchain transactions, or new email notifications.

Occasionally, I end up with a type of data that requires processing or is not well structured for storage on these services, or else I need a device to request data that is private or that no one is presently offering. Most commonly, I need to change some parameter in a few connected devices without the trouble of finding them, opening all the cases, and reprogramming them all.

At these times it’s useful to be able to build simple, short-lived services that fill in these gaps during prototyping. Far from being a secure or consumer-ready product, we just need something we can try out to see if an idea is worth developing further. There are many valid ways to do this, but my first choice is Web2Py, a relatively easy to use open-source framework for developing web applications in Python. It supports both Python 2.7 and 3.0, although we’ll be using Python 3 today.

Continue reading “Building A Simple Python API For Internet Of Things Gadgets”

Retrotechtacular: How Not To Design With Transistors

Consider the plight of a mid-career or even freshly minted electrical engineer in 1960. He or she was perched precariously between two worlds – the proven, practical, and well-supported world of vacuum tube electronics, and the exciting, new but as yet unproven world of the transistor. The solid-state devices had only started making inroads into electronic products relatively recently, and mass production techniques were starting to drive the cost per unit down enough to start including them in your designs. But, your company has a long history with hot glass and no experience with flecks of silicon. What to do?

To answer that question, you might have turned to this helpful guide, “Tubes and Transistors: A Comparative Guide” (PDF link). The fancy booklet, with a great graphic design that our own [Joe Kim] would absolutely love, was the product of the Electron Tube Information Council, an apparently defunct group representing the interests of the vacuum tube manufacturers. Just reading the introduction of this propaganda piece reveals just how worried companies like RCA, General Electric, and Westinghouse must have been as the 1950s turned into the 1960s. The booklet was clearly aimed directly at engineers and sought to persuade them of the vacuum tube’s continued relevance and long-term viability. They helpfully explain that tubes are a reliable, proven technology that had powered decades of designs, and that innovations such as heaterless cathodes and miniaturization were just around the corner. Transistors, we’re told, suffer from “spread of characteristics” that correctly describes the state of materials engineering of silicon and germanium at the time, a thornier problem than dealing with glass and wires but that they had to know would be solved within a few years.

With cherry-picked facts and figures, the booklet makes what was probably in 1960 a persuasive case for sticking with tubes. But the Electron Tube Information Council was fighting a losing battle, and within a decade of swamping engineers with this book, the industry had largely shifted to the transistor. Careers were disrupted, jobs disappeared, and fortunes were lost, but the industry pressed forward as it always does. Still, it’s understandable why they tried so hard to stem the tide with a book like this. The whole PDF is worth a look, and we’d love to have a hard copy just for nostalgia’s sake.

Thanks to [David Gustafik] for the tip.

Badge.Team: Badges Get A Platform

Electronic conference badges are now an accepted part of the lifeblood of our community, with even the simplest of events now sporting a fully functional computer as an eye-catching PCB on a lanyard. Event schedules and applications are shipped on them, and the more sophisticated ones have app libraries and support development communities of their own.

The trouble is that so often those badges fail to live up to their promise, and one reason behind that stems from the enormity of the task facing a badge team when it comes to firmware for a modern badge. There is some fascinating news from the Netherlands  that might reduce some of those firmware woes though, badge.team is a freshly-launched project that provides a ready-made badge firmware with the promise of both stability and long-term support. If you’re making a badge, or even a one-off device using the ESP32, this is a project worth checking out.

Continue reading “Badge.Team: Badges Get A Platform”

Ask Hackaday: Is There A Legit Use For Operator Precedence?

Computing is really all about order. If you can take data, apply an operation to it, and get the same result every single time, then you have a stable and reliable computing system.

So it makes total sense that there is Operator Precedence. This is also called Order of Operations, and it dictates which computations will be performed first, and which will be performed last. To get the same results every time, you must perform addition, multiplication, power functions, bitwise math, and all other calculations in a codified order.

The question I’ve had on my mind lately is, does this matter to us or just the compiler?

Continue reading “Ask Hackaday: Is There A Legit Use For Operator Precedence?”

Electron Microscopes Are Awesome: Everything You Didn’t Know You Wanted To Know

Electron microscopes were once the turf of research laboratories that could foot the hefty bill of procuring and maintaining such equipment. But old models have been finding their way into the hands of eager individuals who are giving us an inside look at the rare equipment. Before you start scouring Craigslist, go on a crash course of what you need to know with Adam McComb’s Hacker’s Guide to Electron Microscopy. He presented the talk at the 2018 Hackaday Superconference and the recording was just published, you’ll find it below.

Continue reading “Electron Microscopes Are Awesome: Everything You Didn’t Know You Wanted To Know”