Giter VIP home page Giter VIP logo

iot-ding-dong's Introduction

iot-ding-dong

Smart doorbell, ding dong in your Telegram.

Workflow: Doorbell Push Button > ESP32 > HTTP Request > Telegram Bot Endpoint > Notify Channel

This project consists of an ESP32 module that is connected to a network. This module is formatted with the Micropython Firmware. When Pin 22 is not closed circuit, a message is sent to a telegram channel via bot.

Requirements

Hardware Components:

System Packages:

  • python3-pyserial
  • micropython
  • ampy

Configuration

In source code file src/main.py, it necessary define the follow values:

NET_SSID = "<YOUR NET_SSID>"
NET_PASSWD = "<YOUR NET_PASSWD>"

TELEGRAM_BOT_TOKEN = "<YOUR TELEGRAM BOT TOKEN>"
TELEGRAM_CHAT_ID = "<YOUR TELEGRAM CHAT ID>"

To discovery TELEGRAM_CHAT_ID, in order to get the group chat id, do as follows:

  • Add the Telegram Bot to the group
  • Get the list of updates for your Bot:
    • curl -s -XGET https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdateS
  • Check chat.id value.

How To Run

First step, it's install micropython firmware in ESP32. Check latest firwmare version on https://micropython.org/download/esp32/. At the time of release of this project, the latest firmware is esp32-20220117-v1.18.bin

$ wget https://micropython.org/resources/firmware/esp32-20220117-v1.18.bin
$ sudo chmod 777 /dev/ttyUSB0
$ esptool.py --port /dev/ttyUSB0 erase_flash
$ esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-20220117-v1.18.bin

/dev/ttyUSB0 value may change depending on other USB peripherals connected on the machine.

Next, upload source code to

$ git clone https://github.com/augustoliks/iot-ding-dong
$ cd ./iot-ding-dong
$ ampy --port /dev/ttyUSB0 put src/main.py /main.py

iot-ding-dong's People

Contributors

c-neto avatar

Watchers

 avatar  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.