• Stars
    star
    1,609
  • Rank 27,898 (Top 0.6 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hardware for SUSI AI https://susi.ai

SUSI.AI on Linux

Codacy Badge Build Status Join the chat at https://gitter.im/fossasia/susi_hardware Twitter Follow

This repository contains components to run SUSI.AI on the desktop or a headless smart speaker together with the SUSI.AI Server. Functionalities implemented here include using the microphone to collect voice commands, converting speech to text (STT) using components such as Deep Speech, Flite, Pocket Sphinx, IBM Watson or others, controlling the volume with voice commands and providing a simple GTK interface. In order to use the JSON output of the SUSI.AI Server (written in Java) we use a SUSI.AI API Python Wrapper. The ultimate goal of the project to enable users to install SUSI.AI anywhere, apart from desktops and smart speakers on IoT devices, car systems, washing machines and more.

The functionalities of the project are provided as follows:

  • Hotword detection works for hotword "Susi"
  • Voice detection for Speech to Text (STT) using with Google Speech API, IBM Watson Speech to Text API
  • Voice output for Text to Speech (TTS) working with Google Voice, IBM Watson TTS, Flite TTS
  • SUSI.AI response working through SUSI.AI API Python Wrapper

Project Overview

The SUSI.AI ecosystem consists of the following parts:

 * Web Client and Content Management System for the SUSI.AI Skills - Home of the SUSI.AI community
 |_ susi.ai   (React Application, User Account Management for the CMS, a client for the susi_server at https://api.susi.ai the content management system for susi skills)
 
 * server back-end
 |_ susi_server        (the brain of the infrastructure, a server which computes answers from queries)
 |_ susi_skill_data    (the knowledge of the brain, a large collection of skills provided by the SUSI.AI community)
 
 * android front-end
 |_ susi_android       (Android application which is a client for the susi_server at https://api.susi.ai)
 
 * iOS front-end
 |_ susi_iOS           (iOS application which is a client for the susi_server at https://api.susi.ai)
 
 * Smart Speaker - Software to turn a Raspberry Pi into a Personal Assistant
 | Several sub-projects come together in this device
 |_ susi_installer     (Framework which can install all parts on a RPi and Desktops, and also is able to create SUSIbian disk images)
 |_ susi_python        (Python API for the susi_server at https://api.susi.ai or local instance)
 |_ susi_server        (The same server as on api.susi.ai, hosted locally for maximum privacy. No cloud needed)
 |_ susi_skill_data    (The skills as provided by susi_server on api.susi.ai; pulled from the git repository automatically)
 |_ susi_linux         (a state machine in python which uses susi_python, Speech-to-text and Text-to-speech functions)
 |_ susi.ai            (React Application, the local web front-end with User Account Management, a client for the local deployment of the susi_server, the content management system for susi skills)

Installation

susi_linux is normally installed via the SUSI Installer. In this case there are binaries for configuration and starting and others available in $HOME/SUSI.AI/bin (under default installation settings).

In case of manual installations, the wrappers in wrapper directory need to be configured to point to the respective installation directories and location of the config.json file.

Setting up and configuring Susi on Linux / RaspberryPi

Configuration is done via the file config.json which normally resides in $HOME/.config/SUSI.AI/config.json.

The script $HOME/SUSI.AI/bin/susi-config is best used to query, set, and change configuration of susi_linux. There is also a GUI interface to the configuration in $HOME/SUSI.AI/bin/susi-linux-configure.

The possible keys and values are given by running $HOME/SUSI.AI/bin/susi-config keys

Some important keys and possible values:

- `stt` is the speech to text service, one of the following choices:
    - `google` - use Google STT service
    - `watson` - IBM/Watson STT
    - `bing` - MS Bing STT
    - `pocketsphinx` - PocketSphinx STT system, working offline
    - `deepspeech-local` - DeepSpeech STT system, offline, WORK IN PROGRESS
- `tts` is the text to speech service, one of the following choices:
    - `google` - use Google TTS
    - `watson` - IBM/Watson TTS (login credential necessary)
    - `flite` - flite TTS service working offline
- `hotword.engine` is the choice if you want to use snowboy detector as the hotword detection or not
    - `Snowboy` to use snowboy
    - `PocketSphinx` to use Pocket Sphinx
- `wakebutton` is the choice if you want to use an external wake button or not
    - `enabled` to use an external wake button
    - `disabled` to disable the external wake button
    - `not available` for systems without dedicated wake button

Other interfaces for configuration are available for Android and iOS.

Manual configuration is possible, the allowed keys in [`config.json`](config.json) are currently
- `device`: the name of the current device
- `wakebutton`: whether a wake button is available or not
- `stt`: see above for possible settings
- `tts`: see above for possible settings
- `language': language for STT and TTS processing
- `path.base`: directory where support files are installed
- `path.sound.detection`: sound file that is played when detection starts, relative to `data_base_dir`
- `path.sound.problem`: sound file that is played on general errors, relative to `data_base_dir`
- `path.sound.error.recognition`: sound file that is played on detection errors, relative to `data_base_dir`
- `path.sound.error.timeout`: sound file that is played when timing out waiting for spoken commands
- `path.flite_speech`: flitevox speech file, relative to `data_base_dir`
- `hotword.engine`: see above for possible settings
- `hotword.model`: (if hotword.engine = Snowboy) selects the model file for the hotword
- `susi.mode`: access mode to `accounts.susi.ai`, either `anonymous` or `authenticated`
- `susi.user`: (if susi.mode = authenticated) the user name (email) to be used
- `susi.pass`: (if susi.mode = authenticated) the password to be used
- `roomname`: free form description of the room
- `watson.stt.user`, `watson.stt.pass`, `watson.tts.user`, `watson.tts.pass`: credentials for IBM/Watson server for TTS and STT
- `watson.tts.voice`: voice name selected for IBM/Watson TTS
- `bing.api`: Bing STT API key

For details concerning installation, setup, and operation on RaspberryPi, see
the documentation at [SUSI Installer](https://github.com/fossasia/susi_installer).



## Information for developers

This section is intended for developer.

### **Important:** Tests before making a new release

1. The hotword detection should have a decent accuracy
2. SUSI Linux shouldn't crash when switching from online to offline and vice versa (failing as of now)
3. SUSI Linux should be able to boot offline when no internet connection available (failing as of now)

### Roadmap

- Offline Voice Detection (if possible with satisfactory results)

### General working of SUSI

- SUSI.AI follows a finite state system for the code architecture.
- Google TTS and STT services are used as default services but if the internet fails, a switch to offline services PocketSphinx (STT) and Flite (TTS) is made automatically


### Run SUSI Linux for development purposes

If installed via the SUSI Installer, systemd unit files are installed:
- `ss-susi-linux.service` for the user bus, use as user with `systemctl --user start/enable ss-susi-linux`
- `[email protected]` for the system bus, use as `root` user to start a job for a specific user, 
  independent from whether the user is logged in or not: `sudo systemctl start/enable ss-susi-linux@USER`

By default, it is ran in _production_ mode, where log messages are limited to _error_ and _warning_ only.
In development, you may want to see more logs, to help debugging. You can switch it to "verbose" mode by 2 ways:

1. Run it manually

- Stop systemd service by `sudo systemctl stop ss-susi-linux`
- Use Terminal, _cd_ to `susi_linux` directory and run

python3 -m susi_linux -v

or repeat `v` to increase verbosity:

python3 -m susi_linux -vv


2. Change command run by `systemd`

- Edit the _/lib/systemd/system/ss-susi-linux.service_ and change the command in `ExecStart` parameter:

```ini
ExecStart=/usr/bin/python3 -m susi_linux -v --short-log
  • Reload systemd daemon: sudo systemctl daemon-reload

  • Restart the servive: sudo systemctl restart ss-susi-linux

  • Now you can read the log via journalctl:

    • journalctl -u ss-susi-linux
    • or journalctl -fu ss-susi-linux to get updated when the log is continuously produced.

The -v option is actually the same as the 1st method. The --short-log option is to exclude some info which is already provided by journalctl. For more info about logging feature, see this GitHub issue.

More Repositories

1

visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Python
9,894
star
2

open-event-server

The Open Event Organizer Server to Manage Events https://test-api.eventyay.com
Python
2,906
star
3

phimpme-android

Phimp.me Photo Imaging and Picture Editor https://play.google.com/store/apps/details?id=org.fossasia.phimpme
Java
2,580
star
4

susi_server

SUSI.AI server backend - the Artificial Intelligence server for personal assistants https://susi.ai
Java
2,500
star
5

susi_android

SUSI.AI Android App https://play.google.com/apps/testing/ai.susi
Kotlin
2,418
star
6

open-event-frontend

The frontend for the Open Event API Server https://test.eventyay.com
JavaScript
2,313
star
7

open-event-droidgen

Open Event Android App Generator https://github.com/fossasia/open-event-android/raw/apk/sample-apk-fossasia17-development.apk
Java
2,048
star
8

pslab-android

PSLab Android App https://play.google.com/store/apps/details?id=io.pslab
Java
2,038
star
9

susi.ai

SUSI.AI Web Client https://susi.ai
JavaScript
2,026
star
10

open-event-wsgen

Open Event Website App Generator https://sched.eventyay.com
JavaScript
2,013
star
11

open-event-attendee-android

Open Event Attendee Android General App https://github.com/fossasia/open-event-android/blob/apk/open-event-dev-app-playStore-debug.apk
Kotlin
1,947
star
12

star-me

Star FOSSASIA Repositories on Github and Support the Community
JavaScript
1,906
star
13

fossasia.org

FOSSASIA Website https://fossasia.org
Less
1,883
star
14

susi_iOS

SUSI AI iOS app http://susi.ai
Swift
1,870
star
15

loklak_search

Frontend Search for loklak server https://loklak.org
TypeScript
1,840
star
16

open-event-organizer-android

Open Event Mobile App for Organizers and Entry Managers https://play.google.com/store/apps/details?id=com.eventyay.organizer
Java
1,793
star
17

badgeyay

Attendee Badge Generator for Conferences
JavaScript
1,791
star
18

badge-magic-android

Badge Magic with LEDs - Android App https://play.google.com/apps/testing/org.fossasia.badgemagic
Kotlin
1,788
star
19

meilix

Beautiful Linux System https://meilix.org | APT Repo: http://meilix.fossasia.org
Python
1,779
star
20

pslab-desktop

PSLab Desktop Application https://pslab.io
JavaScript
1,770
star
21

susper.com

Susper Decentralised Search Engine https://susper.com
TypeScript
1,742
star
22

neurolab-android

NeuroLab Android https://github.com/fossasia/neurolab-android/raw/apk/neurolab-dev-debug.apk
Java
1,710
star
23

open-event

Open Event Project, Samples, Documentation and Artwork http://open-event-dev.herokuapp.com
Python
1,701
star
24

labs.fossasia.org

Projects Website for FOSSASIA http://labs.fossasia.org
CSS
1,669
star
25

query-server

Query Server Search Engines
Python
1,665
star
26

gci16.fossasia.org

FOSSASIA Google Code-In Website 2016/17 http://gci16.fossasia.org
HTML
1,659
star
27

codeheat.org

Codeheat Coding Contest Website https://codeheat.org
Less
1,639
star
28

pslab-hardware

PSLab Hardware Design and Schematics https://pslab.io
Prolog
1,633
star
29

pslab-python

Python Library for PSLab Desktop: https://pslab.io
Python
1,632
star
30

flappy-svg

Flappy Bird in SVG. Play it at http://fossasia.github.io/flappy-svg/
JavaScript
1,613
star
31

pslab-scripts

Pocket Science Lab - Scripts for Sensor Experiments
Python
1,604
star
32

gci17.fossasia.org

FOSSASIA Google Code-In Website 2017/18 https://gci17.fossasia.org
CSS
1,598
star
33

gci15.fossasia.org

FOSSASIA Google Code-In Website 2015/16 http://gci15.fossasia.org
HTML
1,596
star
34

susi_skill_cms

A web application framework to edit susi skills http://skills.susi.ai
JavaScript
1,583
star
35

2017.fossasia.org

FOSSASIA Summit 2017 https://2017.fossasia.org
HTML
1,580
star
36

2018.fossasia.org

FOSSASIA Summit 2018 https://2018.fossasia.org
HTML
1,577
star
37

fossasia-communities

FOSSASIA API Files of Communities in Asia
1,576
star
38

open-event-attendee-ios

iOS app for open event
Swift
1,570
star
39

gci14.fossasia.org

FOSSASIA Google Code-In Website 2014/15 http://gci14.fossasia.org
JavaScript
1,569
star
40

knittingpattern

A Python Library for Knitting Patterns
Python
1,569
star
41

2016.fossasia.org

FOSSASIA Summit 2016 https://2016.fossasia.org
CSS
1,564
star
42

2012.fossasia.org

FOSSASIA Summit 2012 Event Site https://2012.fossasia.org
CSS
1,563
star
43

pslab-firmware

Firmware for PSLab Open Hardware Platform https://pslab.io
C
1,559
star
44

loklak_webclient

loklak web application
JavaScript
1,553
star
45

loklak_wok_android

"loklak wok" is a harvesting peer for the loklak_server https://github.com/fossasia/loklak_wok_android/raw/apk/loklak_wok_1.2_20160201.apk
Java
1,549
star
46

susi_chromebot

SUSI.AI Chrome Extension
JavaScript
1,548
star
47

directory.api.fossasia.net

Python
1,547
star
48

yaydoc

Docs! Yay! http://yaydoc.org
JavaScript
1,546
star
49

x-mario

x-mario, the gaming distro
Shell
1,542
star
50

searss

Search to RSS tool
Python
1,542
star
51

neurolab-hardware

Neurolab Hardware
1,541
star
52

2015.fossasia.org

FOSSASIA Summit 2015 Event Site https://2015.fossasia.org
CSS
1,539
star
53

meilix-systemlock

Meilix system lock
Python
1,537
star
54

meilix-generator

WebApp for generating a custom ISO image based on Meilix http://meilix.org
HTML
1,537
star
55

2014.fossasia.org

FOSSASIA Summit 2014 Event Site http://2014.fossasia.org
HTML
1,537
star
56

phimpme-drupal

Phimp.me - Photo App on Drupal
PHP
1,534
star
57

knitlib

Knitting backend library for knitting machines
Python
1,532
star
58

labyrinth

FOSSASIA Labyrinth
JavaScript
1,532
star
59

yaydoc-artwork

Open Source Books
1,532
star
60

sg18.sciencehack.asia

UNESCO Hackathon Website at the FOSSASIA Summit Singapore https://sg18.sciencehack.asia
CSS
1,532
star
61

phimpme-wordpress

Phimp.me - Photo App on Wordpress
PHP
1,532
star
62

CommonsNet

Sharing and Transparency for WiFi Networks
JavaScript
1,531
star
63

knitweb

knitting web app frontend and backend
JavaScript
1,530
star
64

pslab-case

PSLab Case https://pslab.io
1,530
star
65

fossasia.net

FOSSASIA.net Website https://fossasia.net
HTML
1,530
star
66

2011.fossasia.org

FOSSASIA Summit 2011 Event Site http://2011.fossasia.org
HTML
1,530
star
67

unesco.sciencehack.asia

UNESCO Hackathon Website https://unesco.sciencehack.asia
CSS
1,530
star
68

pslab-expeyes

PSLab for ExpEYES - Science Experiments and Data Acquisition for Physics Education https://pslab.io
Python
1,529
star
69

susi_tweetbot

Twitter Bot for Susi http://susi.ai
JavaScript
1,529
star
70

api.fossasia.net

FOSSASIA API
JavaScript
1,529
star
71

fossasia-nodemailer

JavaScript
1,529
star
72

xmario_buildscript

x-mario build script
Shell
1,529
star
73

2023.fossasia.org

HTML
1,528
star
74

hotelxoai.com

The Open Source Hotel in the Mekong Delta in Vietnam
HTML
1,527
star
75

2010.fossasia.org

FOSSASIA Summit 2010 Event Site http://2010.fossasia.org
HTML
1,527
star
76

susi_smart_box

SUSI.AI Smart Box https://susi.ai
1,526
star
77

blog.fossasia.org

Issue Tracker for https://blog.fossasia.org
1,526
star
78

fossasia11-drupal

FOSSASIA 2011 Drupal Site
PHP
1,526
star
79

open-event-next

Open Event Frontend "Next Version" with Vue.js
TypeScript
1,525
star
80

perspektive89.com

Open Source Journal Perspektive89.com
1,525
star
81

fossasia10-drupal

FOSSASIA 2010 Drupal Site
PHP
1,525
star
82

pslab-test-jig

PSLab Test Jig - Boards to test PSLab hardware https://pslab.io
1,523
star
83

cmap.api.fossasia.net

FOSSASIA Community Map
JavaScript
1,523
star
84

fossasia.github.io

FOSSASIA.GitHub.io
HTML
1,523
star
85

feed.api.fossasia.net

PHP
1,522
star
86

loklak-webtweets

FOSSASIA Tweets with loklak http://fossasia.github.io/loklak-webtweets/
Less
1,522
star
87

foss.vn

FOSS.vn Website http://foss.vn
HTML
1,522
star
88

susi_skill_data

A storage place for SUSI.AI skills https://susi.ai
1,521
star
89

susi_fbbot

Susi Facebook Bot http://susi.ai
JavaScript
1,519
star
90

knitpat

Knitting Pattern Format
Python
1,518
star
91

jugaadfest.com

Jugaadfest in India https://jugaadfest.com
HTML
1,518
star
92

susi_desktop

Desktop Client for http://api.susi.ai
JavaScript
1,517
star
93

loklak_wp_plugins

PHP
1,517
star
94

susi_telegrambot

Susi Telegram Bot http://susi.ai
JavaScript
1,516
star
95

susi_slackbot

Ask Susi Messengers http://susi.ai
JavaScript
1,516
star
96

open-event-scraper

Google spreadsheet parsing for Open Event JSON
Python
1,516
star
97

event-collect

event website listing to Open Event format scraper and converter
Python
1,516
star
98

knitserver

JavaScript
1,515
star
99

accounts.susi.ai

Accounts Service for SUSI.AI http://accounts.susi.ai
JavaScript
1,514
star
100

loklak_tweetheatmap

Heat map with tweets by search query using Loklak API and OpenLayers 3
JavaScript
1,513
star