Duet Telegram bot
-
Hi guys,
Resurrecting this as I found very little other info on this (coming from Octoprint, Telegram was super useful)
I just tried to install and run the bot on a Pi Zero but it failed.
Here is the process I used (might help others to spot my error or serve as instructions - once fixed):- Install headless Rasbian image (2019-09-26-raspbian-buster-lite.img)
- Installed NodeJS as follows (the instructions did not work with the Pi Zero armv6 CPU)
- sudo apt-get install curl
- curl -o node-v9.7.1-linux-armv6l.tar.gz https://nodejs.org/dist/v9.7.1/node-v9.7.1-linux-armv6l.tar.gz
- tar -xzf node-v9.7.1-linux-armv6l.tar.gz
- sudo cp -r node-v9.7.1-linux-armv6l/* /usr/local/
- checked if it works with:
- node -v
- npm -v
- added git just in case:
- sudo apt-get install git
- installed the 11 dependencies listed on the page with:
- sudo npm i <dependency name>
- ran the bot by typing duetbot
- answered yes to create the default config
- used telegram to create the bot account:
- Open a chat with @botfather in Telegram Messenger.
- Send /newbot to @botfather and follow the instructions.
- received a long token (example only) HTTP API: 432423:DSFDD_KeassESFD23221Hdksa213I
- edited the default config with:
- sudo nano /home/pi/.duetbot.json
- set the IP of the DuetBoard
- set the token to the one received without HTTP API: (432423:DSFDD_KeassESFD23221Hdksa213I)
- ran the bot by typing duetbot
Duetbot then started:
Connecting to duet...
Checking for upload dir...
Uploads enabled
Bot started...followed by this error:
Failed to process updates. { Error: 401: Unauthorized
at buildConfig.then.then.then.then (/usr/local/lib/node_modules/duet-telegram/node_modules/telegraf/core/network/client.js:281:17)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
code: 401,
response: { ok: false, error_code: 401, description: 'Unauthorized' },
description: 'Unauthorized',
parameters: {},
on:
{ method: 'getUpdates?offset=0&limit=100&timeout=30',
payload: {} } }I further checked that the duetwifi has no password set as I see from the notes that this is not yet supported. Unfortunately still no luck. Any help is apprechiated.
-
@IdefixRC
Not sure if you every got this fixed, but I noticed I would only get this message when nothing was printing. IE Idle state has no status but printing messages came through. -
I installed and it worked but not all commands.
/status - not working
/macros - not working -
its not working with my duet 3. are there updates available or something like that?
-
Hi, I'm installing the whole....just a question: do the bot starts automatically with the Pi or should I do something to make it autosart?
Thanks
-
Excellent job ! Thanks
-
Duet 3 and sbc running duetbot on the sbc.
Getting error:Connecting to duet... Duet is offline! Checking for upload dir... Uploads disabled: Request to http://tristan-painting-machine.local/rr_filelist?dir=0%3A%2Fgcodes%2Ftelegram failed. code: 404 Bot started...
Also tried with the same numerical ip address that works to connect to dwc.
Any advice? -
@the_dragonlord I don't remember if I did the file or get on the web but you have to make duetbot as a service with a file "duetbot.service" or whatever into /etc/systemd/system as root
File content (edited):
[Unit] Description=node js duetbot for telegram #after network is up After=network.target [Service] WorkingDirectory=/usr/bin ExecStart=duetbot Restart=on-failure RestartSec=1500ms Type=forking #user pi or root, will determine where the script will search the configuration file **.duetbot.json** User=pi # Note Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody' Group=nogroup Environment=PATH=/usr/bin:/usr/local/bin Environment=NODE_ENV=production # log send to syslog StandardOutput=syslog StandardError=syslog # syslog name id SyslogIdentifier=duetbot [Install] WantedBy=multi-user.target
And don't forget to execute after that :
#to load the file for the systemctl manager systemctl daemon-reload # to start and test service duetbot start # to check if loaded an active service duetbot status # if all is good you can tell the system to execute it as a service on boot : systemctl enable duetbot #if it's ok the system will respond : Created symlink /etc/systemd/system/multi-user.target.wants/duetbot.service → /etc/systemd/system/duetbot.service.
-
I am getting this error trying to install duet- telegram on my duet 3 with sbc (RPi 3b+).
Please can anyone assist -
This post is deleted! -
the last update of the bot on github is more than 3 years old,
the project was abandoned