nlef / moonraker-telegram-bot

Telegram bot to interact with Moonraker (Klipper Web API Server)
Creative Commons Zero v1.0 Universal
245 stars 64 forks source link

[Bug]: Standard config with fresh Pi+Kiauh doesn't work #288

Closed MatteAce closed 11 months ago

MatteAce commented 11 months ago

What happened and in what context?

I've installed a fresh Pi 3B (with USB startup disk) with the Raspberry Installer, Lite 32-bit. Installed Kiauh, installed klipper, moonraker, mainsail. Updated everything.

Installed Telegram Bot, got a key from BotFather, included it in the config.

The bot won't answer, log says uncaught exception. I have no idea why. The Pi is definitely connected to the internet since I can update everything. Tried to reinstall it three times, still through Kiauh, still broken.

I don't know if it's relevant, but Mainsail through the Moonraker Update Manager UI has the moonraker-telegram-bot v1.5-0-gb9b47003 green "up-to-date" button on the right saying instead "UNKNOWN".

CleanShot 2023-09-30 at 17 28 16

I've also tried adding the user/password section in the bot config and adding my system's username (not root) and pass but nothing changed, I only got a slightly longer and more angry log.

Please help.

If needed, paste the relevant bot log contents here.


Current Moonraker telegram bot config [bot] server = localhost

[progress_notification] percent = 5 height = 5 time = 5

[timelapse] cleanup = true height = 0.2 time = 5 target_fps = 30


2023-09-30 17:13:22,590 - main - ERROR -

2023-09-30 17:13:22,922 - main - ERROR - Uncaught exception Traceback (most recent call last): File "/home/pi/moonraker-telegram-bot/bot/main.py", line 1106, in bot_updater = start_bot(configWrap.secrets.token, configWrap.bot_config.socks_proxy) File "/home/pi/moonraker-telegram-bot/bot/main.py", line 1047, in start_bot updater.start_polling() File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/ext/updater.py", line 422, in start_polling self._init_thread(self.dispatcher.start, "dispatcher", ready=dispatcher_ready) File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/ext/updater.py", line 342, in _init_thread name=f"Bot:{self.bot.id}:{name}", File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/bot.py", line 377, in id return self.bot.id File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/bot.py", line 371, in bot self._bot = self.get_me() File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/bot.py", line 134, in decorator result = func(*args, **kwargs) File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/bot.py", line 458, in get_me result = self._post('getMe', timeout=timeout, api_kwargs=api_kwargs) File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/bot.py", line 299, in _post return self.request.post( File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/utils/request.py", line 361, in post result = self._request_wrapper( File "/home/pi/moonraker-telegram-bot-env/lib/python3.9/site-packages/telegram/utils/request.py", line 277, in _request_wrapper raise Unauthorized(message) telegram.error.Unauthorized: Unauthorized Stack (most recent call last): File "/home/pi/moonraker-telegram-bot/bot/main.py", line 64, in handle_exception logger.error(

If needed, paste the relevant bot journal contents here.

No response

What branch does this occur on?

master

Reports only on latest master or development branches!

MatteAce commented 11 months ago

Just tried commenting the whole [authorization] section in moonraker.conf and nothing changed

MatteAce commented 11 months ago

AGH! an unwanted character got mixed up in the auth code got from BotFather... it was as easy as copypasting the auth code again. Fixed, sorry!