GithubHelp home page GithubHelp logo

rolandmoser / esp32-rhasspy-satellite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from romkabouter/esp32-rhasspy-satellite

0.0 0.0 0.0 1.77 MB

The repo has implementing an esp32 standalone MQTT audio streamer. Is is desinged to work as a satellite for Rhasspy (https://rhasspy.readthedocs.io/en/latest/). It supports multiple devices

License: GNU General Public License v3.0

Makefile 0.13% C++ 54.74% Shell 0.65% C 42.66% Python 1.82%

esp32-rhasspy-satellite's Introduction

ESP32 Rhasspy Satellite

The ESP32 Audio Steamer is designed to work as a satellite for Rhasppy (https://rhasspy.readthedocs.io/en/latest/) Please raise an issue if some of the steps do not work or if they are unclear. Support for Snips is dropped.

Features

  • Supports multiple devices, and you are welcomed to add more devices. Read futher below as to how.
  • For the Matrix Voice, during first flash a Raspberri Pi is needed, afer that OTA can be used
  • LED Support
  • OTA Updating
  • Dynamic brightness and colors for idle, hotword and disconnected
  • Mute / unmute microphones via MQTT
  • Mute / unmute speakers via MQTT
  • Adjust volume via MQTT (if supported by device)
  • Adjust output (speaker/jack) via MQTT (if supported by device)
  • Adjust gain via MQTT (if supported by device)
  • Reboot device by sending hashed password
  • Configuration possible in browser
  • Audio playback, recommended not higher than 441000 samplerate (see Known Issues)
  • Hardware button to start session (if supported by device)

Getting started

Matrix Voice

M5 Atom Echo

Audio Kit

INMP441

MAX98357a

MQTT commands

The ESP32 Satellite is subscribed to various topics. The topic SITEID/led, where SITEID is the name you have given the device in settings.ini, is used for commands concerning the leds on the device. When publishing to this topic, the led colors and brightness can be altered without coding and will be saved to a config file

The message can contain 7 keys:

  • brightness: integer value between 0 and 100 (%)
  • hotword_brightness: integer value between 0 and 100 (%)
  • idle: array of 4 codes: [red,green,blue,white], ranging 0-255
  • hotword: array of 4 codes: [red,green,blue,white], ranging 0-255
  • update: array of 4 codes: [red,green,blue,white], ranging 0-255
  • wifi_disconnect: array of 4 codes: [red,green,blue,white], ranging 0-255
  • wifi_connect: array of 4 codes: [red,green,blue,white], ranging 0-255

Example: {"brightness":20,"idle":[240,210,17,0],"hotword":[173,17,240,0]}

The topic SITEID/audio also can receive multiple commands:

  • Mute/unmute microphones: publish {"mute_input":"true"} or {"mute_input":"false"}
  • Mute/unmute playback: publishing {"mute_output":"true"} or {"mute_output":"false"}
  • Change the amp to jack/speaker: publish {"amp_output":"0"} or {"amp_output":"1"} (Only if a device supports this)
  • Adjust mic gain: publish {"gain":5}
  • Adjust volume: publish {"volume": 50} (If device supports this)

Restart the device by publishing {"passwordhash":"yourpasswordhash"} to SITEID/restart

Known issues

  • Uploading sometimes fails or an error is thrown when the uploading is done. Lower the uploadspeed to fix it
  • Audio playback with sample rate higher than 44100 can lead to jitter due to network. Recommended is to use a samplerate of 16000 or 22050
  • Audio playback with matrix voice is not good, code needs to resample to 44100. WIP
  • Update colors do not work yet

Adding devices

It is possible to add a device that has leds, microphones and/or speakers, the statemachine does not have to change for this.

Adding a device is relatively simple:

  • Update settings.ini.example and give your device a uppercase name and a number
  • Update Satellite.cpp and add a #define with the same name and number you created in the settings.
  • Create a hpp file for your device in the devices folder and implement the methods you need, see the other devices for examples.
  • Add a #ifdef in Satellite.cpp as per examples already there
  • Add needed libraries in platform.ini under lib_deps
  • Search for examples in the code or raise an issue/quastion if you need help
  • Add a "get started" md file and link it in the readme.

esp32-rhasspy-satellite's People

Contributors

ayavilevich avatar h3adcra5h avatar hgruber avatar locatw avatar lonely-skywalker avatar markusressel avatar maxbachmann avatar mttstt avatar ntrp avatar rockinglama avatar rolandmoser avatar romkabouter avatar sehraf avatar systemofapwne avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.