The Raspberry Pi Pico RP2040 is a very versatile microcontroller. It is not the least expensive or the most powerful microcontroller, but it is one which is available and has an excellent software and tool ecosystem.
This article shows how to use the Raspberry Pi Pico-W with BLE and optional WiFi, running with FreeRTOS.
BLE (Bluetooth Low Energy) sensor devices like the Hexiwear are great, but they cannot store a large amount of data. For a research project I have to collect data from many BLE devices for later processing. What I’m using is a Python script running on the Raspberry Pi which collects the data and stores it on a file:
Raspberry Pi with Python controlling a set of Hexiwear BLE Devices
One of the biggest road blocks (beside of closed source) using the BLE (Bluetooth Low Energy) stack from NXP is that it requires expensive tools to compile and build the stack. The good news is that I have now the NXP BLE stack for the Mikroelektronika Hexiwear ported to Eclipse and GNU gcc build tools for ARM 🙂
For a university reasearch project I try to pair the Raspberry Pi 3 with a Mikroelektronika Hexiwear using BLE (Bluetooth Low Energy). Most of things worked after a lot of trial and error, but at a certain point I was stuck trying to write to send data from the Raspy to the BLE device.The Hexiwear BLE protocol description is very thin, so I ended up using a BLE sniffer to reverse engineer the protocol with Wireshark.
The Hexiwear (see “Hexiwear: Teardown of the Hackable ‘Do-Anything’ Device“) is a small and portable sensor node with built-in BLE (Bluetooth Low Energy) transceiver. In a research project we try to use multiple Hexiwear in a classroom environment and to collect sensor data on a Raspberry Pi. The Raspberry Pi 3 Model B running Linux has an on-board BLE transceiver too, so why not binding them (wirelessly) together?
Raspberry Pi 3 connected with Hexiwear over BLE
Well, things seemed easy at the beginning, and as always, there are many things to learn on a journey like this…
The Hexiwear device is a great and versatile device with two microcontrollers on it. Developing firmware on a Hexiwear means changing what was originally on it. And sometimes it happens that I’m not sure if the changes are for good. Or that I accidentally destroyed the firmware on the NXP Kinetis KW40 BLE microcontroller :-(. So I had to find a way to restore the original firmware, and this is what this post is about.
Restoring the Hexiwear Firmware with a Segger J-Link