Skip to content

Heart rate variability graphical user interface for dataset capture on a LAN.

Notifications You must be signed in to change notification settings

ddantas/hrv_lan

Repository files navigation

hrv_lan

Heart rate variability graphical user interface for dataset capture on a LAN.

Environment setup

The project requires Python 3.8. We recommend the creation of a virtual environment to facilitate the usage of the code.

Use the code below in the terminal to install Python 3.8 in the system, as explained here.

$ sudo apt update && sudo apt upgrade

$ sudo apt install software-properties-common -y

$ sudo add-apt-repository ppa:deadsnakes/ppa -y

$ sudo apt update

$ sudo apt install python3.8 python3.8-dev python3.8-venv python3.8-distutils idle-python3.8 -y

Create the virtual environment with

$ python3.8 -m venv_polar

Activate the virtual environment with

$ source venv_polar/bin/activate

Alternatively, copy the line above to a file called activate_venv_polar and run

$ . ./activate_venv_polar

Update pip and install idle with

(venv_polar)$ python -m pip install --upgrade pip

(venv_polar)$ pip install idle

Call idle inside the virtual environment with

(venv_polar)$ python -m idlelib.idle

Install the required libraries with

(venv_polar)$ pip install opencv-python matplotlib scapy bleak pandas biosppy pyhrv --default-timeout=1000

Deactivate the virtual environment with

(venv_polar)$ deactivate

Tips about git usage

Now git requires an SSH key to update your repository. Github documentation has instructions about how to generate an SSH key and how to create a personal access token (PAT).

Use the code below in the terminal to avoid the need to input the PAT when doing a git push:

$ git config credential.helper store

Tips about Markdown syntax

Basic details about Markdown syntax can be found here.

Tips about time synchronization when executing a routine

Before the start of a capture/routine, make sure that all computers, that are part of the process, have their clocks synchronized by following these steps:

  • First, make sure that all computers are connected to a NTP server, so that your system's clock is synchronized with the internet's. Run sudo systemctl start systemd-timesyncd on your terminal to start a service that takes care of that. To check if the service is up, run sudo systemctl status systemd-timesyncd.

  • Second, every computer should be using the same NTP server. To change this you should edit the configuration file for timesyncd, which is usually at /etc/systemd/timesyncd.conf. Note: during development and testing, the server used was Ubuntu's default NTP server (ntp.ubuntu.com).

  • Finally, apply the synchronization to the hardware clock of every computer. Even though your system is synced with the internet, your hardware might still be following your previous clock. To do that, run sudo hwclock --systohc on your terminal.

Use timedatectl to check if everything is working. If everything is fine, all the clocks should be synced and you should have these two lines as part of the output of your command :

System clock synchronized: yes
NTP service: active

You can run the command in a loop to see how time is passing in every clock using for i in {1.1000}; do timedatectl; done;.

About

Heart rate variability graphical user interface for dataset capture on a LAN.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published