Skip to content

Commit

Permalink
Merge pull request #28 from SEPIA-Framework/dev
Browse files Browse the repository at this point in the history
SEPIA-Home v2.6.2 release candidate
  • Loading branch information
fquirin authored May 7, 2022
2 parents 98e8450 + c1d4a08 commit 58c9f67
Show file tree
Hide file tree
Showing 40 changed files with 982 additions and 182 deletions.
74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
## Release history and changelog

### v2.6.2 - 2022.05.08

Updated client to v0.24.2:
* Added virtual keyboard for DIY clients with touchscreen + 'virtualKeyboard' URL parameter
* Remember media player volume and added option 'playerVolume' to settings file
* Added support for remote media volume control with new slider component
* Added volume control for Youtube player widget
* Added Teach-UI basic command import/export + support for file drag & drop
* Added new settings option for 'defaultNewsRegion' + append 'defaultNewsRegion' and 'appRegionCode' to assistant requests
* New avatar 'Proto' + improved avatar code
* New skins 'Blue Canary', 'Odyssey AI' and 'Vectors Reloaded' + style tweaks
* New URL parameter 'skinId'
* Improved 'awaitDialog' timer to reset properly and increased awaitDialog time from 15s to 20s
* Added CLEXI GPIO events for audio 'eventEffectsOn' and 'eventEffectsOff' + fixed a bug in LED control
* Fixed a shared remote-actions bug for 'play-on' music-cards
* Fixed a bug in 'stt-socket-worker' to properly handle 'no-speech' events
* Fixed a bug in microphone test function for invalid rms values
* Updated Porcupine to v2.1 (replaced v2.0)
* Added pages for Porcupine wake-word format conversion and activation restore ('xtensions' folder)
* Improved settings import/export with new 'UI.showFileImportAndViewPopup' component
* Improved storing and loading of app-settings from server (account-data)
* Added 'environment' to settings file and read at start (if no URL parameter is given)
* Improved login-retry timer
* Updated web-audio lib to v0.9.11 with better pre-load cache and error handling
* Updated CLEXI lib to v0.9.1 and implemented basic 'clexi.requestStateRefresh'
* Improved iOS build script (still beta)
* Smaller fixes and code tweaks (credits, dual-screen, onchange listeners, input events, etc.)

Updated Control-HUB (admin-tools) to v1.4.3:
* Improved smart-home page with better UX for authentication data and tweaked some styles
* Fixed some smaller bugs in new light skin
* Improved code uploader to make use of new JSON response format and info
* Improved login error handling
* Updated CLEXI lib to v0.9.1 to support 'hasSubscription' feature

Updated Assist-server to v2.6.2:
* New automatic-setup feature using YAML config file to define setup tasks, users and DNS + improved setup code (create random passwords, write log etc.)
* Added a new TTS endpoint to support byte-range streaming audio-files (required by Apple devices and potantially faster for large files)
* Added new settings option to switch between new streaming and old static TTS audio ('/tts/' and '/tts-stream/')
* Added installer for 'txt2pho' TTS engine (German MBROLA only) + tweaked some voice speeds
* Better checks for correct smart-home HUB authentication types + smaller smart-home interface tweaks
* Added 'appRegionCode' and new 'defaultNewsRegion' to NluInput class (to be used in services)
* Improved News service to support 'language' parameter (e.g.: "show me news in German") + 'defaultNewsRegion' and 'appRegionCode' to make news independant of user language
* Added a 'region' parameter to news-outlets.json
* Improved settings loader and 'getConfig' endpoint with new 'PropertiesReader' that will return ALL settings (properties file + defaults)
* Streamlined SDK endpoint responses to return JSON format and added more useful info
* Updated media-player widgets to support volume memory + volume control for Youtube (see client as well)
* Replaced Porcupine v2.0 files with v2.1 but added a download script for old version (in case you need v2.0)
* Fixed a bug in TTS settings.json that broke German Mary-TTS
* Smaller fixes and code tweaks

Updated Core-tools to v2.2.11:
* Added new 'appendLineToFile' and 'readYamlFile' to 'FilesAndStreams' class
* Updated Jackson lib and added 'jackson-dataformat-yaml' dependency
* Improved HTTP GET method 'Connectors.apacheHttpGETjson'
* Added new property-file reader with caching
* Added new 'Spark.streamFile' feature for byte-range requests (see new TTS features above)
* Added new 'createRandomString' and 'shuffleString' methods to 'Security' class
* Changed 'smart_speaker' string in 'ENVIRONMENTS' (we have both now 'smart_speaker' and just 'speaker')

Updated WebSocket Chat-Server to v1.3.4:
* Updated eclipse.paho MQTT client to v1.2.5
* Updated core-tools to v2.2.11

Updated Teach-Server to v2.2.4:
* Updated core-tools to v2.2.11

Other servers, tools and common changes:
* Improved SEPIA-Home install and run scripts, added an automatic-setup template and an option to create one single, external folder for user data (using symlinks)
* Improved DIY client package with more Pulseaudio scripts e.g. for AEC (beta), more hardware scripts, better installation and run scripts etc.
* Improved CLEXI to support WS281x and APA102 RGB LEDs via SPI bus (new GPIO item)
* Updated SDK to support new SEPIA-Home v2.6.2
* Improved Docker container with automatic-setup, extra user folder and simplified update (just pull new container)

### v2.6.1 - 2022.01.30

Updated client to v0.24.1:
Expand Down
26 changes: 17 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ RUN echo 'Installing SEPIA-Home...' && \
ntpdate nginx \
espeak-ng espeak-ng-espeak libpopt0 && \
#
# Update time-sync - NOTE: not possible in Docker; will use host clock
# sudo ntpdate -u ntp.ubuntu.com
# Update time-sync - NOTE: not possible in Docker? will use host clock?
# sudo timedatectl set-ntp true
#
# Clean up
apt-get clean && apt-get autoclean && apt-get autoremove -y && \
Expand All @@ -45,7 +45,7 @@ USER admin

RUN echo "Downloading SEPIA-Home (custom bundle) ..." && \
#
# Make target and temporary folder (SEPIA should be in ~/SEPIA !!)
# Make target and temporary folder (SEPIA should be in ~/SEPIA)
mkdir -p ~/SEPIA/tmp && \
cd ~/SEPIA/tmp && \
#
Expand All @@ -63,7 +63,18 @@ RUN echo "Downloading SEPIA-Home (custom bundle) ..." && \
bash setup.sh 7 && \
#
# Set up Nginx (HTTP)
sudo cp nginx/sites-available/sepia-fw-http.conf /etc/nginx/sites-enabled/sepia-fw-http.conf
sudo cp nginx/sites-available/sepia-fw-http.conf /etc/nginx/sites-enabled/sepia-fw-http.conf && \
#
# Prepare automatic-setup and user1
cd automatic-setup && \
cp template.yaml config.yaml && \
sed -i 's/nickname: Testy/nickname: Boss/' config.yaml && \
sed -i 's/email: test@sepia.localhost/email: user1@sepia.localhost/' config.yaml && \
sed -i 's/password: test12345/password: <random>/' config.yaml && \
touch docker-setup && cd .. && \
#
# Set up external data folder
bash scripts/create-external-data-folder.sh -yu
#
# Optional, final modifications imported from build folder:
# ADD *.sh /home/admin/SEPIA/
Expand All @@ -77,13 +88,10 @@ RUN echo "Downloading SEPIA-Home (custom bundle) ..." && \
# Comment: https://www.elastic.co/guide/en/elasticsearch/reference/5.3/vm-max-map-count.html (the container will inherit this from the host)
#
# Set up SEPIA
# NOTE: This has to be done (e.g. by sharing external config folder) before server can run without error
# e.g.:
# NOTE: If the file '$SEPIA_SHARE/setup/automatic-setup/docker-setup' exists the automatic setup will run
# 0 - Create an EMPTY shared folder: SEPIA_SHARE=/home/[my-user]/sepia-home-share && mkdir -p $SEPIA_SHARE
# 1 - Make a Docker volume out of it: docker volume create --opt type=none --opt device=$SEPIA_SHARE --opt o=bind sepia-home-share
# 1 - Run container with terminal: docker run --rm --name=sepia_home -it -v sepia-home-share:/home/admin/SEPIA sepia/home:vX.X.X /bin/bash
# 2 - Inside container finish setup: bash setup.sh (run at least setup steps 4 and 1)
# 3 - Exit container and run as server: docker run --rm --name=sepia_home -p 20726:20726 -d -v sepia-home-share:/home/admin/SEPIA sepia/home:vX.X.X
# 3 - Run the server: docker run --rm --name=sepia_home -p 20726:20726 -d -v sepia-home-share:/home/admin/sepia-home-data sepia/home:vX.X.X
# ---------------------

# Start
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Installation without script (any platform):
* The run-script will ping the servers to see if everything started as planned. You can repeat this test with test-cluster.bat/test-cluster.sh to make sure. If you see errors check sepia-*/log.out.
* You should be able to reach the web-app of SEPIA via one of the URLs suggested at the end of the run-script, e.g.: http://localhost:20721/app/index.html (replace 'localhost' with the server IP if you are on a different machine).
* Extend the now visible login-box to verify the hostname field. The hostname should point to your SEPIA server (e.g. localhost or an IP like 192.168.0.10).
* For testing purposes (only!) you can use the admin-acount to log-in, by default the ID is "admin@sepia.localhost" or "uid1003" (don't use the "assistant" account). The password has been set during setup.
* For testing purposes (only!) you can use the admin-acount to log-in, by default the ID is `admin@sepia.localhost` or `uid1003` (don't use the "assistant" account!). The password has been set during setup. Check out the 'next steps' section to learn how to create new users.

NOTE: Using the web-app via local network IPs (except 127.0.0.1 aka localhost) will limit the functionality of some features like the speech-recognition, geo-location and notifications due to security reasons (browser restriction, requires HTTPS to work).
See the "Secure server" section below for further instructions on how to set up your own HTTPS web-server, BUT if you are just using your own local servers there is another solution that will work fine. You can add exceptions
Expand All @@ -41,7 +41,7 @@ to your browser as well :-) see [this guide](https://github.com/SEPIA-Framework/
If your local tests worked well it is time to **create your own (non-admin) account**:

* To create new users ([detailed tutorial](https://github.com/SEPIA-Framework/sepia-docs/wiki/Create-and-Edit-Users)) use the SEPIA Control-HUB (aka tools page or admin-tools): http://localhost:20721/tools/index.html (registration via 'real' e-mail is possible in theory but not fully implemented in the clients right now).
* Login to the Control-HUB using your admin account. By extending the login-box you can check if the right server for authentication is selected (very similar to the hostname above) it should look like this 'http://localhost:20721' or this 'http://192.168.0.10:20721' for example.
* Login to the Control-HUB using your admin account (default username and email are `uid1003` and `admin@sepia.localhost`). By extending the login-box you can check if the right server for authentication is selected (very similar to the hostname above) it should look like this 'http://localhost:20721' or this 'http://192.168.0.10:20721' for example.
* Open the menu (top-left) and go to the "User Management" page. Choose an email (can be fake, but a real address could come in handy later for password reset etc.) then press "put on whitelist", add a password and finally press "create". Note the message in the result-box indicating your new ID.
* You should now be able to log-in with your new account (use the ID received during "create" or the email you chose).

Expand Down
13 changes: 6 additions & 7 deletions sepia-client-installation/rpi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Common Instructions

Tested with Raspberry Pi OS Buster and Bullseye on RPi4 B 2GB and 4GB.
Expected to work with RPi3 1GB and might even work with RPi Zero 512GB if wake-word is disabled.
Tested with Raspberry Pi OS Buster (recommended) and Bullseye on RPi4 B 2GB and 4GB.
Works on RPi3 1GB and maybe even on RPi Zero 512GB if wake-word and display are disabled.

### 1) Install Raspberry Pi OS Lite

Expand Down Expand Up @@ -31,17 +31,16 @@ Expected to work with RPi3 1GB and might even work with RPi Zero 512GB if wake-w
Use `bash menu.sh` to choose a specific hardware installation script or run them manually. Here you'll find a few more tips:

* **USB microphone** and the audio jack for sound:
* This script might be useful to set the correct default devices: `bash install_usb_mic.sh`
* Alternatively try `sudo raspi-config` and check the audio settings
* **Reboot** the system
* `pulsemixer` should be enough to set up your devices.
* Alternatively try `bash install_usb_mic.sh` and check the audio settings via `sudo raspi-config`
* For **WM8960 microphone boards** like ReSpeaker (2 and 4 mic HAT), Waveshare Audio-HAT, Adafruit Voice Bonnet:
* Install drivers: `bash install_respeaker_mic.sh`
* Optionally run `bash update_respeaker_boot.sh` to deactivate the default RPi audio jack and HDMI (audio) if you don't use it
* **Reboot** the system
* **Reboot** the system and check settings via `pulsemixer`
* For **Hyperpixel** touchscreen:
* Install drivers: `curl https://get.pimoroni.com/hyperpixel4 | bash`
* **Reboot** the system
* If you have problems with the touchscreen (swapped axis etc.) run `bash update_hyperpixel4_boot.sh`
* There are more hardware scripts available in the 'install' folder
* Tweak for small displays to fix Chromium "bug" (use AFTER step "2a SEPIA Client Installation" is finished):
* If your screen width is smaller than 500px, e.g. 480px (typical Hyperpixel width) you can use `bash adapt_to_small_screen.sh 20` to shift the screen by 20px

Expand Down
4 changes: 4 additions & 0 deletions sepia-client-installation/rpi/import_self_signed_SSL_cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ read -p "Press any key to import to '/usr/local/share/ca-certificates/' (CTRL+C
sudo cp "downloads/$2.crt" "/usr/local/share/ca-certificates/$2.crt"
echo "Updating ca-certificates ..."
sudo update-ca-certificates
#For Chromium import cert to NSSDB:
#certutil -d "sql:$HOME/.pki/nssdb" -A -t "C,," -n "$1" -i "/usr/local/share/ca-certificates/$2.crt"
echo "For Chromium import you might need to run:"
echo "bash import_self_signed_SSL_to_Chromium.sh \"$1\" \"$2\""
echo "DONE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: bash import_self_signed_SSL_to_Chromium.sh [host:port] [cert-name]"
echo "Example: bash import_self_signed_SSL_to_Chromium.sh \"sepia-home.local:20726\" sepia-home"
exit 1
fi
echo "Importing '/usr/local/share/ca-certificates/$2.crt' as '$1' into NSSDB"
certutil -d "sql:$HOME/.pki/nssdb" -A -t "C,," -n "$1" -i "/usr/local/share/ca-certificates/$2.crt"
echo "DONE"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ mkdir -p chromium-deb-files
cd chromium-deb-files
PLATFORM=""
VERSION=""
if [ $(cat /etc/debian_version) -lt 11 ]; then
IS_BUSTER=$(echo "$(cat /etc/debian_version)" | awk '{if ($1 < 11 && $1 >= 10) print "true"; else print "false"}')
if [ "$IS_BUSTER" = "true" ]; then
VERSION="92.0.4515.98~buster-rpt2"
else
VERSION="92.0.4515.98-rpt2"
Expand Down
8 changes: 3 additions & 5 deletions sepia-client-installation/rpi/install_iqaudio_zero_hat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ sudo apt-get install -y git
git clone https://github.com/iqaudio/Pi-Codec.git
cd Pi-Codec
sudo alsactl restore -f IQaudIO_Codec_OnboardMIC_record_and_SPK_playback.state
DRIVER_FOLDER=$(pwd)
#DRIVER_FOLDER=$(pwd)
echo ""
echo "Some notes:"
echo ""
echo "After setup (and reboot) check: raspi-config -> system options -> audio"
echo ""
echo "You might need to run 'pulsemixer' afterwards and change source setup (F3) to:"
echo "Multichannel Duplex"
echo "Run 'pulsemixer' afterwards and change source setup (F3) to:"
echo "Multichannel Duplex (or your preferred settings)"
echo ""

18 changes: 18 additions & 0 deletions sepia-client-installation/rpi/install_raspiaudio_mic_plus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
echo "This script will install the Raspiaudio MIC+ HAT with on-board speakers."
echo ""
echo "NOTE: It will download and execute the official script via 'sudo'."
echo ""
read -p "Press any key to continue (or CTRL+C to abort)."
echo ""
sudo wget -O - mic.raspiaudio.com | sudo bash
echo ""
echo "Some notes:"
echo ""
echo "Volume of the mic seems to be very low at least on RPi OS Bullseye."
echo "You might need to set a high gain value via client settings."
echo ""
echo "Run 'pulsemixer' afterwards and change source setup (F3) to:"
echo "Multichannel Duplex"
echo ""

9 changes: 3 additions & 6 deletions sepia-client-installation/rpi/install_respeaker_mic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ echo "This script will install WM8960 boards like ReSpeaker (2 and 4 mic HAT), W
echo "Please follow the instructions precisely!"
echo "The installation may require you to reboot -> install 2nd time (after kernal updates) -> reboot again."
echo ""
echo "You can use 'bash update_respeaker_boot.sh' to deactivate RPi's default audio jack and HDMI (audio)."
echo "Depending on your setup you might need to edit ~/.asoundrc as well to set the correct defaults."
echo ""
read -p "Press any key to continue (or CTRL+C to abort)."
echo ""
sudo apt-get update
Expand All @@ -23,10 +20,10 @@ echo ""
echo "If you don't see any cards after first reboot (arecord -l) try:"
echo "sudo service seeed-voicecard stop && sudo service seeed-voicecard start && arecord -l"
echo ""
echo "Then check: raspi-config -> system options -> audio (look for seeed or WM8960 etc.)"
echo "Check out subfolder './pulseaudio' to configure 4mic linear and 6mic devices."
echo ""
echo "You might need to run 'pulsemixer' afterwards and change source setup (F3) to:"
echo "Multichannel Duplex"
echo "Run 'pulsemixer' afterwards and change source setup (F3) to:"
echo "Multichannel Duplex (or your preferred settings)"
echo ""
echo "If that doesn't work try to run the setup once more and repeat the steps:"
echo "cd $DRIVER_FOLDER && sudo ./install.sh"
Expand Down
51 changes: 51 additions & 0 deletions sepia-client-installation/rpi/pulseaudio/aec_only.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
# check: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/tree/master/src/modules/echo-cancel for Parameters

# masters - use: 'pactl list short sources' and 'pactl list short sinks' to get names
source_master=alsa_input.platform-soc_sound.multichannel-input
sink_master=alsa_output.platform-soc_sound.multichannel-output

# names
source_name=input.aec_source
sink_name=output.aec_sink

# properties
source_properties=device.description=$source_name
sink_properties=device.description=$sink_name

# other options
aec_method='speex'
aec_args='"filter_size_ms=200 agc=0 denoise=0 dereverb=0 echo_suppress=1 echo_suppress_attenuation=0 echo_suppress_attenuation_active=0"'
#note for speex: attenuation is negative db, filtering needs channels=1
#note 2: on recording speex usually takes around 5s to calibrate ... each time!
#aec_method='webrtc'
#aec_args='"voice_detection=0 noise_suppression=1 analog_gain_control=0 digital_gain_control=0 high_pass_filter=1 drift_compensation=1 intelligibility_enhancer=1 extended_filter=0"'
#aec_args='"mobile=1 routing_mode=loud-speakerphone comfort_noise=0"'
#note for webrtc: remove channels and use master format if you want to experiment with beamforming
#aec_method='null'
#aec_args=

# more stuff to potentially improve performance:
#if [ $(pactl list modules short | grep module-suspend-on-idle | wc -l) -gt 0 ]; then
# pactl unload-module module-suspend-on-idle
#fi

# load the module
if [ $(pactl list modules short | grep module-echo-cancel | wc -l) -gt 0 ]; then
pactl unload-module module-echo-cancel
echo "Pulseaudio: unloaded old instance of 'module-echo-cancel'"
fi
pactl load-module module-echo-cancel \
source_name=$source_name \
source_master=$source_master \
source_properties=$source_properties \
sink_name=$sink_name sink_master=$sink_master \
sink_properties=$sink_properties \
rate=32000 \
channels=1 \
use_master_format=0 \
aec_method=$aec_method \
aec_args=$aec_args

pactl set-default-source $source_name
pactl set-default-sink $sink_name
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ aec_method='webrtc'
aec_args='"voice_detection=0 noise_suppression=0 analog_gain_control=0 digital_gain_control=0 high_pass_filter=0"'

# load the module
pactl unload-module module-echo-cancel
if [ $(pactl list modules short | grep module-echo-cancel | wc -l) -gt 0 ]; then
pactl unload-module module-echo-cancel
echo "Pulseaudio: unloaded old instance of 'module-echo-cancel'"
fi
pactl load-module module-echo-cancel \
source_name=$source_name \
source_master=$source_master \
Expand Down
Loading

0 comments on commit 58c9f67

Please sign in to comment.