-
Notifications
You must be signed in to change notification settings - Fork 164
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
base: master
Are you sure you want to change the base?
Conversation
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]>
There was a problem hiding this 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"); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well
I don't suppose there are compiled binary's for the mainsail version so I can do a simple upgrade? |
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.