PlatformIO And Visual Studio Take Over The World

In a recent post, I talked about using the “Blue Pill” STM32 module with the Arduino IDE. I’m not a big fan of the Arduino IDE, but I will admit it is simple to use which makes it good for simple things.

I’m not a big fan of integrated development environments (IDE), in general. I’ve used plenty of them, especially when they are tightly tied to the tool I’m trying to use at the time. But when I’m not doing anything special, I tend to just write my code in emacs. Thinking about it, I suppose I really don’t mind an IDE if it has tools that actually help me. But if it is just a text editor and launches a few commands, I can do that from emacs or another editor of my choice. The chances that your favorite IDE is going to have as much editing capability and customization as emacs are close to zero. Even if you don’t like emacs, why learn another editor if there isn’t a clear benefit in doing so?

There are ways, of course, to use other tools with the Arduino and other frameworks and I decided to start looking at them. After all, how hard can it be to build Arduino code? If you want to jump straight to the punch line, you can check out the video, below.

Continue reading “PlatformIO And Visual Studio Take Over The World”

A multifactor authentication device showing TOTP codes

An ESP32 MultiFactor TOTP Generator

MFA, or multifactor authentication, is a standard security feature these days. However, it can be a drag to constantly reach into one’s pocket, scroll to Google Authenticator (other MFA applications are available!), and find the correct TOTP code to log in to a site for a short while. [Allan Oricil] felt this pain point, so they took the problem by the horns and created a desktop MFA TOTP generator to make life just that little bit easier.

TOTP, which stands for Time-based One-Time Password, is a security measure that uses a device or application to provide unique codes that expire after a short time. Two-factor authentication requires a physical item (something you have), such as a key or swipe card, and knowledge of a fact (something you know), like a password, rather than relying on a single factor. This approach ensures a higher level of security. [Allan]’s project is a physical thing one would use with a password or key file.

Continue reading “An ESP32 MultiFactor TOTP Generator”

Hacking A €15 8051-Based Portable Soldering Iron With Custom Firmware

With soldering irons being so incredibly useful, and coming on the heels of the success of a range of portable, all-in-one soldering irons from the likes of Waveshare and Pine64, it’s little wonder that you can get such devices for as little as 10 – 15 Euro from websites like AliExpress. Making for both a great impulse buy and reverse-engineering target, [Aaron Christophel] got his mittens on one and set to work on figuring out its secrets.

The results are covered in a brief video, as well as a Twitter thread, where this T12 soldering iron’s guts are splayed around and reprogrammed in all their glory. Despite the MCU on the PCB having had its markings removed, some prodding and poking around revealed it to be an STC8H3K62S2, an 8051-based MCU running at a blistering 11 MHz. As a supported PlaformIO target, reprogramming the MCU wasn’t too complicated after wiring up a USB-TTL serial adapter.

Completing this initial foray into these cheap T12 soldering irons is the GitHub repository, which contains the pin-outs, wiring diagrams and further information. Although [Aaron] indicates that he’ll likely not pursuing further development, the mixed responses by people to the overall quality of the firmware on the as-purchased T12 may inspire others to give it a shake.

Continue reading “Hacking A €15 8051-Based Portable Soldering Iron With Custom Firmware”

ESP32 Gets A Nifty Serial Console Library

Sometimes you need to get a project to talk to you, so you can see what’s going on inside. The ESP32 console Arduino library from [jbtronics] promises just that.

The library adds a simple serial console to the ESP32, and is compatible with the Arduino ecosystem to boot. It’s set up to allow the easy addition of custom commands so you can tweak the console to suit your own projects. It’s remarkably complete with nifty features, too. There’s autocomplete as well as a navigable command history – the sorts of features you only expect from a modern OS terminal. A bunch of system commands are built-in, too, for checking the status of things like the memory, network interface, and so on.

The tool is available via the Arduino library manager or the PlatformIO registry. You’ll want to use it with a VT-100 compatible terminal like PuTTY or similar, which lets you use all the fancy features including color output. [jbtronics] hopes to port it to the ESP8266 soon, too!

We’ve seen some other great serial tools of late, too. If you’re brewing up your own nifty console hacks, be sure to drop us a line!

 

 

This DIY UPDI Programmer Is Nice And Cheap

[Daumemo] likes experimenting with DIY electronics, and like many people, eventually ran across an AVR microcontroller with a Unified Program and Debug Interface (UPDI). One option is of course to purchase an UPDI programmer, but an even better solution was to make a DIY USB version from nice, cheap parts.

Programming an Attiny404 over the UPDI interface.

UPDI is an interface for external programming and on-chip debugging of microcontrollers, and [Daumemo]’s solution is based on the jtag2updi project. It combines an Arduino Nano (in this case, a clone) with a single resistor, a single capacitor, and a six pin angled header (with a cleverly bent pin) to enable programming UPDI devices over a USB connection. [Daumemo] is happy to report that the device works just fine in both Microchip Studio with AVRDUDE, or PlatformIO.

Is an Arduino Nano a bit overpowered in this role? Maybe, but the price is certainly right. There’s no need for a custom PCB either, since everything can be soldered direct to the Nano board. A matching 3D printed enclosure is about all that’s needed to make a robust and reliable DIY USB UPDI programmer out of a handful of parts, and that sounds good to us.

On the other hand, if you do find yourself making custom PCBs, you may be interested in another of [Daumemo]’s DIY projects: a printable structure to turn a rotary tool into a PCB drill press.

Arming With An OS

We see tons of projects with the infamous “Blue Pill” STM32 boards. They are cheap and plentiful and have a lot of great features, or at least they were before the chip shortage. I recently picked up a “Black Pill”, which is very similar but has an even more powerful processor. For a few bucks, you get an ARM CPU that can run at 100 MHz (but with USB, probably 96 MHz). There’s 512 kB of flash and 128 kB of RAM. There’s a USB type C port, and even a button and an LED onboard. The thing fits on a breadboard and you can program it with a cheap STLink dongle which costs about $10.

The Black Pill module on a breadboard.

Of course, you then have to consider the software. The STM32Cube stuff is a lot to set up and learn but it does let you do just about anything you can imagine. Then there is the STM32Duino plug-in that lets you use it as a beefy Arduino. That works and is easy enough to set up. However, there’s also Mbed. The only problem is that Mbed doesn’t work right out of the box. Turns out, though, it isn’t that hard to set up. I’ll show you how easy it is to get things going and, next time, I’ll show you a practical example of a USB peripheral that uses the mBed RTOS features.

First Steps

Obviously, you are going to need a Black Pill. There are at least two choices but for as cheap as they are there is little reason not to get the STM32F411 version that has more memory. The DIP form factor will fit in whatever breadboard you happen to have and a USB C cable will power the board so unless you are driving a lot of external circuitry, you probably don’t need an external supply.

Continue reading “Arming With An OS”

An ESP32 Development Board For Sailors

[Matti Airas] wanted to have a better electronics platform for making his boat smarter, more connected, and safer. He found traditional marine electronics expensive and not suited for hacking and tinkering. There was also the issue of lack of interoperability between device generations from the same supplier and between different brands. This led him to design the Sailor Hat with ESP32 — a marine specific, open source hardware development board.

Applications include all kinds of sensor and control interfaces for the boat, such as measurement of fuel or water level, engine RPM, anchoring chain length counter, or setting up smart lighting or smart refrigeration control. The board is designed to work with the traditional NMEA 2000 standard, as well as with Signal K. NMEA 2000 is standardized as IEC 61162-3, but isn’t open source or free. Signal K, on the other hand, is free and open source, and can co-exist alongside NMEA 2000.

The marine environment can be pretty harsh with extremes of temperature, rain, humidity, condensation and vibration. Boats, just like automobiles, have a notoriously noisy electrical environment and [Matti] has paid special attention to noise and surge suppression throughout the board. The board can work with either 12 V or 24 V bus systems since the on board DC-DC converter is rated up to 32 V input. Connections between the board and the outside world need to be very robust, so it is designed to accept various types of connectors depending on how robust you want it to be.

The Sailor Hat is based around a standard ESP32-WROOM-32 module. Interfaces include a CAN bus transceiver, opto-coupled input and output, I2C, 1-wire and QWIIC interfaces, USB Micro-B programming conector, plus a couple of buttons and LEDs. All of the ESP32 GPIO pins are terminated on a GPIO header, with jumper options to disable terminations to the standard interfaces and instead route them to the GPIO header as needed. Additionally, there’s a generous prototyping area to add additional hardware to the board. Hardware design files are hosted on the project repository on GitHub.

On the software side, there are several frameworks that can be used, with PlatformIO, SensESP, ESPHome and Visual Studio Code being the recommended choices. Or you could use any of the widely available SDK’s for the ESP32 platform — Espressif SDK, Arduino Core for ESP32, MicroPython, NodeMCU or Rust.

[Matti]’s NMEA 2000 USB gateway example is a good way to get a grip on hardware assembly and software installation required to build a practical project using the Sailor Hat. The board is designed to withstand a harsh electrical environment. But it’s mechanical installation obviously requires greater care if it has to survive marine applications. The Sailor Hat can be installed in commonly available, 100x68x50 mm or larger plastic waterproof enclosures, rated for IP65 or higher. The bulkhead connectors and cable glands also need to be appropriately rated, and the enclosure may possibly need a IP68 rated ventilation plug to take care of environmental cycling within the enclosure.