Skip to main content

Python Telegram Bot for Meltingplot 3D Printers.

Project description

This package provides a Telegram Bot for the Meltingplot 3D Printers. The communication is using the Duet HTTP API.

See https://github.com/Duet3D/RepRapFirmware/wiki/HTTP-requests for more details.

Installation

sudo apt-get install ffmpeg
cd /home/ubuntu/
mkdir mp_telegram_bot
cd mp_telegram_bot
python3 -m venv venv
source venv/bin/activate
pip install mp_telegram_bot
mkdir config
# see next section for content of config.json
nano config/config.json
sudo cp /home/ubuntu/mp_telegram_bot/venv/mp_telegram_bot.service /etc/systemd/system
sudo systemctl enable mp_telegram_bot.service
sudo systemctl start mp_telegram_bot.service

Content of config/config.json

{
    "duet_api_address": "10.42.0.3",
    "duet_api_password": "password",
    "webcam_url": "http://10.42.0.3:8082/picture/1/current/",
    "telegram_token": "you get a new token from BotFather https://t.me/botfather"
}

Usage of Telegram Bot

Create a macro on your duet called pair_telegram_bot

The content of that file is:

M291 P"waiting for telegram bot ..." T60 ;indicate the telegram bot that we want to pair a new user

Execute the macro on your mobile to pair your telegram with your newly created bot. Wait for the telegram bot to take over. It will send you a start code to connect your telegram with your bot. After that, the bot creats a challenge code and showing you that challenge code again on your DWC. Press the link in the Messagebox and you are paired with your bot.

The following commands are currently supported:

/webcam - to create a 5 second webcam snippet
/unregister - to remove yourself from the paired user
/register <challenge> - to supply the provided challenge
/start - to start the challenge response auth

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mp_telegram_bot-0.0.1-py3-none-any.whl (17.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page