eliteschwein / mooncord Goto Github PK
View Code? Open in Web Editor NEWMoonraker discord Bot
License: MIT License
Moonraker discord Bot
License: MIT License
since discord has a 8mb upload limit, i would upload the timelapses to the user`s Youtube Account
https://console.developers.google.com/start/api?id=youtube
Please Vote for Yes and No if i should implement it
Add Execute Command back
idk why i didnt implemented that in 0.0.5 but mooncord is missing /getlog
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
I am also unable to Change Permissions in the discord Server but im not sure this is a related issue.
rename it to /listgcodes
Bad explanation for multiple Printers...
I will make a wiki entry for that
i forgot where i saw the issue but when the gcode file is longer then 100 character the command will fail
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.
Any thoughts to adding notifications in the channel when a print completes?
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.
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)```
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)```
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.
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.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.
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:~ $
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.
Posted on Community Discord
i forgot to add the gcode upload module in 0.0.5
Add a custom Command section to the config for adding custom commands that executes macros, example /lighton.. maybe add also argument support?
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
i tested it with maze`s discord bot, i got "interaction failed" instead of the proper message
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?
When getting the print status it shows the "Print Time" as the slicer estimated time instead of the actual print time. I am not sure if this is expected or a bug? If it is a bug maybe this is a feature request to show the actual time elapsed for the print.
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
When installing on ARM64 (raspberry pi 4 with raspian 64 bit) the script "scripts/install.sh" fails when downloading and installing the node libraries:
if ! command -v node -v >/dev/null 2>&1
then
status_msg "Download Node 16.13.1"
wget https://nodejs.org/download/release/v16.13.1/node-v16.13.1-linux-armv7l.tar.gz
Here a check is needed if we are on ARM64 and the download needs to be
wget https://nodejs.org/download/release/v16.13.1/node-v16.13.1-linux-arm64.tar.gz
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
I'd love to have a mechanism to allow klipper to send a custom message directly through the bot. Here's an example of a macro using a telegram script to do this: https://github.com/th3fallen/voronConfig/blob/master/macros.cfg#L335
I'd be glad to implement this myself but though I'd check with you to get some guidance in case you had some pre-formed thoughts on the subject.
Any ideas/opinions?
Timelapse Take Frame triggers Pause state
Automatic Status, Manual Status Request and Fileinfo are crashing when there is no Thumbnail for a File.
When printing a gcode file in a folder the gcode preview image is not shown.
When printing from a subfolder the preview image should be present in the notification on discord.
The preview image is the default and not the one contained in the gcode file.
MoonCord v0.0.4-14
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.
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 <filter?>
would show the last prints and if they failed and so on... not sure how i will implement that
You can make Issues in German or English...
Issues in other Languages get closed.
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!
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!
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
Filelist Embed just for Timelapse
I tested that deeply but idk why the release has this issue
After firmware restart mooncord automatic Status update doesnt work anymore
/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
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"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.