Skip to content

Commit

Permalink
fix connection issues with muse devices and move to netstandard 2.0 i…
Browse files Browse the repository at this point in the history
…n csharp binding (#586)

* fixing ci for ble on windows

Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
  • Loading branch information
Andrey1994 committed Dec 12, 2022
1 parent 341b1e9 commit bfae8da
Show file tree
Hide file tree
Showing 46 changed files with 204 additions and 1,678 deletions.
69 changes: 0 additions & 69 deletions .github/workflows/codeql_analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
- name: Run Cppcheck
run: cppcheck --std=c++11 -ithird_party/spdlog -ithird_party/libsvm -ithird_party/SimpleBLE -ithird_party/fmt -ithird_party/SimpleDBus -ithird_party/SimpleBluez -isrc/utils/os_serial_ioctl.cpp --error-exitcode=1 --xml --xml-version=2 --force src cpp_package third_party 2>cppcheck_res.xml
run: cppcheck --std=c++11 -ithird_party/spdlog -ithird_party/libsvm -ithird_party/SimpleBLE -ithird_party/fmt -ithird_party/SimpleDBus -ithird_party/SimpleBluez -ithird_party/kissfft -isrc/utils/os_serial_ioctl.cpp --error-exitcode=1 --xml --xml-version=2 --force src cpp_package third_party 2>cppcheck_res.xml
- name: Generate Report
if: ${{ failure() }}
run: cppcheck-htmlreport --title=BrainFlow --file=cppcheck_res.xml --report-dir=report
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_libftdi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-11.0]
os: [ubuntu-20.04, macos-11.0]

steps:
# compile and prepare env
Expand All @@ -22,7 +22,7 @@ jobs:
python-version: '3.7.7'
architecture: 'x64'
- name: Install Ubuntu Dependencies
if: (matrix.os == 'ubuntu-latest')
if: (matrix.os == 'ubuntu-20.04')
run: |
sudo -H apt-get update -y
sudo -H apt-get install -y python3-setuptools python3-pygments libftdi1-dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]

jobs:
RunMatlabLinux:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Check out repository
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/run_unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-11.0]
os: [ubuntu-20.04, macos-11.0]

steps:
# compile and prepare env
Expand All @@ -27,7 +27,7 @@ jobs:
python-version: '3.7.7'
architecture: 'x64'
- name: Install Python Dependencies
if: (matrix.os == 'ubuntu-latest')
if: (matrix.os == 'ubuntu-20.04')
run: |
sudo -H apt-get update -y
sudo -H apt-get install -y python3-setuptools python3-pygments libbluetooth-dev
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
env:
BRAINFLOW_VERSION: ${{ steps.version.outputs.version }}
- name: Compile BrainFlow Ubuntu
if: (matrix.os == 'ubuntu-latest')
if: (matrix.os == 'ubuntu-20.04')
run: |
mkdir $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
Expand All @@ -81,7 +81,7 @@ jobs:
BRAINFLOW_VERSION: ${{ steps.version.outputs.version }}
- name: Compile BrainFlow in ManyLinux
# bindings in production have to use libraries compiled inside this image!
if: (matrix.os == 'ubuntu-latest')
if: (matrix.os == 'ubuntu-20.04')
run: |
docker pull dockcross/manylinux2014-x64:20210708-94745ff
docker run -e BRAINFLOW_VERSION=$BRAINFLOW_VERSION -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE -v $GITHUB_WORKSPACE:$GITHUB_WORKSPACE dockcross/manylinux2014-x64:20210708-94745ff /bin/bash -c "yum install -y bluez-libs-devel dbus-devel && /opt/python/cp36-cp36m/bin/pip3.6 install cmake==3.21.4 && cd $GITHUB_WORKSPACE && mkdir build_docker && cd build_docker && /opt/_internal/cpython-3.6.14/bin/cmake -DBRAINFLOW_VERSION=$BRAINFLOW_VERSION -DBUILD_ONNX=ON -DBUILD_BLE=ON -DBUILD_BLUETOOTH=ON -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/installed_docker -DCMAKE_BUILD_TYPE=Release .. && make && make install"
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib
- name: EEG Metrics Cpp Dyn Lib
if: (matrix.os == 'ubuntu-latest')
if: (matrix.os == 'ubuntu-20.04')
run: $GITHUB_WORKSPACE/cpp_package/examples/ml/build/eeg_metrics_ci --board-id -1 --metric 2 --classifier 1 --model-file $GITHUB_WORKSPACE/cpp_package/examples/ml/build/libdyn_lib_test.so
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib
Expand All @@ -301,7 +301,7 @@ jobs:
- name: Install AWS CLI
run: sudo -H python3 -m pip install awscli==1.21.10
- name: Push Libraries Linux Docker
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && github.repository == 'brainflow-dev/brainflow' }}
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-20.04' && github.repository == 'brainflow-dev/brainflow' }}
run: |
aws s3 cp $GITHUB_WORKSPACE/installed_docker/lib/ s3://brainflow/$GITHUB_SHA/linux --recursive
env:
Expand Down
42 changes: 14 additions & 28 deletions .github/workflows/run_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
os: [windows-2019]
os: [windows-2022]

steps:
- name: Clone Repository
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
mkdir %GITHUB_WORKSPACE%\build32
cd %GITHUB_WORKSPACE%\build32
cmake -DBRAINFLOW_VERSION=%BRAINFLOW_VERSION% -DBUILD_OYMOTION_SDK=ON -DBUILD_ONNX=ON -DBUILD_BLUETOOTH=ON -DBUILD_TESTS=ON -DWARNINGS_AS_ERRORS=ON -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX=..\installed32\ ..
cmake -DBRAINFLOW_VERSION=%BRAINFLOW_VERSION% -DBUILD_OYMOTION_SDK=ON -DBUILD_ONNX=ON -DBUILD_BLE=ON -DBUILD_BLUETOOTH=ON -DBUILD_TESTS=ON -DWARNINGS_AS_ERRORS=ON -G "Visual Studio 17 2022" -A Win32 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX=..\installed32\ ..
cmake --build . --target install --config Release -j 2 --parallel 2
env:
BRAINFLOW_VERSION: ${{ steps.version.outputs.version }}
Expand All @@ -50,29 +50,15 @@ jobs:
run: |
mkdir %GITHUB_WORKSPACE%\build64
cd %GITHUB_WORKSPACE%\build64
cmake -DBRAINFLOW_VERSION=%BRAINFLOW_VERSION% -DBUILD_OYMOTION_SDK=ON -DBUILD_ONNX=ON -DBUILD_BLUETOOTH=ON -DBUILD_TESTS=ON -DWARNINGS_AS_ERRORS=ON -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX=..\installed64\ ..
cmake -DBRAINFLOW_VERSION=%BRAINFLOW_VERSION% -DBUILD_OYMOTION_SDK=ON -DBUILD_ONNX=ON -DBUILD_BLE=ON -DBUILD_BLUETOOTH=ON -DBUILD_TESTS=ON -DWARNINGS_AS_ERRORS=ON -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX=..\installed64\ ..
cmake --build . --target install --config Release -j 2 --parallel 2
env:
BRAINFLOW_VERSION: ${{ steps.version.outputs.version }}
shell: cmd
# need to build SimpleBLE outside from BrainFlow because they have different Windows System Versions
- name: Compile SimpleBLE x32
run: |
mkdir %GITHUB_WORKSPACE%\third_party\SimpleBLE\simpleble\build32
cd %GITHUB_WORKSPACE%\third_party\SimpleBLE\simpleble\build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\installed32\ ..
cmake --build . --target install --config Release -j 2 --parallel 2
shell: cmd
- name: Compile SimpleBLE x64
run: |
mkdir %GITHUB_WORKSPACE%\third_party\SimpleBLE\simpleble\build64
cd %GITHUB_WORKSPACE%\third_party\SimpleBLE\simpleble\build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\installed64\ ..
cmake --build . --target install --config Release -j 2 --parallel 2
shell: cmd
- name: C# build
run: |
cd %GITHUB_WORKSPACE%\csharp_package\brainflow
dotnet restore brainflow.sln
msbuild brainflow.sln /p:Configuration=Release /p:Platform="Any CPU"
shell: cmd
- name: Install Emulator
Expand All @@ -96,28 +82,28 @@ jobs:
run: |
mkdir %GITHUB_WORKSPACE%\cpp_package\examples\get_data\build
cd %GITHUB_WORKSPACE%\cpp_package\examples\get_data\build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed64\ ..
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed64\ ..
cmake --build . --config Release -j 2 --parallel 2
shell: cmd
- name: Build Cpp Signal Processing Test x64
run: |
mkdir %GITHUB_WORKSPACE%\cpp_package\examples\signal_processing\build
cd %GITHUB_WORKSPACE%\cpp_package\examples\signal_processing\build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed64\ ..
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed64\ ..
cmake --build . --config Release -j 2 --parallel 2
shell: cmd
- name: Build Cpp ML Test x64
run: |
mkdir %GITHUB_WORKSPACE%\cpp_package\examples\ml\build
cd %GITHUB_WORKSPACE%\cpp_package\examples\ml\build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed64\ ..
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed64\ ..
cmake --build . --config Release -j 2 --parallel 2
shell: cmd
- name: Build Cpp ML Test x32
run: |
mkdir %GITHUB_WORKSPACE%\cpp_package\examples\ml\build32
cd %GITHUB_WORKSPACE%\cpp_package\examples\ml\build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed32\ ..
cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\installed32\ ..
cmake --build . --config Release -j 2 --parallel 2
shell: cmd
- name: Build Java Package
Expand Down Expand Up @@ -152,7 +138,7 @@ jobs:
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\cyton_windows.py %GITHUB_WORKSPACE%\cpp_package\examples\get_data\build\Release\brainflow_get_data.exe --board-id 0 --serial-port
shell: cmd
- name: Cyton Windows C# Test
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\cyton_windows.py %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release\brainflow_get_data.exe --board-id 0 --serial-port
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\cyton_windows.py %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release\netcoreapp3.1\brainflow_get_data.exe --board-id 0 --serial-port
shell: cmd
- name: Synthetic Windows Python Test
run: python %GITHUB_WORKSPACE%\python_package\examples\tests\brainflow_get_data.py --board-id -1
Expand All @@ -172,7 +158,7 @@ jobs:
shell: cmd
- name: Synthetic Windows C# Test
run: |
cd %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release
cd %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release\netcoreapp3.1\
brainflow_get_data.exe --board-id -1
shell: cmd
- name: Cyton Daisy Windows Python Test
Expand All @@ -185,13 +171,13 @@ jobs:
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\cyton_windows.py %GITHUB_WORKSPACE%\cpp_package\examples\get_data\build\Release\brainflow_get_data.exe --board-id 2 --serial-port
shell: cmd
- name: Cyton Daisy Windows C# Test
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\cyton_windows.py %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release\brainflow_get_data.exe --board-id 2 --serial-port
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\cyton_windows.py %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release\netcoreapp3.1\brainflow_get_data.exe --board-id 2 --serial-port
shell: cmd
- name: Galea Windows Cpp Test
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\galea_udp.py %GITHUB_WORKSPACE%\cpp_package\examples\get_data\build\Release\brainflow_get_data.exe --board-id 3 --ip-address 127.0.0.1
shell: cmd
- name: Galea Windows C# Test
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\galea_udp.py %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release\brainflow_get_data.exe --board-id 3 --ip-address 127.0.0.1
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\galea_udp.py %GITHUB_WORKSPACE%\csharp_package\brainflow\examples\brainflow_get_data\bin\Release\netcoreapp3.1\brainflow_get_data.exe --board-id 3 --ip-address 127.0.0.1
shell: cmd
- name: FreeEEG32 Python Test
run: python %GITHUB_WORKSPACE%\emulator\brainflow_emulator\freeeeg32_windows.py python %GITHUB_WORKSPACE%\python_package\examples\tests\brainflow_get_data.py --board-id 17 --serial-port
Expand Down Expand Up @@ -281,10 +267,10 @@ jobs:
run: .\cpp_package\examples\ml\build32\Release\eeg_metrics_ci.exe --board-id -1 --metric 2 --classifier 2 --model-file %GITHUB_WORKSPACE%\src\ml\train\logreg_mindfulness.onnx
shell: cmd
- name: EEG Metrics C# Test
run: .\csharp_package\brainflow\examples\eeg_metrics\bin\Release\eeg_metrics.exe
run: .\csharp_package\brainflow\examples\eeg_metrics\bin\Release\netcoreapp3.1\eeg_metrics.exe
shell: cmd
- name: EEG Metrics CI C# Test
run: .\csharp_package\brainflow\examples\eeg_metrics_ci\bin\Release\eeg_metrics_ci.exe --board-id -1 --metric 2 --classifier 2 --model-file %GITHUB_WORKSPACE%\src\ml\train\logreg_mindfulness.onnx
run: .\csharp_package\brainflow\examples\eeg_metrics_ci\bin\Release\netcoreapp3.1\eeg_metrics_ci.exe --board-id -1 --metric 2 --classifier 2 --model-file %GITHUB_WORKSPACE%\src\ml\train\logreg_mindfulness.onnx
shell: cmd
- name: EEG Metrics CI Rust Test
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-latest]
os: [ubuntu-20.04]

steps:
# compile and prepare env
Expand All @@ -21,7 +21,6 @@ jobs:
with:
cmake-version: '3.16.x'
- name: Install Dependencies
if: (matrix.os == 'ubuntu-latest')
run: |
sudo -H apt-get update -y
sudo -H apt-get install -y libbluetooth-dev
Expand Down Expand Up @@ -67,7 +66,6 @@ jobs:
python-version: '3.7.7'
architecture: 'x64'
- name: Install Python Dependencies
if: (matrix.os == 'ubuntu-latest')
run: |
sudo -H apt-get update -y
sudo -H apt-get install -y python3-setuptools python3-pygments
Expand Down

0 comments on commit bfae8da

Please sign in to comment.