A Simple Web Configured BLE To GPIO Bridge

[Daniel Dakhno] kept ending up in a situation where the ability to read the status of, or control a few digital IO pins with minimal effort, would be terribly useful. Not wanting to keep compiling code, for such simple needs, they instead used a nRF51-based module as a physical interface and produced a general purpose firmware that could be configured with a simple web interface. The NRF51-IO-module was born, whose job is to pair with whatever device you have in front of you, provided it supports BLE, and give direct access to those IO pins.

Rather than acting as a rather slow logic analyser, the firmware is intended for mostly static configurations. The web application sends a configuration packet over to the nRF51 board, which then programs it into FLASH and restarts, reading the updated configuration and applying it to the IO pins. These outputs then persist as long as there is power. The read-side of the equation can also be performed via the web page, but we didn’t have a chance to verify that. The code implements the Bluetooth automation IO service as well as the binary sensor service so if you have access to applications that talk these services, then you should be able to fire it up and go with it, although we’ve not personally tested this due to lack of an nRF51 board. We noticed that the Home Assistant automation platform supports the BT binary sensor, which might be a big help for some people with a need for some wireless control and sensing.

If you need a practical example of a use for remote sensing, here’s a physical mailbox status monitor, using the nRF51. Whilst we’re thinking of Bluetooth and sensors, here’s a custom firmware for some super cheap environment sensors that frees them from vendor lock-in.

Header image: Ubahnverleih, CC0.

A small round NRF51822 board glued to the underside of a mailbox lid, with a small vibration sensor attached

Check Your Mailbox Using The AirTag Infrastructure

When a company creates an infrastructure of devices, we sometimes subvert this infrastructure and use it to solve tricky problems. For example, here’s a question that many a hacker has pondered – how do you detect when someone puts mail into your mailbox? Depending on the availability of power and wireless/wired connectivity options, this problem can range from “very easy” to “impractical to solve”. [dakhnod] just made this problem trivial for the vast majority of hackers, with the FakeTag project – piggybacking off the Apple’s AirTag infrastructure.

This project uses a cheap generic CR2032-powered NRF51822 board, sending the mailbox status over the FindMy system Apple has built for the AirTag devices. For the incoming mail detection, he uses a simple vibration sensor, glued to the flap lid – we imagine that, for flap-less mailboxes, an optical sensor or a different kind of mechanical sensor could be used instead. Every time someone with a FindMy-friendly iPhone passes by [dakhnod]’s mailbox, he gets an update on its status, with a counter of times the sensor has been triggered. [dakhnod] estimates that the device could run for up to a year on a single battery.

Continue reading “Check Your Mailbox Using The AirTag Infrastructure”

Instruction Set Hack For Protected Memory Access

The nRF51 Series SoCs is a family of low power Bluetooth chips from Nordic Semiconductor that is based on ARM Cortex cores. The nRF51822 has the Cortex M0 core and is used in a lot of products. [Loren] has written a blog post in which he claims to be able to circumvent read back protection on the chip, thus giving access to the ROM, RAM and registers as well as allow for interactive debugging sessions.

The hack stems from the fact that the  Serial Wire Debug or SWD interface cannot be completely disabled on these chips even if the Memory Protection Unit prevents access to any memory regions directly. The second key piece is the fact that CPU can fetch stuff from the code memory. Combined with the SWD super powers to make changes to the registers themselves, this can be a powerful tool.

Continue reading “Instruction Set Hack For Protected Memory Access”

New Part Day: Nordic’s New Bluetooth SoC

You don’t need to look very hard to find Nordic’s nRF51 wireless module; it’s found in hundreds of products and dozens of projects over on hackaday.io. The nRF51 is a SoC that includes an ARM Cortex M0 processor and a variety of radios for Bluetooth and other protocols. Useful, if a bit limited in processing power.

Now, Nordic has a new SoC. It’s the nRF52, a Cortex M4F processor, a Bluetooth radio, NFC, and a bunch of Flash and RAM to make just about anything you can think of possible. Yes, it’s an upgrade to the nRF51 – a better processor and NFC, and all the possibilities that come with that. Currently there’s only one part and two package options: a 6x6mm QFN48, or a wafer chip that will be covered with impregnable goo.

Already there are SDKs for IAR Workbench, Keil4 and 5, and gcc. The SDKs won’t help you quite yet; it’s not available through the usual distributors yet, but the nRF52 Preview develoment kit is. That’s a single board development kit for the nRF52, with Arduino pinouts and Mbed support.

Thanks [Alvin] for sending this in from Trondheim.