Duet Telegram bot

  • I've read about one being in development for a while, but have only recently came across a more or less finished bot here https://www.npmjs.com/package/duet-telegram.

    Works really well, I run it on my Pi Zero W along with Motioneye. Very convenient for those of us with really wonky ISPs, in my case that means I don't have to bother with weird IPv6 tunneling issues if I want to keep an eye on my printer during the day.

    0_1542541626736_2018-11-18 12_42_39-Window.jpg

  • How easy was this to set up? I haven't dabbled with Raspberry Pis before. I am also looking into using my google home to send Gcode commands.

  • @underdonesushi Pretty easy. Just had to follow the guide on the bot's page with an extra step for installing missing packets. Otherwise it mostly just... works. Not so sure about Google Home integration.

  • 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):

    1. Install headless Rasbian image (2019-09-26-raspbian-buster-lite.img)
    2. 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
    3. installed the 11 dependencies listed on the page with:
      • sudo npm i <dependency name>
    4. ran the bot by typing duetbot
    5. answered yes to create the default config
    6. 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
    7. 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)
    8. 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: {},
    { 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?

Log in to reply