Easy, Secure HTTPS With An ESP8266

Security has always been an issue with IoT devices. Off the shelf devices often have terrible security while DIY solutions can be complicated, needing recompilation every time a website’s fingerprint changes. [Johannes] wrote in to let us know he’s been working on a way to make HTTPS requests easier to do on ESP devices.

The normal ways to do HTTPS with an ESP8266 is to either use Fingerprints, or to use client.setInsecure(). Fingerprints require the user to know exactly which pages the ESP will connect to and extract the Fingerprints from each of those websites. Since the fingerprints change yearly, this means the fingerprint will have to be re-extracted and the code recompiled each time a fingerprint changes. The use of client.setInsecure() is, obviously, insecure. This may not be an issue for your project, but it might be for others.

[Johannes’] solution is to extract the trusted root certificates and store them in PROGMEM. This allows access to any web page, but the root certificates do expire as well. As opposed to the fingerprints, though, they expire after 20 years, rather than every year, so the program can run for a long time before needing recompilation. This solution also doesn’t require any manual steps – the build process runs a script that grabs the certificates and stores them in files so that they can be uploaded to the SPIFFS written to PROGMEM to be used during HTTPS requests.

He’s come up with a fairly straightforward way to have your IoT device connect to whichever web page you want, without having to recompile every once in a while. Hopefully, this will lead to better security for your IoT devices. Take a look at some previous work in this area.

Review: Calculator Kit Is Just A Few Hacks From Greatness

While most people are satisfied with a calculator application on their smartphone these days, there’s still something to be said for the old fashioned desk calculator. Maybe it’s the fact the batteries last long enough that you can’t remember the last time you changed them, or the feel of physical buttons under your fingers. It could even be the fact that it keeps your expensive smartphone from needing to sit out on the workbench. Whatever the reason, it’s not uncommon to see a real-life calculator (or two) wherever solder smoke tends to congregate.

Which is precisely the idea behind this DIY calculator kit. Available from the usual overseas retailers for about $15 USD, it has some hobbyist-oriented features such as the ability to decode resistor color bands, convert hexadecimal numbers, and calculate resistor values for driving LEDs. If you’re going to keep a knock-around calculator on your bench, why not build the thing yourself?

Given the dual nature of this product, a DIY electronics kit and a functional desk calculator for electronic hobbyists, it seems only appropriate to review both aspects of it individually. Which is good, since there may be more to this product than just the sum of its parts.

Continue reading “Review: Calculator Kit Is Just A Few Hacks From Greatness”

AVR Multi-Tool Learns The Latest Tricks

Like many of us who fiddle with microcontrollers, [Mike] and [Brian] often found themselves using an ISP programmer and a USB-to-serial adapter. But when they started working on the latest generation of ATtiny chips, they found themselves in need of a Unified Program, and Debug Interface (UPDI) programmer as well. So they decided to wrap all three functions into one handy open hardware gadget.

They call their creation the AVR General Purpose Programmer, or AVRgpp for short. It runs on an ATmega328P with a Pro Mini bootloader, which means that the programmer itself is fully compatible with the Arduino IDE. USB-to-serial capability is provided by a CH330N, and a MC14053 digital switch IC is used to select between talking to the AVRgpp’s onboard MCU or the target device.

A 128 x 32 I2C OLED and two push buttons are used to select the device’s current mode, and there’s a physical switch to select between 5 V or 3.3 V power for the target. There’s also a ST662 12 V regulator, as UPDI targets occasionally need a high voltage pulse to switch into programming mode. Everything is packaged up in a pocket-sized laser cut enclosure that you can easily toss in your bag.

[Mike] and [Brian] say they are considering putting the AVRgpp into small scale production if there’s enough interest, so let them know if you’d like to get one without having to build it yourself.

Updating The Language Of SPI Pin Labels To Remove Casual References To Slavery

This morning the Open Source Hardware Association (OSHWA) announced a resolution for changing the way SPI (Serial Peripheral Interface) pins are labelled on hardware and in datasheets. The protocol originally included MOSI/MISO references that stand for “Master Out, Slave In” and “Master In, Slave Out”. Some companies and individuals have stopped using these terms over the years, but an effort is being taken up to affect widespread change, lead by Nathan Seidle of Sparkfun.

The new language for SPI pin labeling recommends the use of SDO/SDI (Serial Data Out/In) for single-role hardware, and COPI/CIPO for “Controller Out, Peripheral In” and “Controller In, Peripheral Out” for devices that can be either the controller or the peripheral. The change also updates the “SS” (Slave Select) pin to use “CS” (Chip Select).

SPI is widely used in embedded system design and appears in a huge range of devices, with the pin labels published numerous times in everything from datasheets and application notes to written and video tutorials posted online. Changing the labels removes unnecessary references to slavery without affecting the technology itself. This move makes embedded engineering more inclusive, an ideal that’s easy to get behind.

[2022 Editor’s Note: The OSHWA changed its recommended naming to PICO/POCI for “Peripheral In, Controller Out” and “Peripheral Out, Controller In”. Fine by us! I’ve updated this throughout the rest of the article because it doesn’t change Mike’s original argument at all.]

Continue reading “Updating The Language Of SPI Pin Labels To Remove Casual References To Slavery”

Hacker Turns Thermal Clacker Into USB Keyboard

Back before there were laptops and subsequently, netbooks, there were these adorable thermal typewriter/word processors that are lovingly referred to by their fans as baby wedges or wedgies. These fascinating little machines can put words on paper two different ways: you can either use a prohibitively expensive little ribbon cartridge and regular copy paper, or you can go the easy route and get yourself a 96′ roll of thermal fax paper and type until you feel like tearing off the page.

[David] was lucky enough to pick up a Canon S-70 in working condition for next to nothing, thinking it would make an awesome USB keyboard, and we agree. The PSoC 5 that now controls it may be overkill, but it’s pretty affordable, and it was right there on the desk just waiting for a purpose. And bonus — it has enough I/O for all of those loud and lovely keyswitches.

One thing that keeps these baby wedges within the typewriter camp is the Shift Lock function, which can only be disengaged by pressing Shift and had its own discrete logic circuitry on the board before he was forced to remove it.

That little screen is pure word processor and was used to show the typing buffer — all the characters you have a chance to correct before the print head commits them to paper. In a win for word processors everywhere, the screen was repurposed to show the current word count.

He was kind enough to post his firmware as well as real-time footage of the build. Watch him demo it in the wild after the break, and then stick around for part one of the build saga.

Portable word processors were still being made ten years ago, though they were mostly aimed at the primary school market as keyboarding trainers. Our own [Tom Nardi] recently did a teardown of a model called The Writer that relies on IR to send files.

Continue reading “Hacker Turns Thermal Clacker Into USB Keyboard”

Vintage Keyboard Gets The QMK Treatment

While nobody could deny that computing technology has some a long way in the last few decades, there are many out there who believe peak keyboard was sometime before the turn of the new millennium. They prefer the look, feel, and especially the sounds, of those classic keyboards to what passes for an input device these days. So much so that it’s not uncommon to see one of these old mammoths get freshened up and pushed into service with a modern computer.

Which is exactly what [Juan Pablo Kutianski] has done with his Compaq MX-11800. This keyboard, which is actually a branded version of the Cherry G80-11800, really stands out in a crowd. With an integrated trackball and a two-row arrangement for the function keys, it’s not hard to see why he’d want to show it off. But while the hardware itself was solid, the features and capabilities of this old school keyboard left something to be desired.

The solution was to replace the keyboard’s original electronics with a Teensy++2.0 running the popular QMK firmware. This not only made the keyboard USB, but allowed [Juan] to tweak things such as the trackball sensitivity and add in support for layers and macros. All of which can be managed through VIA, a graphical configuration tool for QMK.

As we’ve seen in so many projects, the combination of QMK running on the Teensy is a powerful tool for getting the most out of your keyboard. Whether breathing new life into a vintage piece of hardware or creating something truly custom like our very own [Kristina Panos] recently did, it’s definitely something to keep in mind if you’re considering any keyboard hacking.

ESP32 Becomes Music Player In Under 40 Lines Of Code

The demo code for [XTronical]’s ESP32-based SD card music player is not even 40 lines long, though it will also require a few economical parts before it all works. Nevertheless, making a microcontroller play MP3s (and other formats) from an SD card is considerably simpler today than it was years ago.

Part of what makes this all work is I2S (Inter-IC Sound), a format for communicating PCM audio data between devices. Besides the ESP32, at the heart of it all is an SD card reader breakout board and the MAX98357A, which can be thought of as a combination I2S decoder and Class D amplifier. The ESP32 reads audio files from the SD card and uses an I2S audio library to send the I2S data stream to the MAX98357A (or two of them for stereo.) From there it is decoded automatically and audio gets pumped though attached speakers.

A few economical components, and only a handful of connections between them.

It’s amazing how much easier audio is to work with when one can take advantage of shuffling audio data around digitally, and the decoder handles multiple formats with an amplifier built in. You can see [XTronical]’s ESP32 player in action in the video embedded below.

Continue reading “ESP32 Becomes Music Player In Under 40 Lines Of Code”