Git Product home page Git Product logo

mooncord's People

Contributors

adelyser avatar blackshadeoss avatar dependabot-preview[bot] avatar dependabot[bot] avatar eliteschwein avatar geoffreywwang avatar hungerlegend avatar ressu avatar senpaisubby avatar ssj71 avatar tehmaze avatar westonmyers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mooncord's Issues

Printer Status Error With Multi Printer on 1 PI

I have Tried to install MoonCord with a Multiple Klipper Instance on 1 PI setup where each printer is served on a different moonraker Port EX. 7126 or 7125

here is the error im getting using http://127.0.0.1:7126 as the moonrakerurl in the config,json
Error
I am also unable to Change Permissions in the discord Server but im not sure this is a related issue.
error 2

Multi Printer usage

Bad explanation for multiple Printers...

I will make a wiki entry for that

Update complicated from 0.3.1 to 0.4.0

I installed MoonCord 0.3.1 on my Fluiddpi which uses the most current Klipper, Moonraker and OS files.

As I just got the update notification for 0.4.0, I updated via the Fluidd-UI. During the update, I noticed some warnings about cleaning up folders in NPM.

After the update, MoonCord no longer worked, I got only "this interaction has failed" to any command.

Steps I took to resolve the issue (successfully):

1.) sudo chmod +X +R and +W for the folder "scripts" (I could only see the filenames, not even read permissions)
2.) sudo ./migrateNode.sh (this was probably unnecessary, I got a warning from the updater)
3.) ./migrateNode.sh (as Pi, no su rights)

After a restart and a few minutes, MoonCord is working again.

I suggest:
1.) Definitely fix permissions on the scripts folter
2.) If possible perform the node.js-update automatically
3.) Adjust the Wiki so people know how to upgrade correctly.

Notification?

Any thoughts to adding notifications in the channel when a print completes?

Pause/resume not functioning properly with v0.0.5

WIth version 0.0.5 pause and resume do not functioning properly. When the print is paused and then resumed it just states print started and the print job status is not updated there after.

Screen Shot 2022-01-08 at 2 02 54 PM

Logs

[error] [2022-01-08T03:52:16.360Z] Error: Timed out after waiting for 20000 ms
            Error: Timed out after waiting for 20000 ms
    at /home/pi/mooncord/dist/index.js:7:849
    at async StatusHelper.update (/home/pi/mooncord/dist/index.js:49527:9)
    at async SubscriptionNotification.parsePrintStats (/home/pi/mooncord/dist/index.js:49835:13)
[info] [2022-01-08T04:43:35.128Z] klipper status changed to pause...

[error] [2022-01-08T04:43:55.131Z] Error: Timed out after waiting for 20000 ms
            Error: Timed out after waiting for 20000 ms
    at /home/pi/mooncord/dist/index.js:7:849
    at async StatusHelper.update (/home/pi/mooncord/dist/index.js:49527:9)
    at async SubscriptionNotification.parsePrintStats (/home/pi/mooncord/dist/index.js:49837:9)
[info] [2022-01-08T04:45:10.601Z] klipper status changed to start...

[error] [2022-01-08T04:45:30.603Z] Error: Timed out after waiting for 20000 ms
            Error: Timed out after waiting for 20000 ms
    at /home/pi/mooncord/dist/index.js:7:849
    at async StatusHelper.update (/home/pi/mooncord/dist/index.js:49527:9)
    at async SubscriptionNotification.parsePrintStats (/home/pi/mooncord/dist/index.js:49835:13)```

Systeminfo Memory faulty

on not raspberry pi systems (or maybe raspberry pi systems aswell?)

Systeminfo Memory throws errors:

example:

embeds[0].fields[5].value: This field is required
            DiscordAPIError: Invalid Form Body
embeds[0].fields[5].value: This field is required
    at RequestHandler.execute (/home/odroid/mooncord/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/home/odroid/mooncord/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async MessageManager.edit (/home/odroid/mooncord/node_modules/discord.js/src/managers/MessageManager.js:132:15)
    at async ViewSystemInfo.execute (/home/odroid/mooncord/dist/index.js:49228:9)```

graphs

as the title says, sadly somewhat hardcoded graphs in systeminfo and temps. but i will add the option to switch back to the old style (fields and no old metric), because the graphs would eat some processing power.

/notifyme not working

I had a little bit of trouble with setting everthing up, but could figured it out. In the Wiki there acrucial Infos missing.

But my problem actually is that the /notifyme is not working.

When i send the command i get the report " I will notify you....blabla" but when the Print is started or finished i don't recived any message.

0.4.12 crashes with some commands like /listfiles

0.0.4-12 crashes when querying some data

This is repeatable. I am using a fresh installation after some issues with updates from 0.3.1. The system was cleaned with the two commands mentioned in the Wiki (fwiw, should be "rm -rf..." instead of "rm rf...")

I added app and bot keys, also the user-id.

In general, I can do simple tasks like /info

When I do stuff that involves Moonraker, I get an error about failed interactions, and MoonCord crashes on the pi.

image

pi@vcore:~ $ sudo systemctl status MoonCord
● MoonCord.service - MoonCord
Loaded: loaded (/etc/systemd/system/MoonCord.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-09-06 16:34:35 CEST; 10s ago
Process: 5366 ExecStart=/usr/local/bin/npm run start /home/pi/klipper_config/ (code=exited, status=1/FAILURE)
Main PID: 5366 (code=exited, status=1/FAILURE)

Sep 06 16:34:21 vcore npm[5366]: ℹ Printer Status: ready
Sep 06 16:34:35 vcore npm[5366]: ✖ List Files Command: TypeError: Cannot read property 'id' of null
Sep 06 16:34:35 vcore npm[5366]: /home/pi/mooncord/discord/commands/listFiles.js:58
Sep 06 16:34:35 vcore npm[5366]: connection.removeListener('message', handler)
Sep 06 16:34:35 vcore npm[5366]: ^
Sep 06 16:34:35 vcore npm[5366]: TypeError: Cannot read property 'removeListener' of undefined
Sep 06 16:34:35 vcore npm[5366]: at Object.module.exports.reply (/home/pi/mooncord/discord/commands/listFiles.js:58:20)
Sep 06 16:34:35 vcore npm[5366]: at processTicksAndRejections (node:internal/process/task_queues:96:5)
Sep 06 16:34:35 vcore systemd[1]: MoonCord.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 16:34:35 vcore systemd[1]: MoonCord.service: Failed with result 'exit-code'.
pi@vcore:~ $

Make logging to file optional

It should be possible to both define the log file location and to disable the log file completely.

While it's beneficial in some cases to have a log file, in other cases it's not as useful. For example, when running in a Kubernetes container, the standard way of logging information is via stdout and stderr. If I want to run the container with a readonly root, I will need to separately prepare for log. Even though there are other uses for the temp directory too, this is one of the obvious things that should be configurable.

Custom Commands

Add a custom Command section to the config for adding custom commands that executes macros, example /lighton.. maybe add also argument support?

Webcam Issue

Getting this error

Webcam Util: Error: unknown JPEG marker ffd6

Is it possible that my camera settings could be the issue?

camera_usb_options="-r 1280x720 -f 30"

Works fine in Fluidd

/editchannel - This Command is only aviable on a Guild

Hello,

If i use the /editchannel command the Bot replies with "This Command is only aviable on a Guild"

If i use the /editchannel -> TAB -> Channel highlight with cursor keys -> TAB -> ENTER i get "A channel id specified is invalid"

If i use /editchannel MY_CHANNEL_ID_I_WANT_TO_USE Bot replies with "This Command is only aviable on a Guild"

Is this a bug, or am i using the command not correctly?

What does the "This Command is only aviable on a Guild" output mean?

Discord Client Internal Timeout

My token, application ID and key are all working as the bot is connected to my channel in discord
I have the default URLs in config.json as I installed the bot on to the klipper PI

The bot shows "Watching printer start" but no commands work

image

One error in mooncard status below
image

Feature Request: Smart Outlet On/Off

Use case: To have lights controlled by smart outlet to be turned on and off with a status update (/status or automatic interval)

Telegram Klipper bot has this
Example

#Led on link for picture
led_on=""
#Led on wait time before picture is taken (in seconds) 
led_on_delay="0"
#Led off link for picture
led_off=""
#Led off wait time after picture is taken (in seconds)
led_off_delay="0"

It is being controlled via HTTP request with url "lighton" and "lightoff". Currently using it manually via GCODE in klipper as below

[gcode_shell_command lighton]
command: sh /home/pi/light/lighton.sh
timeout: 30.
verbose: True

[gcode_macro LIGHTON]
gcode:
    RUN_SHELL_COMMAND CMD=lighton

[gcode_shell_command lightoff]
command: sh /home/pi/light/lightoff.sh
timeout: 30.
verbose: True

[gcode_macro LIGHTOFF]
gcode:
    RUN_SHELL_COMMAND CMD=lightoff

You do not have Permissions

OK, another dumb issue.

The bot keeps telling me I do not have permissions, I'm the guild owner and I added my ID to the controllers section of the json file.

image

image

improved systeminfo

add 4 new components to the Systeminfo Command:

Moonraker: count active websockets, moonraker version, moonraker load, ready since, moonraker warnings
MoonCord: shows ping, client id, events count, ready since
Network: Shows the current network activity
Klipper: klipper loads, klipper version, config warnings

modifing 1 component:

Systeminfo: Klipper and Moonraker Load would get removed

When printing a gcode file in a folder the gcode preview image is not shown in discord.

Issue description

When printing a gcode file in a folder the gcode preview image is not shown.

Steps to reproduce the issue

  1. Upload a gcode file to klipper/moonraker.
  2. Organize it into a folder
  3. Send the file to print
  4. Observe that the notification is using the generic image for the file and not the preview image

What's the expected result?

When printing from a subfolder the preview image should be present in the notification on discord.

What's the actual result?

The preview image is the default and not the one contained in the gcode file.

Additional details / screenshot

In a subfolder.
Screen Shot 2021-11-09 at 2 51 29 PM

Not in a subfolder.
Screen Shot 2021-11-09 at 2 52 32 PM

Version Info

MoonCord v0.0.4-14

/temp crashes MoonCord

Calling /temp crashes mooncard at discord/commands/temp.js, line 114.
Problem seems to be that moonraker doesn't report power for temperature fans, only temperatures, targets and speeds - therefore the access to powers crashes the program.

MoonCord

A simple fix to use speeds instead of powers in line 114 works (at least for me):
const speed = calculatePercent(temps[temp].speeds[temps[temp].speeds.length - 1])

Let me know if you need further input.

Kind regards

Stephan

history command

/history <filter?>

would show the last prints and if they failed and so on... not sure how i will implement that

Issue Rules

Languages

You can make Issues in German or English...

Issues in other Languages get closed.

Issue Content

Dont Post your Bot ID, i will delete the Messages with Bot IDs.
Be cool and dont swear or push your Issue, i will look into every Issue!

Automatic channel status - percentage based on time

I would love to see a more detailed options for the automatic channel status posting.

Currenly it is only based on percentage of a print. If i print only takes a couple of minutes to print the status is spammed way to often.

Not sure what is the best fit here but i would love seeing something like "post every 10%, but only if last message was 30min ago, or post if last message was 2 hours ago if if 10% haven't reached yet"

Thanks alot!

Power Device Command

My basic Idea sofar

/power will show all power devices and will add a dropdown to select a specific power device
/power <device> will show a "do you want to toggle" message with yes and no button
/power <device> on/off/toggle will toggle a power device

handy commands

/preheat preset <material> or /preheat temp <heaters>
/pidtune <heater>
/getconfig <config>
/saveconfig
/tune speed flow

And More...

since the Vote on Discord was quite negative, this will come very late

[FR] Dynamically set the color of a broadcast message

The ability to send a color code with a broadcast message to easily differentiate the type of message received.
Example:

RESPOND PREFIX=mooncord.broadcast MSG="Runout detected!" COLOR="#cc0000"

RESPOND PREFIX=mooncord.broadcast MSG="We are ready to print!" COLOR="#4cf502"

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.