Giter Site home page Giter Site logo

einlassbot's Introduction

Overview

This is the README.md for the Einlassbot.

Thanks to everyone who wrote a piece of software or designed a piece of hardware used in this project.

Purpose

The purpose of the Einlassbot is to announce a users name if he writes Tür (German for Door) into a specific Telegram group. It can therefore be considered as a replacement for a doorbell.

You may call this an overengineered solution for a doorbell. However, it was a present for Xmas, build in a couple of days and brought a lot of joy.

Components

The system is made up of 3 components:

  • A microcontroller, running the bot logic and playing audio
  • A Telegram Bot, sitting in a Telegram group
  • A backend providing TTS functionality

How can I use this?

To use this you need at least your own Telegram Bot. Adapt bot.py to connect to your WiFi, use the correct token for your bot and query your flask endpoint. You should also make sure to adapt the docker-compose.yml so that the container is reachable for you.

  • Create Telegram Bot and add to group
  • Flash ESP32 with LoBo MicroPython
  • Wire up the circuit
  • Transfer the modified bot.py and main.py with ampy to the ESP32
  • Run docker container
  • Reboot ESP32 and enjoy (hopefully) ;-)

Microcontroller - /einlassbot

Circuit

Just connect everything as described for the Kemo M031N example circuit. Input to the potentiometer comes from one of the DAC pins, I use Pin(25). Supply voltage comes from the 5V pin of the ESP. Make sure your power supply can take the load. I use a probably total overkill 3A Raspberry Pi power supply. If you experience trouble with your power supply and are capable of reading the German language you may try this.

Possible Improvements

  • Higher supply voltage (12V) for amp so it can actually reach 3.5W
  • Use microcontroller with more than 100kB of RAM (less pain)
  • First MicroPython project, probably lots of code improvements
  • Stop using flask dev server (bad!)
  • Audio quality?

Telegram Bot

Make sure the bot is part of your specific group. The bot needs to receive all messages. Command Botfather to set privacy mode to Disable with /setprivacy. Longpolling Telegram BotAPI get_updates() from microcontroller.

Backend - /py-web-service

  • Docker container based on base/archlinux
  • Docker Compose to build and run the container
  • Flask as framework for the endpoint
  • gTTS performing TTS with translate.google.com
  • pydub converting mp3 to wav
  • SoX converting audio to 8bit PCM wav file

Backend Magic - not part of the project

einlassbot's People

Contributors

mpvi avatar

Stargazers

Retep Relleum avatar

Watchers

James Cloos avatar  avatar Retep Relleum 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.