Skip to content

MPvI/Einlassbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

ESP32 + Speaker + Telegram Bot = Doorbell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published