Hacking This Smart Bulb Is Almost Too Easy

The regular Hackaday reader no longer needs to be reminded about how popular the ESP8266 is; they see the evidence of that several times a day. But what might not be quite so obvious is that it isn’t just us hacker types that are in love with the inexpensive IoT microcontroller, it’s also popping up more and more frequently in commercial products.

As [Majenko] demonstrates, one of those ESP-powered devices is the LOHAS Smart LED Bulb. Upon cracking one open, he found that these relatively low-cost bulbs are little more than a standard ESP8266 chip and a couple of LED drivers. He wanted to see how hard it would be to get his own code running on the bulb, and by the looks of it, it took longer to get the thing open then it did to load it up with a custom firmware.

The bulb’s PCB features the aforementioned ESP8266, a 1MB 25Q80 flash chip, and MY9231 LED drivers. Whoever put the board together was nice enough to label the RX, TX, and GPIO test points, though [Majenko] notes that what’s labeled as 3.3 V appears dead. With a ESP-01 programmer wired up to the board and the appropriate board settings (which he provides), you can use the Arduino IDE to upload whatever you like to it.

Running “Hello World” on a smart bulb is fun and all, but what about kicking on those LEDs? [Majenko] found a library that works with the MY9231 drivers, and it didn’t take long to figure out which of the ESP’s pins were used to communicate with them. All in all, he said it was far easier than he expected.

You’ll probably want to put this bulb back into service after reprogramming, so [Majenko] advises caution when cracking open the shell. There are clips holding on the diffuser which he assures us are going to break no matter what you do, plus some silicone adhesive. He suggests super glue to hold it together when you’re done programming it, and using an OTA firmware so you don’t need to get back in there.

In the past we’ve shown how some hackers are rolling their own smart bulb hardware, but with cheap commercial offerings that are so easily hackable, it frankly doesn’t seem worth the effort. On the other hand, an influx of cheap ESP-powered bulbs isn’t all good news.

Building A Development Board For The STM32 G0 Series

When [Andy Brown] recently tripped over ST’s new G0 series of MCUs, he figured after some research that the best way to learn everything there’s to know about the STM32G0xx by making his own development board based around the STM32G081. The result is a Nucleo-style board, breaking out all pins to convenient 2.54 mm headers, and with a number of niceties, such as an on-board coin cell and 32.768 kHz LSE oscillator for RTC use and three different power supplies (3.3 V, 2.5 V, and 1.8 V) for the MCU.

The board is programmed with an external ST-Link programmer that connects to the SWD interface on the MCU, with a 20-pin programming header provided. While by no means small or compact, it makes for very easy breadboarding and prototyping, with all 2.54 mm headers accessible from the bottom and top.

As for the STM32G0 series itself, the jury is still out on its performance compared to the F0. The former swaps the Cortex-M0 core for an M0+, with a reduced pipeline length (3 stages in the G0) but increased frequency (64 MHz versus 48 MHz). The G0 has a little bit more SRAM, but so far less Flash storage. According to ARM, this MCU range is designed to remove any need to still use an 8-bit MCU. Big claims, indeed.

The biggest issue which [Andy] had while developing this board was probably with the CH340 USB-UART chip. Ordering them from AliExpress as is common, the CH340G ICs he got just wouldn’t work on the first board revision, forcing him to switch to the CH340E and requiring a board respin. This version has an internal oscillator and as a bonus even came in the original tape packaging when it arrived, instead of in a plastic baggy like with the CH340G parts.

See a video of [Andy] going through the design after the break.

Continue reading “Building A Development Board For The STM32 G0 Series”

A Wedding Gift Fit For A Hardware Hacker

If you read Hackaday on a regular basis, there are some names you will have seen more than once. People who continually produce fascinating and inventive projects that amaze and delight us, and who always keep us coming back for more. One such hacker is [Jeroen Domburg], perhaps better known in these pages by the handle [Sprite_TM], who has never failed to delight us in this respect.

Today is a special day for [Jeroen] for it is his wedding day, and his friend [Maarten Tromp] has decided to surprise him and his wife [Mingming] with a special gift. At first sight it is simply a pair of blinky badges in the shape of a bride and groom, but closer examination reveals much more. The PCBs are studded with WS2812 addressable LEDs controlled by an ESP32 module and powered by a small LiPo battery, and the clever part lies in the software. The two badges communicate via Bluetooth, allowing them to both synchronise their flashing and flash ever faster as the couple come closer to each other.

The write-up is an interesting tale of the tribulations of designing a badge, from which we take away that buying cheap LEDs may be a false economy. A surprise was that the black-cased and white-cased versions of the LEDs had different timings, and they proved prone to failure.

We wish the happy couple all the best, thank [Sprite_TM] for all he has given us over the years, and look forward to seeing his future projects.

New Part Day: The $15 ESP32 With Cellular

Cruise around AliExpress for long enough and you’ll find some interesting new hardware. The latest is the TTGO T-Call, an ESP32 breakout board that also has a cellular modem. Yes, it’s only a 2G modem, but that still works in a lot of places, and the whole thing is $15.

On board the TTGO T-Cal is the ESP-WROVER-B, the same module you all know and love that features a dual-core ESP running at 240 MHz with 4 MB of Flash and 8 MB of SRAM. Add to this WiFi and Bluetooth, and you have a capable microcontroller platform. Of note is that this board includes a USB-C port, ostensibly wired so that it behaves like a normal USB micro port. That’s neat, 2019 is the year USB C connectors became cheaper than USB micro connectors.

In addition to the ESP32 module, there’s also cellular in the form of a SIM800 module. This module has been around for a while and used in many, many cellular-connected projects and products like the ZeroPhone. This module is only a 2G module, and that’ll be going away shortly (if not already) in built-up areas, but this can serve as a building block for modules that have more Gees than a 2G module. That said, if you’re looking for a WiFi and cellular bridge for fifteen bucks, you could do a lot worse for a lot more money.

ESP32 Gets Advance Windowed Apps Using This VGA GUI Library

We featured [Fabrizio Di Vittorio]’s FabGL library for the ESP32 back in April of this year. This library allows VGA output using a simple resistor based DAC (3 resistors for 8 colors; 6 resistors for 64 colors), and includes functions for PS/2 mouse and keyboard input, a graphics library, and many of the miscellaneous functions you might need to develop games on the ESP32. Now, a GUI interface library has been added to ease application development.

The GUI, of course, runs on the VGA output. The library includes what you’d expect from a minimal windowing GUI, like keyboard and mouse support, windows with the usual minimize/maximize/close controls, and modal and message dialog boxes. For input controls, there are labels, text boxes, buttons, radio buttons, checkboxes, normal and editable combo boxes, and listboxes — you know, pretty much everything you need to develop a modern GUI application. All the code is open-source (GPL 3.0) and in the GitHub repo.

While the original FabGL had a game-development orientation, the addition of this new GUI functionality opens up a new range of applications. If you want to find out more about using the FabGL library, you can check out our previous coverage of the mostly game-oriented functions.

You can get a look at the new GUI functions in action in the video, after the break.

Continue reading “ESP32 Gets Advance Windowed Apps Using This VGA GUI Library”

A 3D Printed Micro:Bit Nunchuk

As [Paul Bardini] explains on the Thingiverse page for his “Micro:Bit Hand Controller”, the Bluetooth radio baked into the BBC’s educational microcontroller makes it an ideal choice for remotely controlling things. You just need to give it a nice enclosure, a joystick, a couple of buttons, and away you go. You can even use the integrated accelerometer as another axis of control. This is starting to sound a bit familiar, especially to gamers.

While it might not come with the Official Nintendo Seal of Quality, the 3D printable enclosure [Paul] has come up with for the Micro:Bit certainly takes more than a little inspiration from the iconic Wii “Nunchuck” controller. He’s jostled around the positions of the joystick and momentary buttons a bit, but it still has that iconic one-handed ergonomic styling.

In a particularly nice touch, [Paul] has built his controller around a Micro:Bit breakout board from SparkFun that allows you to plug the microcontroller in via its edge connector. This means you can pull the board out and still use it in other projects. The only other connection to the controller leads to the battery, which uses a two pin JST-PH plug that can easily be removed.

Thanks to this breakout board, the internal wiring is exceptionally simple. The joystick (the type used in a PS2 controller) and the buttons are simply soldered directly to pins on the breakout board. No passives required, just a few short lengths of flexible wiring to snake through the printed enclosure.

The Thingiverse page only has the STLs for the two halves of the controller, and no source code for the Micro:Bit itself. But it shouldn’t be terribly hard to piece together the basic functionality with example code that’s floating around out there. Especially since you can run Python on them now. Of course, you could also add Bluetooth to the original Wii version if you’re not looking to reinvent the wheel nunchuck.

Understanding Elliptic Curve Cryptography And Embedded Security

We all know the usual jokes about the ‘S’ in ‘IoT’ standing for ‘Security’. It’s hardly a secret that security in embedded, networked devices (‘IoT devices’) is all too often a last-minute task that gets left to whichever intern was unfortunate enough to walk first into the office that day. Inspired by this situation, All About Circuits is publishing a series of articles on embedded security, with a strong focus on network security.

In addition to the primer article, so far they have covered the Diffie-Hellman exchange (using prime numbers, exponentiation and modular arithmetic) and the evolution of this exchange using elliptic curve cryptography (ECC) which prevents anyone from brute-forcing the key. Barring any quantum computers, naturally. All three articles should be understandable by anyone, with a simple, step-by-step format.

The upcoming articles will cover implementing security on microcontrollers specifically.  For those who cannot wait to learn more, Wikipedia has a number of articles on the topic of Elliptic Curve Cryptography (comparing it to the more older and still very common RSA encryption) specifically, as well as the Elliptic-Curve Diffie-Hellman key agreement protocol as discussed in the All About Circuits article.

A detail of note here is that the hardest problem in secure communications isn’t to keep the communications going, but to securely exchange the keys in the first place. That’s why a much much computationally expensive key exchange scheme using an asymmetric (or public-key) cryptography scheme  is generally used to set up the second part of the communications, which would use a much faster symmetric-key cryptography scheme, where both parties have the means to decode and encode messages using the same private key.

All the math aside, one does have to wonder about how one might denote ‘secure’ IoT. Somehow ‘SIoT’ doesn’t feel very catchy.