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

This commit adds support for Moonraker. #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vKnmnn
Copy link

@vKnmnn vKnmnn commented Feb 18, 2022

I copied the OctoPrint.cpp and .h and changed the API calls and getters
and renamed all occurences of OctoPrintClient to MoonrakerClient.
I then added two more API-call that were needed. (line 210 to 241)
This one of them requires the filename property to be set first.
As we’re then making a request to Moonraker with said filename as a parameter
and that filename is just a file on a unix host, i needed to add urlencoding.
This is a method of the MoonrakerClient class. (line 445++)

I also removed trailing whitespaces and fixed indentation to two spaces in the new files.

Settings.h a new comment, telling us how to enable Moonraker support.

printermonitor.ino uses the new define from settings.h to enable moonraker.
I also fixed the creation of Timestamps here.

I copied the OctoPrint.cpp and .h and changed the API calls and getters
and renamed all occurences of OctoPrintClient to MoonrakerClient.
I then added two more API-call that were needed. (line 210 to 241)
This one of them requires the filename property to be set first.
As we’re then making a request to Moonraker with said filename as a parameter
and that filename is just a file on a unix host, i needed to add urlencoding.
This is a method of the MoonrakerClient class. (line 445++)

I also removed trailing whitespaces and fixed indentation to two spaces in the new files.

Settings.h a new comment, telling us how to enable Moonraker support.

printermonitor.ino uses the new define from settings.h to enable moonraker.
I also fixed the creation of Timestamps here.

Signed-off-by: Robert von Könemann <[email protected]>
Copy link

@maartenpeels maartenpeels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of OctoPrint references in prints are still present, commented on a few off them but there are a lot more

WiFiClient printClient;
printClient.setTimeout(5000);

Serial.println("Getting Octoprint Data via GET");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moonraker

}
}
else {
Serial.println("Connection to OctoPrint failed: " + String(myServer) + ":" + String(myPort)); //error message if no client connect

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 as well (Moonraker)

WiFiClient printClient;
printClient.setTimeout(5000);

Serial.println("Getting Octoprint Data via POST");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moonraker

}
}
else {
Serial.println("Connection to OctoPrint failed: " + String(myServer) + ":" + String(myPort)); //error message if no client connect

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well

@maartenpeels maartenpeels mentioned this pull request May 11, 2022
@Ga1j1n
Copy link

Ga1j1n commented Apr 1, 2023

I don't suppose there are compiled binary's for the mainsail version so I can do a simple upgrade?

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

Successfully merging this pull request may close these issues.

3 participants