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

Major docs update #358

Merged
merged 5 commits into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ aux_links:
- "//github.com/meteyou/mainsail"
aux_links_new_tab: true


defaults:
-
scope:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/setup/balena-etcher-finished.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/setup/balena-etcher-flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/setup/balena-flashing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/setup/balena-main-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/setup/balena-select-os.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/setup/balena-select-sd-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/setup/balena-unzipping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 140 additions & 0 deletions docs/configurations/necessary-cfg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
layout: default
title: Configuration
nav_order: 5
has_children: false
permalink: /configuration
---

# Required configuration

**Mainsail requires a minimum configuration to function properly and will display a warning at startup if the required parts are not found in your configuration file(s).**
{: .warning}

The following configuration elements are mandatory and must be configured for Mainsail to operate:

* [Virtual SD Card](configuration#virtual_sdcard)
* [Display Status](configuration#display_status)
* [Pause / Resume](configuration#pause_resume)
* [GCode Macros](configuration#pause--resume--cancel)

The following configuration elements are optional, including making tweaks and alterations to Klipper's default commands:
* [Custom Commands](configuration#customisation)

## Virtual SD Card
This allows gcode file uploads.
```yaml
[virtual_sdcard]
path: ~/gcode_files
```

## Display Status
This is required for messages in your status panel, if you don't have a `[display]` in your configuration.
```yaml
[display_status]
```

## Pause, Resume, Cancel
This enables pause / resume in mainsail.

```yaml
[pause_resume]
```

# Macros
## for pause / resume / cancel functionality
These should be modified to your own needs.
{% raw %}
```yaml
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
##### set defaults #####
{% set x = params.X|default(230) %} #edit to your park position
{% set y = params.Y|default(230) %} #edit to your park position
{% set z = params.Z|default(10)|float %} #edit to your park position
{% set e = params.E|default(1) %} #edit to your retract length
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe}
G90
G1 X{x} Y{y} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
```

```yaml
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### set defaults #####
{% set e = params.E|default(1) %} #edit to your retract length
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
```


```yaml
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
```
{% endraw %}

# Optional

## Customisation
Klipper has many canned/preset commands that are themselves just macros.

The default configuration of these may not suit your needs or preferences, (though they are usually a good place to start). It's possible to adjust these by including them in your config, along with whatever code you would like to run.

## Example
Adjusting the `BED_MESH_CALIBRATE` command (which can be run from the Sidebar > Heightmap > Calibrate.
{% raw %}
```yaml
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BASE_BED_MESH_CALIBRATE
gcode:
#before the original gcode
BED_MESH_CLEAR
QUAD_GANTRY_LEVEL
G1 X125 Y125 Z5 F6000
#the original gcode
BASE_BED_MESH_CALIBRATE
#after the original gcode
```
{% endraw %}
8 changes: 4 additions & 4 deletions docs/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ description: >-
<!-- {{ page.description }} -->


We would like to say "thank you" to all the
We would like acknowledge the valuable contributions that many people and projects have made to Mainsail, particularly the:

- contributors, who help make Mainsail better
- testers, who help find bugs in Mainsail, so they can be quickly fixed
- supporters via patreon/ko-fi

and of course the projects Mainsail is built on, especially [Klipper](https://github.com/KevinOConnor/klipper){:target="_blank"}, [Moonraker](https://github.com/Arksine/moonraker){:target="_blank"} and [MainsailOS](https://github.com/raymondh2/MainsailOS/){:target="_blank"}.
..and of course the projects Mainsail is built on, especially [Klipper](https://github.com/KevinOConnor/klipper){:target="_blank"}, [Moonraker](https://github.com/Arksine/moonraker){:target="_blank"} and [MainsailOS](https://github.com/raymondh2/MainsailOS/){:target="_blank"}.

**THANK YOU for YOUR support. ❤️**
**THANK YOU for your continued support.**

- TOC
{:toc}
Expand All @@ -38,4 +38,4 @@ and of course the projects Mainsail is built on, especially [Klipper](https://gi
| project | license | link |
|:--------|:-------:|:-----|
{% for deps in site.data.licenses %}| **{{ deps[0] }}**<br>{{ deps[1].description }} | [{{ deps[1].licenses }}]({{ deps[1].licenseUrl }}){:target="_blank"} | [{{ deps[1].repository }}]({{ deps[1].repository }}){:target="_blank"} |
{% endfor %}
{% endfor %}
41 changes: 41 additions & 0 deletions docs/data-privacy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: default
title: Data Privacy
nav_order: 99
has_children: false
permalink: /data-privacy
has_toc: false
---

# Data Privacy

We understand the need for data privacy and have designed Mainsail to operate in your browser’s cache locally.

The following table applies to Mainsail when installed locallaly, or accessed via [my.mainsail.xyz](http://my.mainsail.xyz).

| YES | NO |
| :--------------: | :---------------: |
| Store static files in browser storage (.html, .js, .css) | ‘Phone home’ |
| Communicate directly with your printer via the Moonraker API | Send/transfer any data externally |

## Will my data be safe if I use the hosted version?
Accessing [my.mainsail.xyz](http://my.mainsail.xyz) stores the .html, .js and .css files for Mainsail locally in the brower's storage in exactly the same way that an instance running on your local hardware would do. In reality, there is no functional difference (or concern) between accessing Mainsail from a privately or publicly hosted instance.


Parallel operation is also possible.

# Third party software

We do not modify third party packages or software, nor control their attitude to Data Privacy.

If you are concerned, please consider the privacy policies (or contacting the developer) of:

* [RaspberryOS](https://www.raspberrypi.org/privacy/)
* Klipper
* Moonraker


It is worth noting that Klipper, Moonraker and RaspberryOS are open source software and ( whilst this brings no guarantee of privacy and security) the source is available and open to peer review.
{: .info}
The Raspberry Foundation is a registered charity in the United Kingdom, with extensive Privacy and Safeguarding policies.
{: .info}
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ has_children: false
---

# Welcome to Mainsail!
Mainsail is a lightweight & responsive web interface for Klipper, the 3D printer firmware. It focuses especially on an intuitive and consistent interface.
Mainsail aims to make Klipper more accessible to end users through a lightweight, responsive web ui, centred around an intuitive and consistent design philsophy.
{: .fs-5 }

[Getting Started](/setup){: .btn .btn-primary }
Expand Down Expand Up @@ -43,4 +43,4 @@ The project is primarily developed and maintained by meteyou. To keep the projec
- [Ko-Fi (one-time)](https://ko-fi.com/mainsail){:target="_blank"}

However, we would also like to ask you to support the regular contributors.
{: .info}
{: .info}
17 changes: 5 additions & 12 deletions docs/setup-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ has_toc: false
---
# Setup Guides

To get started, you first have to decide which route you want to follow for the installation. There are several ways to install Mainsail on a Raspberry Pi.
## Local installation
Decide which route you want to follow for the installation. There are several ways to install Mainsail on a Raspberry Pi:

- [MainsailOS](mainsail-os.md) <span class="label label-red">recommended</span>
A prebuilt image for your Raspberry Pi. Flash it and you are almost ready to go.
Expand All @@ -17,17 +18,9 @@ To get started, you first have to decide which route you want to follow for the
- [Manual Setup](manual-setup/index.md)
The rocky road. If you want to know how everything is set up by hand, you will get all the information here.

## my.mainsail.xyz
In addition to these guides, there is [my.mainsail.xyz](http://my.mainsail.xyz){: target="_blank"}. The latest Mainsail version is always hosted there. This obviates the need to set up a web server for Mainsail on your hardware.
## Hosted

To use [my.mainsail.xyz](http://my.mainsail.xyz){: target="_blank"}, the following requirements must be met:
- Klipper must be installed.
- Moonraker must be installed.
- my.mainsail.xyz must be configured as a CORS domain in moonraker.conf.

**MainsailOS & KIAUH already fulfill these requirements.**

_Note_, only the static .html, .js and .css files are loaded into your browser storage. No further information is transferred to the server. The communication to your printer is then done locally directly between your browser and your Moonraker installation.
If you have any concerns, you can of course still install Mainsail on your hardware locally. Parallel operation is also possible.
Setup [remote access](../quicktips/remote-access) without installing/configuring a web server!
{: .info}

A hosted instance of Mainsail can be found and used at [my.mainsail.xyz](http://my.mainsail.xyz), check out the [documentation](mainsail-hosted) for usage and configuration.
51 changes: 51 additions & 0 deletions docs/setup-guide/mainsail-hosted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: default
title: my.mainsail.xyz
parent: Setup Guides
nav_order: 4
has_children: false
has_toc: false
permalink: /setup/mainsail-hosted
---

# my.mainsail.xyz

Mainsail and MainsailOS respect [Data Privacy](../data-privacy).
{: .info}

The hosted version of mainsail can be used:

* On the same (local) network as your printer.
* On a remote (different) network to your printer (requires the configuration of [remote access](../quicktips/remote-access)).

## Requirements

- MainsailOS and KIAUH are preconfigured to meet the requirements for the hosted service to work.
- If you have a manual installation, then the following requirements must be met:
* Klipper must be installed.
* Moonraker must be installed.
* my.mainsail.xyz must be configured as a CORS domain in moonraker.conf.

## Editing moonraker.conf

Further information can be found in the Moonraker [documentation](https://moonraker.readthedocs.io/en/latest/configuration/#authorization)
{: .info}

To allow [my.mainsail.xyz](http://my.mainsail.xyz) to access your local installation, navigate to moonraker.conf open it and add the following code:

```yml
[authorization]
cors_domains:
https://my.mainsail.xyz
http://my.mainsail.xyz
http://*.local
trusted_clients:
10.0.0.0/8
127.0.0.0/8
169.254.0.0/16
172.16.0.0/12
192.168.0.0/16
FE80::/10
::1/128

```
Loading