Spaces:
Sleeping
Sleeping
Commit
·
086b12f
1
Parent(s):
476bded
Adding support for Portiloop V2
Browse files- PortiloopV2.md +26 -0
- installation.sh +33 -0
- portiloop/src/__init__.py +2 -1
- portiloop/src/utils.py +1 -1
- setup.py +3 -4
PortiloopV2.md
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# Portiloop V2
|
3 |
+
|
4 |
+
You've just got your hands on the hardware for the Portiloop V2 (A Google Coral Mini and a PiEEG board). Here are the steps you need to follow to get started using the EEG capture, the Spindle detection software, and the TPU processing.
|
5 |
+
|
6 |
+
## Accessing the Google Coral
|
7 |
+
|
8 |
+
These first steps will help you set up an SSH connection to the device.
|
9 |
+
* Power up the board through the USB power port.
|
10 |
+
* Connect another USB cable to the OTG-port on the board and to your *linux* host machine. Follow the following steps to connect to the board through serial:
|
11 |
+
* `ls /dev/ttyMC*`
|
12 |
+
* `screen /dev/ttyMC0`
|
13 |
+
If you see a message telling you that screen is busy, you can use `sudo lsof /dev/ttyMC0` and then retry the screen step.
|
14 |
+
* Login to the board using default username and password: mendel
|
15 |
+
* Once you are logged in, you can now connect to you desired wifi network using nmtui.
|
16 |
+
* If you want to access the board through ssh (which is recommended for any sort of development):
|
17 |
+
* On the serial console, open the `/etc/ssh/sshd_config` file.
|
18 |
+
* Scroll down to the `PasswordAuthenticated` line and change the 'no' to a 'yes'.
|
19 |
+
Once all of that is done, you should be able to ssh into your device, using either the ip address or the hostname. If some issues arise, make sure you are conneted to the same network.
|
20 |
+
|
21 |
+
## Dependencies
|
22 |
+
|
23 |
+
To install all dependencies to the original portiloop code, clone it and run the installation.sh script.
|
24 |
+
|
25 |
+
## Jupyter notebook
|
26 |
+
|
installation.sh
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# echo "Installing dependencies with apt-get..."
|
4 |
+
# sudo apt-get update
|
5 |
+
# sudo apt-get install -y python3-matplotlib python3-scipy python3-dev libasound2-dev jupyter-notebook jupyter
|
6 |
+
# echo "done"
|
7 |
+
|
8 |
+
# echo "Installing latest pycoral and tflite-runtime..."
|
9 |
+
# wget https://github.com/google-coral/pycoral/releases/download/v2.0.0/pycoral-2.0.0-cp37-cp37m-linux_aarch64.whl
|
10 |
+
# wget https://github.com/google-coral/pycoral/releases/download/v2.0.0/tflite_runtime-2.5.0.post1-cp37-cp37m-linux_aarch64.whl
|
11 |
+
# pip3 uninstall tflite-runtime
|
12 |
+
# pip3 uninstall pycoral
|
13 |
+
# pip3 install tflite_runtime-2.5.0.post1-cp37-cp37m-linux_aarch64.whl
|
14 |
+
# pip3 install pycoral-2.0.0-cp37-cp37m-linux_aarch64.whl
|
15 |
+
# echo "done"
|
16 |
+
|
17 |
+
echo "Cloning the portiloop repo..."
|
18 |
+
git clone https://github.com/Portiloop/portiloop-software.git
|
19 |
+
echo "done"
|
20 |
+
|
21 |
+
echo "Installing the dependencies... [This may take a while]"
|
22 |
+
cd portiloop-software && pip3 install -e .
|
23 |
+
echo "done"
|
24 |
+
|
25 |
+
echo "Activating the widgets for the jupyter notebook..."
|
26 |
+
jupyter nbextension enable --py widgetsnbextension
|
27 |
+
echo "done"
|
28 |
+
|
29 |
+
echo "Creating workspace directory..."
|
30 |
+
mkdir workspace
|
31 |
+
mkdir workspace/edf_recording
|
32 |
+
echo "done"
|
33 |
+
|
portiloop/src/__init__.py
CHANGED
@@ -4,7 +4,8 @@ import io
|
|
4 |
def is_coral():
|
5 |
try:
|
6 |
with io.open('/sys/firmware/devicetree/base/model', 'r') as m:
|
7 |
-
|
|
|
8 |
except Exception: pass
|
9 |
return False
|
10 |
|
|
|
4 |
def is_coral():
|
5 |
try:
|
6 |
with io.open('/sys/firmware/devicetree/base/model', 'r') as m:
|
7 |
+
line = m.read().lower()
|
8 |
+
if 'phanbell' in line or "coral" in line: return True
|
9 |
except Exception: pass
|
10 |
return False
|
11 |
|
portiloop/src/utils.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from EDFlib.edfwriter import EDFwriter
|
2 |
from pyedflib import highlevel
|
3 |
from portilooplot.jupyter_plot import ProgressPlot
|
4 |
from pathlib import Path
|
|
|
1 |
+
# from EDFlib.edfwriter import EDFwriter
|
2 |
from pyedflib import highlevel
|
3 |
from portilooplot.jupyter_plot import ProgressPlot
|
4 |
from pathlib import Path
|
setup.py
CHANGED
@@ -5,12 +5,12 @@ import io
|
|
5 |
def is_coral():
|
6 |
try:
|
7 |
with io.open('/sys/firmware/devicetree/base/model', 'r') as m:
|
8 |
-
|
|
|
9 |
except Exception: pass
|
10 |
return False
|
11 |
|
12 |
requirements_list = ['wheel',
|
13 |
-
'EDFlib-Python',
|
14 |
'pyEDFLib',
|
15 |
'numpy',
|
16 |
'portilooplot',
|
@@ -20,8 +20,7 @@ requirements_list = ['wheel',
|
|
20 |
'matplotlib']
|
21 |
|
22 |
if is_coral():
|
23 |
-
requirements_list += ['
|
24 |
-
'spidev',
|
25 |
'pylsl-coral',
|
26 |
'pyalsaaudio']
|
27 |
else:
|
|
|
5 |
def is_coral():
|
6 |
try:
|
7 |
with io.open('/sys/firmware/devicetree/base/model', 'r') as m:
|
8 |
+
line = m.read().lower()
|
9 |
+
if 'phanbell' in line or "coral" in line: return True
|
10 |
except Exception: pass
|
11 |
return False
|
12 |
|
13 |
requirements_list = ['wheel',
|
|
|
14 |
'pyEDFLib',
|
15 |
'numpy',
|
16 |
'portilooplot',
|
|
|
20 |
'matplotlib']
|
21 |
|
22 |
if is_coral():
|
23 |
+
requirements_list += ['spidev',
|
|
|
24 |
'pylsl-coral',
|
25 |
'pyalsaaudio']
|
26 |
else:
|