Skip to content

Commit 0955b5d

Browse files
Add docs for streaming mode
1 parent 128b9d9 commit 0955b5d

9 files changed

+465
-151
lines changed

.DS_Store

0 Bytes
Binary file not shown.

docs/.DS_Store

0 Bytes
Binary file not shown.

docs/firmware-upgrades.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ If the flashing is successful, you should see something similar to the below scr
5656

5757
**ECG STREAMING**
5858

59-
The folder `heatypatch-stream-tcp` contains the code for streaming ECG.
59+
The folder `heartypatch-stream-tcp` contains the code for streaming ECG.
6060

6161
Before flashing this code, enable wifi, TCP and mdns through `makemenuconfig` similar to the process described in the previous section.
6262

@@ -86,4 +86,4 @@ You can open the IDF monitor to see the debug messages by using the command:
8686

8787
Once the heartypatch is connected with the wifi, open the gui from the project folder and you should be able see the ECG stream.
8888

89-
More information about this process and the ESP32 framework is available in the [ESP32 Get Started Guide](http://esp-idf.readthedocs.io/en/latest/get-started/).
89+
More information about this process and the ESP32 framework is available in the [ESP32 Get Started Guide](http://esp-idf.readthedocs.io/en/latest/get-started/).

docs/images/streaming-tcp.gif

176 KB
Loading

docs/index.md

+23-9
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,10 @@ If you don't already have one, you can buy one on [Crowd Supply](https://www.cro
66

77
# Getting Started with HeartyPatch
88

9-
If you just want to use the HeartyPatch with the pre-loaded firmware, it comes ready to go. You do not have to do any programming to get it working.
10-
11-
With the preloaded firmware, the HeartyPatch will do heart-rate and R-R interval measurement and send it over BLE through a standard [Heart-rate BLE service](https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.heart_rate.xml), as well as a separate custom HRV service that will provide parameters used for HRV analysis such as SD, Mean RR, PNN50 and SDNN.
9+
If you just want to use the HeartyPatch with the pre-loaded firmware, it comes ready to go. You do not have to do any programming to get it working. The pre-loaded firmware send HRV values over BLE.
1210

1311
**HeartyPatch can be used with any Android app that supports the heart-rate profile.**
1412

15-
### Parts of the HeartyPatch
16-
17-
![HeartyPatch Parts](images/heartypatch-parts.png)
18-
19-
<iframe src="https://player.vimeo.com/video/249182147" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
20-
2113
## The HeartyPatch App for Android - BETA
2214

2315
An android app for HeartyPatch is now available that receives and displays the real-time heart rate as well as HRV trends and variables. The app scans for any HeartyPatch devices in the vicinity and shows a list of devices accessible through Bluetooth Low Energy (BLE). Please note that you would need an Android device with BLE support to use this app.
@@ -28,6 +20,28 @@ You can download and install the app from the [Google Play Store](https://play.g
2820

2921
*Note: The android app for HeartyPatch is still in BETA and there might be some instability as a result.*
3022

23+
## Modes of operation
24+
25+
### Bluetooth LE Mode
26+
With the preloaded firmware, the HeartyPatch will do heart-rate and R-R interval measurement and send it over BLE through a standard [Heart-rate BLE service](https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.heart_rate.xml), as well as a separate custom HRV service that will provide parameters used for HRV analysis such as SD, Mean RR, PNN50 and SDNN.
27+
28+
### Continuous ECG Streaming mode over WiFi/TCP
29+
30+
The HeartyPatch can also do live ECG streaming from the chest. This works similar to a heart-rate monitor. Below is a screen capture of the device working in ECG mode. The data is sent over a TCP socket over WiFi.
31+
32+
![HeartyPatch Streaming ECG](images/streaming-tcp.gif)
33+
34+
**To get the WiFi mode turned on, you will have to flash the firmware onto the device. The following link provides detailed step-by-step instructions about how to reprogram the HeartyPatch.**
35+
36+
### [Programming HeartyPatch for ECG streaming over WiFi/TCP](streaming-ecg-tcp-mode.md)
37+
38+
### Parts of the HeartyPatch
39+
40+
![HeartyPatch Parts](images/heartypatch-parts.png)
41+
42+
<iframe src="https://player.vimeo.com/video/249182147" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
43+
44+
3145
# Updating the firmware
3246

3347
To install new firmware and/or compile your own firmware, check out **[Guide to Firmware Upgrades](firmware-upgrades.md).**

docs/streaming-ecg-tcp-mode.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Getting live ECG data from HeartyPatch over WiFi/TCP
2+
3+
The firmware for the HeartyPatch's on-board Espressif ESP32 chip uses the [esp-idf framework](https://github.com/espressif/esp-idf)
4+
for development. You will need to install and configure the following components to setup a development environment:
5+
6+
* The Xtensa ESP32 toolchain
7+
* The v2.1 release of esp-idf
8+
* Supporting software such as Python and pyserial
9+
10+
**Please make sure all of the above tools are properly installed before proceeding.**
11+
12+
Setup guides for these components are available on the [ESP-IDF documentation site](https://esp-idf.readthedocs.io/en/latest/get-started/index.html).
13+
14+
You can then clone our [Github repository](https://github.com/Protocentral/protocentral_heartypatch) of code for the ESP32:
15+
16+
`git clone https://github.com/Protocentral/protocentral_heartypatch.git`
17+
18+
[or download a zip file of the latest master branch](https://github.com/Protocentral/protocentral_heartypatch/archive/master.zip).
19+
20+
Download this zip file, rename it to whatever you want to. Change to this directory and then start building.
21+
22+
The folder `heatypatch-stream-tcp` contains the code for streaming ECG.
23+
24+
Before flashing this code, enable wifi, TCP and mdns through `makemenuconfig` similar to the process described in the previous section.
25+
26+
* Start makemenuconfig and navigate to *Heartypatch configuration*, set your wifi ssid and password, enable mdns and TCP:
27+
![Heartypatch config](images/heartypatch-config-tcp.png)
28+
29+
* Configure the serial port under Serial flasher config -> Default serial port
30+
* Navigate to *Component config -> esp32-specific ->main XTAL frequency* and select 26 MHz as the board crystal
31+
32+
Run the makefile (assuming previous steps are done correctly):
33+
34+
`make` or `make -j5`
35+
36+
To flash the firmware on to the board, just use:
37+
38+
`make flash`
39+
40+
If the flashing is successful, you should see something similar to the below screen:
41+
42+
![ESP Success](images/esp-flash-success.png)
43+
44+
You can open the IDF monitor to see the debug messages by using the command:
45+
46+
`make monitor`
47+
48+
![idf-monitor](images/idf-monitor-tcp-connection.png)
49+
50+
Once the heartypatch is connected with the wifi, open the gui from the project folder and you should be able see the ECG stream.
51+
52+
More information about this process and the ESP32 framework is available in the [ESP32 Get Started Guide](http://esp-idf.readthedocs.io/en/latest/get-started/).

firmware/.DS_Store

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)