Giter Club home page Giter Club logo

klipper-tg-bot's Introduction

kllipper-tg-bot

Telegram bot for Klipper

Features

  • Printing state change and progress notification
  • Emergency stop, restart, etc commands
  • Custom gcode execution

Installation

Use the following command to enable automatic start-up of systemd user instances

sudo loginctl enable-linger ${USER}

Install pip and virtualenv:

sudo apt-get install python3-pip python3-virtualenv cython

Execute the following commands:

cd ~/
git clone https://github.com/ksergey/klipper-tg-bot.git
cd klipper-tg-bot
./scripts/install.sh

This script will install python packages, create a python virtual environment at ~/klipper-tg-bot-env and install a systemd service file under user.

To manual start or stop service execute the following command:

# start service
systemctl --user start klipper-tg-bot.service

# stop service
systemctl --user stop klipper-tg-bot.service

if you want to capture images (or video) from web camera you should install ffmpeg:

sudo apt-get install ffmpeg

Configuration

After installation you should configure the bot. By default config file placed in user home directory and has name klipper-tg-bot.conf.

Configuration example:

[telegram]
# telegram bot api token from @BotFather (https://t.me/BotFather)
token = 270485614:AAHfiqksKZ8WmR2zSjiQ7_v4TMAKdiHm9T0
# telegram chat id where bot will talk and receive commands. It's could be telegram group or private chat with bot.
# @getmyid_bot (https://t.me/getmyid_bot) could help to obtain that number.
chat_id = 11111

[moonraker]
# address where moonraker service listen
endpoint = 127.0.0.1:7125

[webcam]
# input device for ffmpeg to capture image and video. It's could be url of jpeg stream or path to camera device
# remove the section if you don't have web camera
input = http://127.0.0.1/webcam/?action=stream
# Constant Rate Factor (see https://trac.ffmpeg.org/wiki/Encode/H.264)
crf = 26

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.