Software NEXT firmware
Recording Data
HealthyPi 5 can record signals in three places: on the microSD card in the board, on a computer through OpenView 2, or on a phone through the OpenView 2 mobile app.
What you get depends on which firmware you’re running.
| Destination | Arduino (NEXT) | Zephyr |
|---|---|---|
| microSD card | ✅ binary /REC*.BIN |
✅ CSV |
| Computer (OpenView 2 desktop) | ✅ CSV | ✅ CSV |
| Phone (OpenView 2 mobile) | — | ✅ CSV |
| Fetch SD logs over BLE | — | ✅ |
Requirements
- HealthyPi 5 (any kit)
- USB-C cable for power (not included)
- For SD recording: a microSD card (not included), FAT-formatted, in the slot on the underside of the main board
Recording to a computer
Works on either firmware, and it’s the simplest option. Run a normal OpenView 2 desktop session and click Start Logging before or during the stream; Stop writes a CSV. Full walkthrough: Streaming to OpenView 2.
Recording to the SD card — Arduino (NEXT)
Add one line to enable the SD sink:
HealthyPi5.recordSD(); // before begin()
Then start and stop a recording either from code or over the USB command plane:
HealthyPi5.recordStart(); // opens a new /REC*.BIN
HealthyPi5.recordStop(); // closes it
HealthyPi5.recording(); // true while a file is open
The host commands REC_START and REC_STOP do the same thing over USB — see Host commands.
The card is an ordinary drop-newest sink on its own core0 task, so a slow card only drops SD records — counted, and reported in the telemetry line. It can never stall acquisition. Writes are batched into 4 KB pages and the FAT is flushed every two seconds, bounding how much you lose to a power cut.
examples/Tutorials/11_SD_Datalog is a complete worked example.
The on-disk format
Files are written to the card root as /REC*.BIN: a 32-byte header followed by fixed 16-byte records, all little-endian.
Header (32 bytes)
uint32 magic 0x35504824 ('$HP5')
uint16 version 1
uint16 rec_size 16
uint16 sample_rate_hz ~128
uint16 channels 4
uint32 start_uptime_ms
uint8 reserved[16]
Record (16 bytes, repeated)
int32 ecg
int32 bioz (respiration)
int32 ppg_red
int32 ppg_ir
The format is stable and trivial to parse — four little-endian int32 values per sample after a 32-byte header. In Python:
import struct
with open("REC0001.BIN", "rb") as f:
hdr = f.read(32)
magic, version, rec_size, rate, channels, start_ms = struct.unpack("<IHHHHI", hdr[:16])
assert magic == 0x35504824, "not a HealthyPi 5 recording"
while chunk := f.read(rec_size):
ecg, bioz, red, ir = struct.unpack("<iiii", chunk)
print(ecg, bioz, red, ir)
Retrieving the recording
Power the device off, remove the microSD card, and read it with a card reader. The .BIN files sit at the root.
The Arduino firmware does not support fetching logs over BLE — that’s a Zephyr feature.
Recording to the SD card — Zephyr
The Zephyr firmware records CSV and can be driven entirely from the OpenView 2 mobile app, including retrieving files wirelessly.
Start a session
-
From the OpenView 2 mobile app, tap Connect next to your HealthyPi 5.
-
Tap Log to SD Card on the left of the stream view.
-
To stop, tap Stop Logging.
Keep recording after the phone walks away
Tap Disconnect and choose Disconnect & Continue. The HealthyPi 5 keeps writing to the card on its own. When you reconnect, tapping Log to SD Card ends the previous session and starts a new one.
Getting the files back
Over BLE. Reconnect from the app, tap Get Logs, pick a file, tap Download.
Or pull the card. Power off, remove the microSD, read it directly. CSV files are at the root.
When fetching logs over BLE, keep the phone close to the device — log files can be large and the transfer slows considerably on a weak link.
Recording to the phone — Zephyr
-
Install OpenView 2 on your phone (links in Wireless: BLE & Wi-Fi).
-
Tap Scan, then Connect.
-
Tap Log to App. Recording starts immediately.
-
To stop, tap Disconnect. The CSV is saved to the app’s storage.




