Giter VIP home page Giter VIP logo

barrybox's Introduction

BarryBox

BarryBox is an MQTT controlled Text-to-Speech speaker. It is connected to a frontend from which you can directly send messages and sounds (from a soundboard) to the speaker. My personal BarryBox is hosted at: https://barrybox.nl/

BarryBox

The BarryBox has the following features:

  • You can setup WiFi credentials and a username on the first startup;
  • Receive messages (audio stream / TTS message) over MQTT;
  • Play a sound at startup;
  • Sending its status (online / offline);
  • Queueing audio streams that it has to play;
  • Stop the currently playing stream if you press the button;
  • Clear the queue of streams if you press the button long.

The backend adds the following features:

  • Make HTTP endpoints available for sending messages and obtaining the status;
  • Save incoming messages into a database;
  • Restricting access with an API key;
  • Automatically register newly connected BarryBoxes by username.

With the frontend you can easily access any BarryBox over the web.

Demo

IMAGE ALT TEXT

Hardware

The BarryBox is based on an ESP32 microcontroller, which controls a PCM5102 DAC.

Quickstart

Flashing the ESP32

  1. Install the ESP32 Arduino core from the Arduino Boards Manager.
  2. Install the required libraries from the Library Manager:
  3. Rename config.sample.h to config.h and add your MQTT server and credentials to the file.
  4. Open BarryBox.ino using the Arduino software.
  5. Select your ESP32 board from the Tools > Boards menu.
  6. Flash your board by selecting Sketch > Upload.

Setting up the Node-RED backend

TODO

Setting up the frontend (Docker/Podman)

The included docker-compose.yml file is compatible with Docker and (rootless) Podman.

  1. Rename include/config.sample.php to include/config.php, add your API key and API URL and set the default user.
  2. Start the container using docker-compose up -d.

barrybox's People

Contributors

joszuijderwijk avatar ev3rt avatar

Stargazers

Alex Bradner avatar tang avatar  avatar DanDan avatar Hugo Marques avatar Filip Górczyński avatar

Watchers

James Cloos avatar tang avatar  avatar

Forkers

apache21

barrybox's Issues

mistype

Hi, I found a mistype.
Small f in "WifiManager.h" should be big F as "WiFiManager.h" or compile will fail.

Frontend without docker and podman

Hi, Im running everything but the frontend in Termux on Android.
Will you in the future make the frontend not dependable on docker or podman?

Hello ^^ Compilation error how to fix ?

I am using Arduino IDE 2.32 with ESP32 SDK version 2.0.13. When I compile, the following section of the code shows an error message:
Compilation error: reference to 'byte' is ambiguous
The code it points to is:

// Handle incoming messages
void callback(char *topic, byte *payload, unsigned int len)
{

String msg = ""; // payload
for (int i = 0; i < len; i++)
{
msg += ((char)payload[i]);
}

Streamable *s = new Streamable();

if (strcmp(topic, tts_channel.c_str()) == 0)
{

// Got TTS message
s->SetType(SAY);

StaticJsonDocument<256> doc;
deserializeJson(doc, payload);

if (!doc.isNull())
{
  const char *text = doc["text"];
  const char *lang = doc["language"];

  s->SetData(text);

  if (isValidLanguage(lang))
    s->SetLanguage(lang);
  else
    s->SetLanguage(DEFAULT_LANGUAGE);
}
else
{
  s->SetData(msg);
}

}
else if (strcmp(topic, stream_channel.c_str()) == 0)
{
if (msg == "stop")
audio.stopSong();
else
{
s->SetType(STREAM);
s->SetData(msg);
}
}
else if (strcmp(topic, soundboard_channel.c_str()) == 0)
{
s->SetType(SOUND);
s->SetData(msg);
}

if (!Q.isFull())
Q.enqueue(s);
}

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.