Showing a Raspberry Pi 4 board connected to an ESP32 devboard using jumper wires for the purposes of this project

ESP-Hosted Turns ESP32 Into Linux WiFi/BT Adapter

While we are used to USB WiFi adapters, embedded devices typically use SDIO WiFi cards, and for good reasons – they’re way more low-power, don’t take up a USB port, don’t require a power-sipping USB hub, and the SDIO interface is widely available. However, SDIO cards and modules tend to be obscure and proprietary beyond reason. Enter ESP-Hosted – Espressif’s firmware and driver combination for ESP32 (press release)(GitHub), making your ESP32 into a WiFi module for either your Linux computer (ESP-Hosted-NG) or MCU (ESP-Hosted-FG). In particular, ESP-Hosted-NG his turns your SPI- or SDIO-connected ESP32 (including -S2/S3/C2/C3/C6 into a WiFi card, quite speedy and natively supported by the Linux network stack, as opposed to something like an AT command mode.

We’ve seen this done with ESP8266 before – repurposing an ESP8089 driver from sources found online, making an ESP8266 into a $2 WiFi adapter for something like a Pi. The ESP-Hosted project is Espressif-supported, and it works on the entire ESP32 lineup, through an SDIO or even SPI interface! It supports 802.11b/g/n and even Bluetooth, up to BLE5, either over an extra UART channel or the same SDIO/SPI channel; you can even get BT audio over I2S. If you have an SPI/SDIO port free and an ESP32 module handy, this might just be the perfect WiFi card for your Linux project!

There are some limitations – for instance, you can’t do AP mode in the NG (Linux-compatible) version. Also, part of the firmware has blobs in it, but a lot of the firmware and all of the driver are modifiable in case you need your ESP32 to do even more than Espressif has coded in – this is not fully open-source firmware, but it’s definitely way more than the Broadcom’s proprietary onboard Raspberry Pi WiFi chip. There’s plenty of documentation, and even some fun features like raw transport layer access. Also, of note is that this project supports ESP32-C6, which means you can equip your project with a RISC-V-based WiFi adapter.

Title image from [zhichunlee].

M.2 For Hackers – Expand Your Laptop

You’ve seen M.2 cards in modern laptops already. If you’re buying an SSD today, it’s most likely an M.2 one. Many of our laptops contain M.2 WiFi cards, the consumer-oriented WWAN cards now come in M.2, and every now and then we see M.2 cards that defy our expectations. Nowadays, using M.2 is one of the most viable ways for adding new features to your laptop. I have found that the M.2 standard is quite accessible and also very hackable, and I would like to demonstrate that to you.

If you ever searched the Web trying to understand what makes M.2 tick, you might’ve found one of the many confusing articles which just transcribe stuff out of the M.2 specification PDF, and make things look more complicated than they actually are. Let’s instead look at M.2 real-world use. Today, I’ll show you the M.2 devices you will encounter in the wild, and teach you what you need to know to make use of them. In part 2, I will show you how to build your own M.2 cards and card-accepting devices, too!

Well Thought-Out, Mostly

You can genuinely appreciate the M.2 standard once you start looking into it, especially if you have worked with mPCIe devices for some amount of time. mPCIe is what we’ve been using for all these years, and it gradually became a mish-mash of hardly-compatible pinouts. As manufacturers thought up all kinds of devices they could embed, you’d find hacks like mSATA and WWAN coexistence extensions, and the lack of standardization is noticeable in things like mPCIe WWAN modems as soon as you need something like UART or PCM. The M.2 specification, thankfully, accounted for all of these lessons.

Continue reading “M.2 For Hackers – Expand Your Laptop”

New Part Day: SD NAND Are Surface Mount Chips That Work Like An SD Card

SD cards have long been a favorite with microcontroller hobbyists. Cheap, readily available, and easily interfaced, they remain a staple for small projects that need to store a lot of data. Now, they’re available in chip form! These are known as SD NAND parts that emulate the SD card interface itself.

[LadyAda] recently gave them a test-drive after spotting a tweet from [Greg Davill] (who we’re familiar with thanks to his excellent LED cubes). The devices are manufactured by XTX Technology and available from LCSC in a range of 1, 2, 4, and 8 GB sizes. [Ivan Grokhotkov] also illuminated a similar device from another maker in a reply to [Greg’s] original tweet, so there may be more sources out there.

These chips come in standard LGA8 surface mount package and can be easily soldered to a board, offering mechanical and manufacturing benefits versus using a normal SD or microSD card in a slot-type connector. Also, unlike other SMD flash memory parts, they handle all the file system details and wear levelling for you! With the inflation of SD card sizes, it’s also difficult to find these on the shelf in normal cards these days.

[Adafruit] plan to have a breakout for these parts out soon with a level shifter included for ease of use. We can imagine these chips finding their way into all manner of datalogger projects, since they can be ordered with other parts and permanently soldered into a design. If you’ve got a particularly good idea where these chips would prove useful, sound off in the comments. Video after the break.

Continue reading “New Part Day: SD NAND Are Surface Mount Chips That Work Like An SD Card”

Raspberry Pi $2 WiFi Through Epic SDIO Hack

These are the times that we live in: the Raspberry Pi Zero comes out — a full freaking Linux computer on a chip for $5 — and people complain that it doesn’t have this or that. Top place on the list of desiderata is probably a tie between audio out and WiFi connectivity. USB is a solution for both of these, but with one USB port it’s going to be a scarce commodity, so any help is welcome. hacker [ajlitt] is looking for a way out of the WiFi bind. His solution? The Raspberry Pi series of chips has a special function on a bunch of the GPIO pins that make it easier to talk to SDIO devices. SDIO is an extension of the SPI-like protocol that’s used with SD memory cards. The idea with SDIO was that you could plug a GPS or something into your PDA’s SD card slot. We don’t have PDAs anymore, but the SDIO spec remains.

[ajlitt] dug up an SDIO driver for the ESP8089 chip, and found that you can liberate the ESP8266’s SPI bus by removing a flash memory chip that’s taking up the SPI lines. Connect the SPI lines on the ESP8266 to the SDIO lines on the Raspberry Pi, and the rest is taken care of by the drivers. “The rest”, by the way, includes bringing the ESP’s processor up, dumping new firmware into it over the SPI/SDIO lines to convince it to act as an SDIO WiFi adapter, and all the rest of the hardware communication stuff that drivers do.

The result is WiFi connectivity without USB, requiring only some reasonably fine-pitch soldering, and unlike this hack you don’t have to worry about USB bus contention. So now you can add a $2 WiFi board to you $5 computer and you’ve still got the USB free. It’s not as fast as a dedicated WiFi dongle, but it gets the job done. Take that, Hackaday’s own [Rud Merriam]!

Thanks [J0z0r] for the tip!

Rescuing An SD Card With An Arduino

A few days ago, one of [Severin]’s SD cards died on him, Instead of trashing the card, he decided to investigate what was actually wrong with the card and ended up recovering most of the data¬†using an Arduino and an immense amount of cleverness.

SD cards can be accessed with two modes. The first is the SDIO mode, which is what cameras, laptops, and other card readers use. The second mode is SPI mode. SPI is slower, but much, much simpler. It turned out the SDIO mode on [Severin]’s card was broken, but accessing it with an Arduino and SPI mode worked. There was finally hope to get files off this damaged card.

[Severin] used a few sketches to dump the data on the SD card to his computer. The first looked at the file system and grabbed a list of files contained on the card. The second iterated over the file system and output all the files in hex over the serial port. With a bit of Python, [Severin] was able to reconstruct a few files that were previously lost forever.

Even though the SD card was completely inaccessible with a normal card reader, [Severin] was able to get a few files off the card. All the sketches and Python scripts are available on the Githubs, ready to recover files from your broken SD cards.