Skip to content

Add BLE sensor streaming#64

Open
hartmandrector wants to merge 14 commits into
flysight:developfrom
hartmandrector:sensor-ble
Open

Add BLE sensor streaming#64
hartmandrector wants to merge 14 commits into
flysight:developfrom
hartmandrector:sensor-ble

Conversation

@hartmandrector

Copy link
Copy Markdown

This adds BLE sensor streaming for barometer, humidity, accelerometer, gyroscope, and magnetometer data, along with configuration support and a divider-rate helper script.

Olivier Gasté and others added 11 commits March 16, 2026 19:42
Add SD_BARO_Measurement characteristic to Sensor_Data service
for streaming pressure/temperature data with configurable decimation.
- DS_CMD_SET_MODE (0x04) to switch between SLEEP and ACTIVE modes
- Optional 32-bit ext_sync timestamp for CSV header synchronization
- New events FS_MODE_EVENT_BLE_SET_ACTIVE and FS_MODE_EVENT_BLE_SET_SLEEP
- Updated documentation for DS_Control_Point commands
- Implemented FS_BLE_CalculateDivider function to calculate the appropriate divider for BLE transmission based on sensor ODR settings.
- Created FS_BLE_ValidateConfig function to validate the BLE configuration against throughput limits, incorporating GPS rate and sensor settings.
- Added header file ble_config.h to define BLE-related constants and function prototypes.
- Introduced hum_ble.c and hum_ble.h for humidity sensor BLE data handling, including initialization, mask management, and data packet building.
- Defined sensor ODR lookup tables in sensor_odr.h for various sensors to facilitate ODR to Hz conversions.
@hartmandrector

Copy link
Copy Markdown
Author

the ble control point divider stuff could be removed for reduced complexity (dividers could be set via config file only). I like using it but not sure if anyone else will.
I kept the dividers in the default config and set divider = 0 as default, we could also use 1 as the default and / or remove them from the default config

@hartmandrector

Copy link
Copy Markdown
Author

other options that are not implemented, (would need re-testing):

remove extra temperature measurements (redundant).
accel/gyro on same charicteristic... ( less bluetooth overhead )
divider=0 algorithm development ( for better behavior with high rate sensor settings )
additional control point commands for flight controler (set dynamics model, get EKF errors?)

Let me know if we are going to want to do any of these. The current version is working great.

@@ -73,7 +83,7 @@ typedef struct

/* Private macros -------------------------------------------------------------*/
/* USER CODE BEGIN PM */

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs review!!

hartmandrector and others added 3 commits April 23, 2026 10:57
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@profff

profff commented Jul 23, 2026

Copy link
Copy Markdown

Hi @hartmandrector — nice to see the sensor streaming work from #62 carried forward and extended here; the config-file dividers, humidity characteristic and docs are welcome additions. We've just closed #62 in favour of converging on a single PR, since two overlapping ones won't help anyone.

One heads-up: develop has changed quite a bit since this branch was cut. The mode-control events this PR still carries over from our branch (FS_MODE_EVENT_BLE_SET_ACTIVE / FS_MODE_EVENT_BLE_SET_SLEEP) conflict with the mode request mechanism that landed in May (FS_Mode_RequestState() / DS_CMD_REQUEST_* on the DS control point). When we rebased on our side, we dropped BLE mode control entirely — the upstream mechanism covers that ground better.

We now have the streaming core (baro/accel/gyro/mag characteristics + custom_stm plumbing) rebased onto current develop and validated on hardware. If it helps, we're happy to push that branch as a base so this PR can rebase on it and focus on what it adds (hum, dividers/config, tests) — that would also keep commit history and attribution tidy. Alternatively, happy to review and test a rebase done here — whichever works best for you and @crwper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants