Mainsail installation

| |

1. What is a Mainsail?

Mainsail in lightweight alternative to Octoprint offering the same capabilities (if you forget that Octopint plugins have ever existed). It can also run on older and less powerful Raspberry versions.
I prefer it over the Octoprint due to the better user exprience and Klipper friendly options and settings.

Please note that this guide is for a new (clean) installation.

More about Mainsail can be found on official Mainsail website or a Discord channel.

1.1. Web interface

Short comparison between desktop and mobile Mainsail web interface.
There are many other options, tabs and features in the Mainsail, but another article will be about them.

Desktop browser interface
Mobile browser interface

1.2. What comes with the MainsailOS package?

The whole MainsailOS package contains all you need:
Raspberry Pi OS Lite image
Mainsail
Klipper
Mooonraker

2. Hardware requirements

You will need:
Micro SD (SDHC) card with at least 8GB capacity
Micro SD card reader
5V power source (3A for Raspberry Pi 4)
USB cable (USB-C for Raspberry Pi 4, micro USB for older versions)
WiFi network or a standard LAN network + cable

I would also recommend:
Raspberry cover
Heatsinks
Fan for active cooling

The easiest way to get all parts is buying a complete set such as this one:

3. Download and install recommended programs

3.1. Download and install PuTTY

Install SSH client such as a PuTTY.
This client will be used to connect your PC to Raspberry. 
Click here to download.

3.2. Download and install BalenaEtcher

We will use this program to flash Mainsail OS image to micro SD card.
Click here to download.

3.3. Download and install Advanced IP Scanner

This program will be used for locating Rasperry in your local network.
It is not possible to connect to Raspberry via SSH without the correct IP address.
Click here to download.

4. Prepare Raspberry

4.1. Install heatsinks

Double check if you have everything you need.
I have used a Raspberry Pi 4, that requires heatsinks and active cooling is even a better option.

These three heatsinks are in the official distribution package. Remove the protective foil and apply then on the chips.

4.2. Install the case/cover

Install the Raspberry into the desired place / case / cover.
I have a designated place in my electronics compartment, so I will not use the original case.

5. Download and flash MainsailOS

5.1. Download OS image

Visit the official Mainsail Github release page and download the latest release.
Click here to download.

5.2. Flash from file

Take the Raspberry micro SD card, insert it into the card reader.
Open Balena Etcher and click on Flash from file.

5.3. Select the MainsailOS image

Select the downloaded image and hit Enter.

5.4. Select target

Click on Select target.

5.5. Choose the micro SD card

Select the correct target device, in this case the 32GB micro SD card.
Click on Continue

5.6. Flash Mainsail image

Click on Flash! to flash the OS image on the micro SD card.

5.7. Flash confirmation

You have successfully flashed MainSail OS image.

6. WiFi settings (optional)

6.1. Remove and insert the micro SD card into your computer

Micro SD card is automatically safely removed after tha flash.
Remove the micro SD card from the reader and insert it again.

6.2. Locate configuration file

Open the micro SD card in the file explorer and locate mainsailos-wpa-supplicant.txt in the root directory.

6.3. Open configuration file

Open the file in a text editor such as a PSPad Editor or similar.
Locate WiFi settings.

6.4. Fill in your WiFi configuration

Find out what WiFi security type you use, the most common is a WPA/WPA2 secured.
Uncomment those 4 lines and enter your WiFi name and passsword inside “”.

6.5. Set your country code

Open this ISO3166 country list and fill in your country code.
For example: I live in the Czech Republic, so my country code is CZ.

Do not forget to save the file and safely remove the micro SD.

7. First boot

7.1. Power off

Make sure that the Raspberry is turned off  – it does not have a power button, so simply remove or turn off the power source.

7.2. Insert micro SD card

Insert the flashed micro SD card into the Raspberry.
Make sure that the card holds in it’s place – the card reader has a lock position.

7.3. Insert LAN cable (optional)

If you are going to use a wired LAN connection, insert the cable.
I personally prefer WiFi, because I do not want to have cables everywhere.

7.4. Power on

Turn on the power source, LED diods in Raspberry will start flashing.

8. Installation verification

8.1. IP address localization

Start with locating Raspberry in your local network.
I highly recommend installing Advanced IP Scanner CLICK HERE.
Default IP range is usually 192.168.0.1-254 or 192.168.1.1-254.

Locate the Raspberry’s IP address and copy it.

You can simply copy the IP address into the browser and open the Mainsail page.

8.2. SSH connection

Open PuTTY and paste the copied IP address from previous step.
Click on Open.

8.3. Verification

You will see this window the first time you connect to the Raspberry from your computer.
Click on Yes.

8.4. Login

Use your Raspberry login, default is pi
Hit Enter.

Enter password for pi account.
Default value is raspberry
If you are not familiar with Linux systems, do not be scared that you will not see the password, not even * characters.

You should see these informations after a successful login

9. Next possible steps

You have succesfully installed Mainsail.
The next logical step would be to flash your board and create a printer configuration file.

9.1. KIAUH installation

10. FAQ

10.1. I cannot find the device in my local network

10.1.1. Invalid IP range

The most common problem is a different IP address range.
For example: you are not able to locate any device on this range: 192.168.1.1.-254

So open network settings  – click on the network / more informations and find your computer’s IP address.
As you can see, this IP address in in a 192.168.0.1.-254 range.

Fill in the correct IP address range  192.168.0.1.-254 and click on Scan.

10.1.2. Invalid WiFi settings

It is possible that you have entered incorrect WiFi settings.
Turn of the Raspberry, remove micro SD card, insert it into the computer, return to 6.1. and double check your WiFi settings.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *