Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending ECG Data via BLE (EM9301) on MaxRefDes100# HealthSensor Platform #2

Open
vnm1911 opened this issue May 27, 2021 · 3 comments
Open

Comments

@vnm1911
Copy link

vnm1911 commented May 27, 2021

Hello Viktor,

I saw your tutorial video on YouTube.
STM32 and Android tutorial - ECG (single lead, 2 and 3 electrode configuration)
It is really good. I thank you for that.

We are trying to develop a multi sensor wearable device using MaxRefDes100# and we are struggling with sending ECG data to mobile device via on chip BLE (EM9301). The onboard Microcontroller is Max32620 and ECG sensor is Max30003 (and other sensors).

Here are the useful links to the device
https://media.digikey.com/pdf/Data%20Sheets/Maxim%20PDFs/MAXREFDES100_Web.pdf
https://www.maximintegrated.com/en/design/reference-design-center/system-board/6312.html

We need to send almost 400 bytes only for ECG, but we are unable to change the default byte size which is 33 bytes I think.

We will be really thankful if you could pls help in any way.

Thanks and Regards
VM

@viktorvano
Copy link
Owner

Well a standard BLE packet size is 20 bytes only. If you want to send more, you need to split the buffer contents into those packets of 20 bytes.
That's normally packets are sent as string ending with LF or something:
12,11,15,16,20,.......,14\n

So if you will receive a packet that contains '\n' you know that's the end of a message.

@vnm1911
Copy link
Author

vnm1911 commented May 27, 2021

Well a standard BLE packet size is 20 bytes only. If you want to send more, you need to split the buffer contents into those packets of 20 bytes.
That's normally packets are sent as string ending with LF or something:
12,11,15,16,20,.......,14\n

So if you will receive a packet that contains '\n' you know that's the end of a message.

Thank you very much for a very prompt reply. You are very kind.
Okay we will try that again. But my concern is will there be loss of data and hence eventually a distortion in ECG waveform?
We will try and will report you our progress soon.

@viktorvano
Copy link
Owner

Just another info regarding BLE:
In Bluetooth 4.0, BLE was introduced with a maximum payload of 33 bytes (not including Access Address and CRC fields). Each layer in the protocol stack takes its cut:

2 bytes for packet header (type and length),
4 bytes for MIC (when encryption is enabled),
4 bytes for L2CAP header (channel ID and packet length),
ATT protocol is left with 23 bytes, which is the default and minimal MTU for ATT protocol.
With an ATT write request (or notification), 3 bytes are used by command type and attribute ID, 20 bytes are left for the attribute data.

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

No branches or pull requests

2 participants