Skip to content

Instruction setup for a RPi

Daniel Glock edited this page Dec 20, 2020 · 2 revisions

Thanks to Sebi 🦆 for this how to proceed on a Raspberry Pi:

Step 1: Update your RPi

update your raspberry pi using these commands: apt-get update && apt-get dist-upgrade

Step 2: installation of some used libraries:

apt-get install libilmbase-dev && apt-get install libopenexr-dev && apt-get install libgstreamer1.0-dev && apt-get install libatlas-base-dev

Step 3: install pip3:

apt-get -y install python3-pip

Step 4: install needed python addons:

pip3 install requests && pip3 install imageio && pip3 install pygifsicle && pip3 install opencv-python && pip3 install python-telegram-bot && pip3 install websocket-client && pip3 install arrow

(Raspberry Pi knowledge required !!!)

for bot-autostart at bootup we will need a short bash-script:

cd /home/pi/ touch bot.sh

###give execution rights: chmod +x /home/pi/

example of the bash-script:

#!/bin/bash #python starstcript in bash #afterwards make a crontab with following content: #@reboot /bin/sh /home/pi/telegrambot/bot.sh

change to bot directory

cd home/pi/ #sleep 10 seconds and start python script of the bot: /bin/sleep 10 && /usr/bin/python3 /home/pi/telegrambot/Repetier-Server_Telegram_Bot.py

#edit the .json file adding your personal telegram + repetier settings using nano nano RepetierBot.json

#now try starting your bot for the first time: python3 RepetierBot.py

bot in screen (telebot)

apt-get update && apt-get dist-upgrade -y apt-get install screen -y /usr/bin/screen -S bot /usr/bin/python3 /path/to/bot/RepetierBot.py

bot update

rm RepetierBot.py wget https://raw.githubusercontent.com/DanJunior78/Repetier-Server-Telegram-Bot/main/RepetierBot.py