Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository explanation: moonraker-qidi-patched #1

Open
nessex opened this issue May 2, 2024 · 0 comments
Open

Repository explanation: moonraker-qidi-patched #1

nessex opened this issue May 2, 2024 · 0 comments

Comments

@nessex
Copy link
Owner

nessex commented May 2, 2024

Explanation

This repository was created to maintain the the Qidi official patches to moonraker in a more traditional git fork.

Currently, they're in a repository which does not share common git history with Moonraker. That makes it harder to update their patched version with new changes to moonraker from upstream.

The main branch on this repository is qidi-master, which contains the patched version. This is kept distinct from the upstream copy on master.

The patches this repository contains come from here: QIDITECH/moonraker#1 (comment)

Ideal state

Ideally, this repository would not be required at all. Some changes that would be great to see:

  1. Official QIDITECH/moonraker repository updated to be a more traditional fork of Arksine/moonraker (similar to this repo)
  2. Patches reworked to minimize their surface area within the official moonraker codebase, making it easier to keep the fork up-to-date
  3. Software interacting with these patches updated to either not rely upon moonraker, or patches reworked to be more appropriate for upstream contribution to moonraker (followed by updates to software that interacts with it)

In particular, I think with more information on the software that utilizes these changes, these patches could all be reworked such that they have no dependence on moonraker at all. Either through a mini API that proxies most requests through, but intercepts and modifies requests that need additional changes, or by implementing these changes in the calling software instead.

QIDI Patches

This is just a summary of the patches so far. There are a few which are difficult to split out from moonraker without knowing why they need to exist, and there are a few which seem like they can just be removed. But for now, this repository will contain all of them.

If we can get more information, or just do more testing, we can probably work around or otherwise remove all of these changes from moonraker to allow for use of the upstream moonraker going forward.

machine_name Added to sysinfo request

Request /machine/system_info was modified from GET to POST, and when a machine_name is provided in the request it will be written to /dev_info.txt on the filesystem.

Problem: When GET and not POST is called first, self.system_info["machine_name"] will be set to None. Ideally, this patch would simply read the file if it exists and set that value, otherwise not set it. That would also be safer, as I don't see a reason why you should be able to modify files in / by simply posting to the API. In addition, there is a race condition here where until this is called for the first time, the other API calls which return self.system_info do not return the machine_name. If the calling software does not depend on values outside of this call, then there's no issue, but in that case modifying that dict isn't necessary anyway.

.jpg Thumbnail support

There's logic added to support .jpg thumbnails from the file manager APIs. This takes existing .png thumbnail files, converts them to .jpg and saves them in multiple sizes to the filesystem.

Smallest thumbnail by default

Alongside the .jpg changes, these patches also change the priority for thumbnail responses to return the smallest file rather than the largest file by default.

QIDI Slicer Identity

An alias has been added for PrusaSlicer, identifying QIDISlicer as a version of PrusaSlicer.

parse_gimage, parse_simage

Two functions have been added for returning metadata for gimage and simage from the slicer output. Frankly, I don't know what this is, please let me know below if you happen to know / work it out.

GCode Cache

A set of "cache" are maintained when you call start_print. These don't appear to be doing much actual caching, as they aren't read here, and they are simply exact copies of already existing gcode files. I presume that these are used to keep some other software happy? Moonraker already does caching around gcode and metadata, so presumably if other software isn't using the cache copies, this patch can be removed.

DEFAULT_ALLOWED_SERVICES

A list of default allowed services is written to the file moonraker.asvc if that file doesn't already exist. I don't really get the point here, the config already allows setting this, and the filesystem is managed by QIDI. So theoretically, there's no need for this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant