bluer-sbc 8.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bluer-sbc might be problematic. Click here for more details.
- bluer_sbc/.abcli/abcli.sh +12 -0
- bluer_sbc/.abcli/actions.sh +11 -0
- bluer_sbc/.abcli/adafruit_rgb_matrix.sh +14 -0
- bluer_sbc/.abcli/alias.sh +5 -0
- bluer_sbc/.abcli/blue_sbc.sh +11 -0
- bluer_sbc/.abcli/camera.sh +20 -0
- bluer_sbc/.abcli/grove.sh +43 -0
- bluer_sbc/.abcli/hat.sh +22 -0
- bluer_sbc/.abcli/install/adafruit_rgb_matrix.sh +15 -0
- bluer_sbc/.abcli/install/grove.sh +29 -0
- bluer_sbc/.abcli/install/lepton.sh +33 -0
- bluer_sbc/.abcli/install/rpi.sh +65 -0
- bluer_sbc/.abcli/install/scroll_phat_hd.sh +14 -0
- bluer_sbc/.abcli/install/sparkfun_top_phat.sh +33 -0
- bluer_sbc/.abcli/install/template.sh +9 -0
- bluer_sbc/.abcli/install/unicorn_16x16.sh +16 -0
- bluer_sbc/.abcli/lepton.sh +15 -0
- bluer_sbc/.abcli/scroll_phat_hd.sh +14 -0
- bluer_sbc/.abcli/session.sh +39 -0
- bluer_sbc/.abcli/sparkfun_top_phat.sh +27 -0
- bluer_sbc/.abcli/tests/README.sh +8 -0
- bluer_sbc/.abcli/tests/camera.sh +47 -0
- bluer_sbc/.abcli/tests/help.sh +65 -0
- bluer_sbc/.abcli/tests/version.sh +8 -0
- bluer_sbc/.abcli/unicorn_16x16.sh +14 -0
- bluer_sbc/README.py +51 -0
- bluer_sbc/__init__.py +17 -0
- bluer_sbc/__main__.py +16 -0
- bluer_sbc/algo/__init__.py +0 -0
- bluer_sbc/algo/diff.py +81 -0
- bluer_sbc/config.env +30 -0
- bluer_sbc/env.py +35 -0
- bluer_sbc/hardware/__init__.py +38 -0
- bluer_sbc/hardware/adafruit_rgb_matrix.py +30 -0
- bluer_sbc/hardware/display.py +112 -0
- bluer_sbc/hardware/grove.py +104 -0
- bluer_sbc/hardware/hardware.py +58 -0
- bluer_sbc/hardware/hat/__init__.py +0 -0
- bluer_sbc/hardware/hat/__main__.py +91 -0
- bluer_sbc/hardware/hat/abstract.py +136 -0
- bluer_sbc/hardware/hat/prototype.py +161 -0
- bluer_sbc/hardware/screen.py +17 -0
- bluer_sbc/hardware/scroll_phat_hd.py +35 -0
- bluer_sbc/hardware/sparkfun_top_phat/__init__.py +0 -0
- bluer_sbc/hardware/sparkfun_top_phat/__main__.py +51 -0
- bluer_sbc/hardware/sparkfun_top_phat/classes.py +104 -0
- bluer_sbc/hardware/unicorn_16x16.py +44 -0
- bluer_sbc/help/__init__.py +0 -0
- bluer_sbc/help/__main__.py +10 -0
- bluer_sbc/help/adafruit_rgb_matrix.py +23 -0
- bluer_sbc/help/camera.py +71 -0
- bluer_sbc/help/functions.py +52 -0
- bluer_sbc/help/grove.py +59 -0
- bluer_sbc/help/hat.py +56 -0
- bluer_sbc/help/lepton.py +39 -0
- bluer_sbc/help/scroll_phat_hd.py +23 -0
- bluer_sbc/help/session.py +26 -0
- bluer_sbc/help/sparkfun_top_phat.py +26 -0
- bluer_sbc/help/unicorn_16x16.py +23 -0
- bluer_sbc/host.py +11 -0
- bluer_sbc/imager/__init__.py +16 -0
- bluer_sbc/imager/camera/__init__.py +3 -0
- bluer_sbc/imager/camera/__main__.py +69 -0
- bluer_sbc/imager/camera/classes.py +259 -0
- bluer_sbc/imager/camera/constants.py +30 -0
- bluer_sbc/imager/classes.py +25 -0
- bluer_sbc/imager/lepton/__init__.py +3 -0
- bluer_sbc/imager/lepton/__main__.py +51 -0
- bluer_sbc/imager/lepton/classes.py +35 -0
- bluer_sbc/imager/lepton/python2.py +70 -0
- bluer_sbc/logger.py +5 -0
- bluer_sbc/sample.env +1 -0
- bluer_sbc/session/__init__.py +0 -0
- bluer_sbc/session/__main__.py +27 -0
- bluer_sbc/session/classes.py +318 -0
- bluer_sbc/session/functions.py +22 -0
- bluer_sbc/urls.py +1 -0
- bluer_sbc-8.3.1.dist-info/METADATA +58 -0
- bluer_sbc-8.3.1.dist-info/RECORD +82 -0
- bluer_sbc-8.3.1.dist-info/WHEEL +5 -0
- bluer_sbc-8.3.1.dist-info/licenses/LICENSE +121 -0
- bluer_sbc-8.3.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
bluer_ai_source_caller_suffix_path /tests
|
|
4
|
+
|
|
5
|
+
bluer_ai_env_dot_load \
|
|
6
|
+
caller,filename=config.env,suffix=/..
|
|
7
|
+
|
|
8
|
+
bluer_ai_env_dot_load \
|
|
9
|
+
caller,plugin=bluer_sbc,suffix=/../..
|
|
10
|
+
|
|
11
|
+
[[ "$abcli_is_github_workflow" == true ]] &&
|
|
12
|
+
export BLUER_SBC_SESSION_IMAGER_ENABLED=0
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_adafruit_rgb_matrix() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [ "$task" == "validate" ]; then
|
|
7
|
+
pushd $abcli_path_git/Raspberry-Pi-Installer-Scripts/rpi-rgb-led-matrix/examples-api-use >/dev/null
|
|
8
|
+
sudo ./demo -D0
|
|
9
|
+
popd >/dev/null
|
|
10
|
+
return
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
abcli_log_error "@sbc: adafruit_rgb_matrix: $task: command not found."
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_camera() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [[ "|capture|preview|" == *"|$task|"* ]]; then
|
|
7
|
+
local options=$2
|
|
8
|
+
local capture_video=$(abcli_option_int "$options" video 0)
|
|
9
|
+
[[ "$capture_video" == 1 ]] &&
|
|
10
|
+
task=capture_video
|
|
11
|
+
|
|
12
|
+
python3 -m bluer_sbc.imager.camera \
|
|
13
|
+
$task \
|
|
14
|
+
"${@:3}"
|
|
15
|
+
|
|
16
|
+
return
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
python3 -m bluer_sbc.imager.camera "$@"
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_grove() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [ "$task" == "info" ]; then
|
|
7
|
+
# https://learn.adafruit.com/scanning-i2c-addresses/raspberry-pi
|
|
8
|
+
i2cdetect -y 1
|
|
9
|
+
return
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
if [ "$task" == "validate" ]; then
|
|
13
|
+
local what=$(abcli_clarify_input $2 button)
|
|
14
|
+
|
|
15
|
+
local args=""
|
|
16
|
+
local filepath="grove.py/grove"
|
|
17
|
+
if [ "$what" == "adc" ]; then
|
|
18
|
+
local filename="adc"
|
|
19
|
+
elif [ "$what" == "button" ]; then
|
|
20
|
+
filename="grove_button"
|
|
21
|
+
args="24"
|
|
22
|
+
elif [ "$what" == "oled_128x64" ]; then
|
|
23
|
+
filepath="Seeed_Python_SSD1315/examples"
|
|
24
|
+
filename="image"
|
|
25
|
+
else
|
|
26
|
+
abcli_log_error "@sbc: grove: $task: $what: hardware not found."
|
|
27
|
+
return
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
filename=$(abcli_clarify_input $3 $filename)
|
|
31
|
+
|
|
32
|
+
local grove_path=$abcli_path_git/$filepath
|
|
33
|
+
|
|
34
|
+
abcli_log "validating grove $what: $grove_path/$filename.py $args"
|
|
35
|
+
pushd $grove_path >/dev/null
|
|
36
|
+
python3 $filename.py $args
|
|
37
|
+
popd >/dev/null
|
|
38
|
+
|
|
39
|
+
return
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
abcli_log_error "@sbc: grove: $task: command not found."
|
|
43
|
+
}
|
bluer_sbc/.abcli/hat.sh
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_hat() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [[ "|input|validate|" == *"|$task|"* ]]; then
|
|
7
|
+
python3 -m bluer_sbc.hardware.hat \
|
|
8
|
+
$task \
|
|
9
|
+
"${@:2}"
|
|
10
|
+
return
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
if [ "$task" == "output" ]; then
|
|
14
|
+
python3 -m bluer_sbc.hardware.hat \
|
|
15
|
+
output \
|
|
16
|
+
--outputs "$2" \
|
|
17
|
+
"${@:3}"
|
|
18
|
+
return
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
python3 -m bluer_sbc.hardware.hat "$@"
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_install_adafruit_rgb_matrix() {
|
|
4
|
+
pushd $abcli_path_git >/dev/null
|
|
5
|
+
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
|
|
6
|
+
cd Raspberry-Pi-Installer-Scripts
|
|
7
|
+
sudo bash ./rgb-matrix.sh
|
|
8
|
+
popd >/dev/null
|
|
9
|
+
|
|
10
|
+
sudo setcap 'cap_sys_nice=eip' /usr/bin/python3.7
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if [ "$BLUER_SBC_HARDWARE_KIND" == "adafruit_rgb_matrix" ]; then
|
|
14
|
+
abcli_install_module adafruit_rgb_matrix 106
|
|
15
|
+
fi
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_install_grove() {
|
|
4
|
+
pushd $abcli_path_git >/dev/null
|
|
5
|
+
|
|
6
|
+
# https://wiki.seeedstudio.com/Grove_Base_Kit_for_Raspberry_Pi/
|
|
7
|
+
curl -L https://github.com/Seeed-Studio/grove.py/raw/master/install.sh \
|
|
8
|
+
--output grove_install.sh
|
|
9
|
+
sudo bash ./grove_install.sh
|
|
10
|
+
|
|
11
|
+
git clone https://github.com/kamangir/grove.py
|
|
12
|
+
cd grove.py
|
|
13
|
+
sudo pip3 install -e .
|
|
14
|
+
|
|
15
|
+
# https://wiki.seeedstudio.com/Grove-OLED-Yellow%26Blue-Display-0.96-%28SSD1315%29_V1.0/
|
|
16
|
+
sudo apt-get install -y python-smbus
|
|
17
|
+
sudo apt-get install -y i2c-tools
|
|
18
|
+
sudo pip3 install Adafruit-BBIO
|
|
19
|
+
sudo pip3 install Adafruit-SSD1306
|
|
20
|
+
|
|
21
|
+
cd ..
|
|
22
|
+
git clone https://github.com/IcingTomato/Seeed_Python_SSD1315.git
|
|
23
|
+
|
|
24
|
+
popd >/dev/null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if [ "$BLUER_SBC_HARDWARE_KIND" == "grove" ]; then
|
|
28
|
+
abcli_install_module grove 106
|
|
29
|
+
fi
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_install_lepton() {
|
|
4
|
+
sudo apt-get update --allow-releaseinfo-change
|
|
5
|
+
|
|
6
|
+
cd ~
|
|
7
|
+
sudo apt-get --yes --force-yes install bison flex aptitude qt4-qmake libqt4-dev
|
|
8
|
+
sudo aptitude --yes --force-yes install libssl-dev
|
|
9
|
+
|
|
10
|
+
# To clone linux for raspberry pi
|
|
11
|
+
git clone --depth=1 https://github.com/raspberrypi/linux
|
|
12
|
+
|
|
13
|
+
# To setup kernel
|
|
14
|
+
cd ~/linux
|
|
15
|
+
KERNEL=kernel7
|
|
16
|
+
make bcm2709_defconfig
|
|
17
|
+
sudo sed -i '$akernel=kernel7.img' /boot/config.txt
|
|
18
|
+
|
|
19
|
+
# To build and install kernel modules
|
|
20
|
+
make -j4 zImage modules dtbs
|
|
21
|
+
sudo make modules_install
|
|
22
|
+
sudo cp arch/arm/boot/dts/*.dtb /boot/
|
|
23
|
+
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
|
|
24
|
+
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
|
|
25
|
+
sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
|
|
26
|
+
|
|
27
|
+
sudo apt --yes --force-yes install python-opencv
|
|
28
|
+
sudo pip install pylepton
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if [ "$BLUER_SBC_SESSION_IMAGER" == "lepton" ]; then
|
|
32
|
+
abcli_install_module lepton 102
|
|
33
|
+
fi
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_install_rpi() {
|
|
4
|
+
pushd $abcli_path_git > /dev/null
|
|
5
|
+
|
|
6
|
+
# https://docs.donkeycar.com/guide/robot_sbc/setup_raspberry_pi/
|
|
7
|
+
sudo apt-get update
|
|
8
|
+
sudo apt-get -y upgrade
|
|
9
|
+
|
|
10
|
+
sudo apt-get --yes --force-yes install build-essential python3 python3-dev python3-pip \
|
|
11
|
+
python3-virtualenv python3-numpy python3-picamera python3-pandas python3-rpi.gpio \
|
|
12
|
+
i2c-tools avahi-utils joystick libopenjp2-7-dev libtiff5-dev gfortran libatlas-base-dev \
|
|
13
|
+
libopenblas-dev libhdf5-serial-dev libgeos-dev git ntp
|
|
14
|
+
|
|
15
|
+
sudo apt-get --yes --force-yes install libilmbase-dev libopenexr-dev libgstreamer1.0-dev \
|
|
16
|
+
libjasper-dev libwebp-dev libatlas-base-dev libavcodec-dev libavformat-dev libswscale-dev \
|
|
17
|
+
libqtgui4 libqt4-test
|
|
18
|
+
|
|
19
|
+
# https://rtcbot.readthedocs.io/en/latest/installing.html
|
|
20
|
+
sudo apt-get --yes --force-yes install python3-numpy python3-cffi python3-aiohttp \
|
|
21
|
+
libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev \
|
|
22
|
+
libswscale-dev libswresample-dev libavfilter-dev libopus-dev \
|
|
23
|
+
libvpx-dev pkg-config libsrtp2-dev python3-opencv pulseaudio
|
|
24
|
+
|
|
25
|
+
cd
|
|
26
|
+
python3 -m virtualenv -p python3 env --system-site-packages
|
|
27
|
+
echo "source env/bin/activate" >> ~/.bashrc
|
|
28
|
+
source env/bin/activate
|
|
29
|
+
|
|
30
|
+
cd git
|
|
31
|
+
git clone https://github.com/autorope/donkeycar
|
|
32
|
+
cd donkeycar
|
|
33
|
+
git checkout master
|
|
34
|
+
pip3 install -e .[pi]
|
|
35
|
+
|
|
36
|
+
pip3 install numpy --upgrade
|
|
37
|
+
|
|
38
|
+
cd
|
|
39
|
+
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=1DCfoSwlsdX9X4E3pLClE1z0fvw8tFESP" > /dev/null
|
|
40
|
+
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
|
|
41
|
+
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=1DCfoSwlsdX9X4E3pLClE1z0fvw8tFESP" -o tensorflow-2.2.0-cp37-cp37m-linux_armv7l.whl
|
|
42
|
+
pip3 install tensorflow-2.2.0-cp37-cp37m-linux_armv7l.whl
|
|
43
|
+
|
|
44
|
+
sudo apt --yes --force-yes install python3-opencv
|
|
45
|
+
|
|
46
|
+
pip3 install PyMySQL==0.10.1
|
|
47
|
+
pip3 install tqdm
|
|
48
|
+
pip3 install boto3
|
|
49
|
+
pip3 install dill
|
|
50
|
+
pip3 install imutils
|
|
51
|
+
|
|
52
|
+
# https://rtcbot.readthedocs.io/en/latest/installing.html
|
|
53
|
+
# pip install rtcbot
|
|
54
|
+
|
|
55
|
+
pip3 install awscli --upgrade
|
|
56
|
+
if [[ $PATH != *"/home/pi/.local/bin"* ]]; then
|
|
57
|
+
export PATH=/home/pi/.local/bin:$PATH
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
popd > /dev/null
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if [ "$abcli_is_rpi" == true ] ; then
|
|
64
|
+
abcli_install_module rpi 109
|
|
65
|
+
fi
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_install_scroll_phat_hd() {
|
|
4
|
+
pushd $abcli_path_home/git >/dev/null
|
|
5
|
+
git clone https://github.com/pimoroni/scroll-phat-hd
|
|
6
|
+
popd >/dev/null
|
|
7
|
+
|
|
8
|
+
# https://github.com/pimoroni/scroll-phat-hd
|
|
9
|
+
sudo apt-get install python3-scrollphathd
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if [ "$BLUER_SBC_HARDWARE_KIND" == "scroll_phat_hd" ]; then
|
|
13
|
+
abcli_install_module scroll_phat_hd 102
|
|
14
|
+
fi
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_install_sparkfun_top_phat() {
|
|
4
|
+
# https://learn.sparkfun.com/tutorials/sparkfun-top-phat-hookup-guide/button-controller
|
|
5
|
+
sudo pip3 install sparkfun-qwiic
|
|
6
|
+
|
|
7
|
+
# https://learn.sparkfun.com/tutorials/sparkfun-top-phat-hookup-guide/ws2812b-leds
|
|
8
|
+
sudo pip3 install adafruit-circuitpython-neopixel
|
|
9
|
+
|
|
10
|
+
# https://github.com/rpi-ws281x/rpi-ws281x-python
|
|
11
|
+
# https://github.com/jgarff/rpi_ws281x
|
|
12
|
+
# https://stackoverflow.com/a/53045690/17619982
|
|
13
|
+
sudo pip3 install rpi_ws281x
|
|
14
|
+
|
|
15
|
+
pushd $abcli_path_home/git >/dev/null
|
|
16
|
+
git clone https://github.com/sparkfun/Top_pHAT_Button_Py
|
|
17
|
+
popd >/dev/null
|
|
18
|
+
|
|
19
|
+
# https://learn.sparkfun.com/tutorials/sparkfun-top-phat-hookup-guide/24-tft-display-linux-54-update
|
|
20
|
+
pushd $abcli_path_home >/dev/null
|
|
21
|
+
curl -L https://cdn.sparkfun.com/assets/learn_tutorials/1/1/7/0/sfe-topphat-overlay.dts \
|
|
22
|
+
--output ./sfe-topphat-overlay.dts
|
|
23
|
+
dtc -@ -I dts -O dtb -o rpi-display.dtbo sfe-topphat-overlay.dts
|
|
24
|
+
sudo cp rpi-display.dtbo /boot/overlays
|
|
25
|
+
popd >/dev/null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if [ "$BLUER_SBC_HARDWARE_KIND" == "sparkfun-top-phat" ]; then
|
|
29
|
+
abcli_install_module sparkfun_top_phat 104
|
|
30
|
+
|
|
31
|
+
# https://learn.sparkfun.com/tutorials/sparkfun-top-phat-hookup-guide/24-tft-display-archived
|
|
32
|
+
con2fbmap 1 1
|
|
33
|
+
fi
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_install_unicorn_16x16() {
|
|
4
|
+
pushd $abcli_path_git >/dev/null
|
|
5
|
+
git clone https://github.com/pimoroni/unicorn-hat-hd
|
|
6
|
+
popd >/dev/null
|
|
7
|
+
|
|
8
|
+
# https://github.com/pimoroni/unicorn-hat-hd
|
|
9
|
+
sudo raspi-config nonint do_spi 0
|
|
10
|
+
sudo apt-get --yes --force-yes install python3-pip python3-dev python3-spidev
|
|
11
|
+
sudo pip3 install unicornhathd
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if [ "$BLUER_SBC_HARDWARE_KIND" == "unicorn_16x16" ]; then
|
|
15
|
+
abcli_install_module unicorn_16x16 101
|
|
16
|
+
fi
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_lepton() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [[ "|capture|preview|" == *"|$task|"* ]]; then
|
|
7
|
+
python3 -m bluer_sbc.imager.lepton \
|
|
8
|
+
$task \
|
|
9
|
+
--output_path $abcli_object_path \
|
|
10
|
+
"${@:2}"
|
|
11
|
+
return
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
python3 -m bluer_sbc.imager.lepton "$@"
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_scroll_phat_hd() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [ "$task" == "validate" ]; then
|
|
7
|
+
pushd $abcli_path_git/scroll-phat-hd/examples >/dev/null
|
|
8
|
+
python3 plasma.py
|
|
9
|
+
popd >/dev/null
|
|
10
|
+
return
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
abcli_log_error "@sbc: scroll_phat_hd: $task: command not found."
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_session() {
|
|
4
|
+
local task=${1:-start}
|
|
5
|
+
|
|
6
|
+
if [ "$task" == "start" ]; then
|
|
7
|
+
local options=$2
|
|
8
|
+
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
|
9
|
+
local run_sudo=$(abcli_option_int "$options" sudo 0)
|
|
10
|
+
local do_upload=$(abcli_option_int "$options" upload 1)
|
|
11
|
+
|
|
12
|
+
abcli_log "@sbc: session @ $abcli_object_name started ..."
|
|
13
|
+
|
|
14
|
+
abcli_mlflow_tags_set \
|
|
15
|
+
$abcli_object_name \
|
|
16
|
+
session,host=$abcli_hostname,$BLUER_SBC_SESSION_OBJECT_TAGS
|
|
17
|
+
|
|
18
|
+
local sudo_prefix=""
|
|
19
|
+
# https://stackoverflow.com/a/8633575/17619982
|
|
20
|
+
[[ "$run_sudo" == 1 ]] &&
|
|
21
|
+
sudo_prefix="sudo -E "
|
|
22
|
+
|
|
23
|
+
abcli_eval dryrun=$do_dryrun \
|
|
24
|
+
$sudo_prefix \
|
|
25
|
+
python3 -m bluer_sbc.session \
|
|
26
|
+
start \
|
|
27
|
+
"${@:3}"
|
|
28
|
+
local status="$?"
|
|
29
|
+
|
|
30
|
+
[[ "$do_upload" == 1 ]] &&
|
|
31
|
+
abcli_upload - $abcli_object_name
|
|
32
|
+
|
|
33
|
+
abcli_log "@sbc: session ended."
|
|
34
|
+
|
|
35
|
+
return $status
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
python3 -m bluer_sbc.session "$@"
|
|
39
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_sparkfun_top_phat() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [ "$task" == "validate" ]; then
|
|
7
|
+
local what=${2:-button}
|
|
8
|
+
|
|
9
|
+
if [ "$what" == button ]; then
|
|
10
|
+
pushd $abcli_path_git/Top_pHAT_Button_Py/examples >/dev/null
|
|
11
|
+
python3 top_phat_button_ex2.py
|
|
12
|
+
popd >/dev/null
|
|
13
|
+
return
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ "$what" == leds ]; then
|
|
17
|
+
sudo python3 -m bluer_sbc.hardware.sparkfun_top_phat \
|
|
18
|
+
validate_leds
|
|
19
|
+
return
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
sudo python3 -m bluer_sbc.hardware.sparkfun_top_phat "$@"
|
|
23
|
+
return
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
sudo python3 -m bluer_sbc.hardware.sparkfun_top_phat "$@"
|
|
27
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function test_bluer_sbc_camera_capture() {
|
|
4
|
+
[[ "$BLUER_SBC_SESSION_IMAGER_ENABLED" == 0 ]] &&
|
|
5
|
+
return 0
|
|
6
|
+
|
|
7
|
+
local options=$1
|
|
8
|
+
|
|
9
|
+
abcli_select \
|
|
10
|
+
test_bluer_sbc_camera_capture-$(abcli_string_timestamp_short)
|
|
11
|
+
|
|
12
|
+
abcli_eval ,$options \
|
|
13
|
+
bluer_sbc_camera \
|
|
14
|
+
capture \
|
|
15
|
+
image
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function test_bluer_sbc_camera_capture_video() {
|
|
19
|
+
[[ "$BLUER_SBC_SESSION_IMAGER_ENABLED" == 0 ]] ||
|
|
20
|
+
[[ "$abcli_is_rpi" = false ]] &&
|
|
21
|
+
return 0
|
|
22
|
+
|
|
23
|
+
local options=$1
|
|
24
|
+
|
|
25
|
+
abcli_select \
|
|
26
|
+
test_bluer_sbc_camera_capture_video-$(abcli_string_timestamp_short)
|
|
27
|
+
|
|
28
|
+
abcli_eval ,$options \
|
|
29
|
+
bluer_sbc_camera \
|
|
30
|
+
capture \
|
|
31
|
+
video \
|
|
32
|
+
--length 3 \
|
|
33
|
+
--preview 1
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function test_bluer_sbc_camera_preview() {
|
|
37
|
+
[[ "$BLUER_SBC_SESSION_IMAGER_ENABLED" == 0 ]] &&
|
|
38
|
+
return 0
|
|
39
|
+
|
|
40
|
+
local options=$1
|
|
41
|
+
|
|
42
|
+
abcli_eval ,$options \
|
|
43
|
+
bluer_sbc_camera \
|
|
44
|
+
preview \
|
|
45
|
+
- \
|
|
46
|
+
--length 3
|
|
47
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function test_bluer_sbc_help() {
|
|
4
|
+
local options=$1
|
|
5
|
+
|
|
6
|
+
local module
|
|
7
|
+
for module in \
|
|
8
|
+
"@sbc" \
|
|
9
|
+
\
|
|
10
|
+
"@sbc adafruit_rgb_matrix" \
|
|
11
|
+
"@sbc adafruit_rgb_matrix validate" \
|
|
12
|
+
\
|
|
13
|
+
"@sbc browse" \
|
|
14
|
+
\
|
|
15
|
+
"@sbc camera" \
|
|
16
|
+
"@sbc camera capture" \
|
|
17
|
+
"@sbc camera capture image" \
|
|
18
|
+
"@sbc camera capture video" \
|
|
19
|
+
"@sbc camera preview" \
|
|
20
|
+
\
|
|
21
|
+
"@sbc hat" \
|
|
22
|
+
"@sbc hat input" \
|
|
23
|
+
"@sbc hat output" \
|
|
24
|
+
"@sbc hat validate" \
|
|
25
|
+
\
|
|
26
|
+
"@sbc lepton" \
|
|
27
|
+
"@sbc lepton capture" \
|
|
28
|
+
"@sbc lepton preview" \
|
|
29
|
+
\
|
|
30
|
+
"@sbc pypi" \
|
|
31
|
+
"@sbc pypi browse" \
|
|
32
|
+
"@sbc pypi build" \
|
|
33
|
+
"@sbc pypi install" \
|
|
34
|
+
\
|
|
35
|
+
"@sbc pytest" \
|
|
36
|
+
\
|
|
37
|
+
"@sbc scroll_phat_hd" \
|
|
38
|
+
"@sbc scroll_phat_hd validate" \
|
|
39
|
+
\
|
|
40
|
+
"@sbc session" \
|
|
41
|
+
"@sbc session start" \
|
|
42
|
+
\
|
|
43
|
+
"@sbc sparkfun_top_phat" \
|
|
44
|
+
"@sbc sparkfun_top_phat validate" \
|
|
45
|
+
\
|
|
46
|
+
"@sbc test" \
|
|
47
|
+
"@sbc test list" \
|
|
48
|
+
\
|
|
49
|
+
"@sbc unicorn_16x16" \
|
|
50
|
+
"@sbc unicorn_16x16 validate" \
|
|
51
|
+
\
|
|
52
|
+
"grove info" \
|
|
53
|
+
"grove validate" \
|
|
54
|
+
"grove validate oled_128x64" \
|
|
55
|
+
\
|
|
56
|
+
"bluer_sbc"; do
|
|
57
|
+
abcli_eval ,$options \
|
|
58
|
+
abcli_help $module
|
|
59
|
+
[[ $? -ne 0 ]] && return 1
|
|
60
|
+
|
|
61
|
+
abcli_hr
|
|
62
|
+
done
|
|
63
|
+
|
|
64
|
+
return 0
|
|
65
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function bluer_sbc_unicorn_16x16() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
if [ "$task" == "validate" ]; then
|
|
7
|
+
pushd $abcli_path_git/unicorn-hat-hd/examples >/dev/null
|
|
8
|
+
python3 rainbow.py
|
|
9
|
+
popd >/dev/null
|
|
10
|
+
return
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
abcli_log_error "@sbc: unicorn_16x16: $task: command not found."
|
|
14
|
+
}
|
bluer_sbc/README.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from bluer_objects import file, README
|
|
5
|
+
|
|
6
|
+
from bluer_sbc import NAME, VERSION, ICON, REPO_NAME
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
image_prefix = "https://github.com/kamangir/blue-bracket/raw/main/images/"
|
|
10
|
+
design_prefix = "https://github.com/kamangir/blue-bracket/blob/main/designs/"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def items() -> List[str]:
|
|
14
|
+
return [
|
|
15
|
+
"[]({}{}.md)".format(
|
|
16
|
+
image_prefix,
|
|
17
|
+
item["image"],
|
|
18
|
+
design_prefix,
|
|
19
|
+
item["name"],
|
|
20
|
+
)
|
|
21
|
+
for item in [
|
|
22
|
+
{
|
|
23
|
+
"image": "blue3-1.jpg",
|
|
24
|
+
"name": "blue3",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"image": "chenar-grove-1.jpg",
|
|
28
|
+
"name": "chenar-grove",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"image": "cube-1.jpg",
|
|
32
|
+
"name": "cube",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"image": "eye_nano-1.jpg",
|
|
36
|
+
"name": "eye_nano",
|
|
37
|
+
},
|
|
38
|
+
]
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def build():
|
|
43
|
+
return README.build(
|
|
44
|
+
items=items(),
|
|
45
|
+
cols=4,
|
|
46
|
+
path=os.path.join(file.path(__file__), ".."),
|
|
47
|
+
ICON=ICON,
|
|
48
|
+
NAME=NAME,
|
|
49
|
+
VERSION=VERSION,
|
|
50
|
+
REPO_NAME=REPO_NAME,
|
|
51
|
+
)
|