LogoLogo
MainsailMainsailOSCrowsnest
  • Welcome to Mainsail
  • Setup
    • Installation
      • MainsailOS
      • KIAUH
      • Docker
      • Manual setup
      • my.mainsail.xyz
    • Updates
      • Update Manager
      • Manual Update
    • Configuration
  • overview
    • Features
      • Bed Mesh
      • Console
      • Dashboard Organisation
      • Exclude Objects
      • Hide macros, outputs or fans
      • Localization
      • Macro Management
      • Macro Prompts
      • Presets
      • Print History and Statistics
      • Query devices
      • Built-in Themes
      • Custom Themes
        • Prepare
        • Backgrounds
        • Logos and Icons
        • Custom Navigation
        • Custom CSS
        • Community Themes
      • Thumbnails
      • Webcam
    • Settings
      • General
      • Console
      • Control
      • Dashboard
      • Editor
      • G-Code Viewer
      • Macros
      • Presets
      • Printers
      • UI-Settings
      • Webcams
    • Slicer
      • Cura
      • Ideamaker
      • PrusaSlicer
      • SuperSlicer
    • Quicktips
      • Slicer upload
      • Remote Access
      • Printer power switch
      • Additional Sensors
      • Disable Octoprint LCD menu
      • config.json
  • FAQ
    • Mainsail
    • Klipper warnings
      • Deprecated Values
      • Deprecated Options
      • Runtime Warning
    • Moonraker warnings
      • PolicyKit Permissions
    • Klipper errors
      • MCU Protocol error
    • Mainsail errors
      • Unauthorized
    • Getting Help
      • Discord
      • GitHub Discussions
  • About
    • Data Privacy
    • Sponsors
    • Development
      • Code standards
      • Contribute
      • Environment
      • Localization
    • Credits
  • 🔗Links
    • Github
    • Release Notes
    • Discord
    • Youtube
Powered by GitBook
On this page
  • Remote Mode
  • Remote Mode with fixed printers
  • Fixed socket settings

Was this helpful?

Edit on GitHub
  1. overview
  2. Quicktips

config.json

There are several different modes of how Mainsail should react when a new session is opened. These settings can be done in the config.json file in your Mainsail root directory.

PreviousDisable Octoprint LCD menuNextMainsail

Last updated 1 year ago

Was this helpful?

A default config.json file should look like this:

{
    "defaultLocale": "en",
    "hostname": null,
    "port": null,
    "instancesDB": "moonraker",
    "instances": []
}

Remote Mode

This is the behavior of mainsail when you use e.g. . If you have installed the Mainsail instance independently of the various Moonraker instances (printers). For example, you use a smart home server or a NAS in your home network that can serve as a web server and is always accessible.

To use this mode, open the config.json and change the value instancesDB to browser. If you now open Mainsail, you should see this dialog.

In this mode, the socket settings are saved in the browser and you can add as many printers as you like to the Mainsail session using the "add printer" button.

Remote Mode with fixed printers

This mode is very similar to the one described above, except that the Socket settings are not stored in the browser but directly in the config.json file and are therefore automatically available in every browser (pc, tablet, smartphone).

To use this mode, you have to switch the instancesDB to json, and then you also have to specify a list of printers in the instances array. Here an example:

{
    "defaultLocale": "en",
    "instancesDB": "json",
    "instances": [
        { "hostname": "192.168.0.210", "port": 7125 },
        { "hostname": "192.168.0.211", "port": 7125 },
        { "hostname": "192.168.0.212", "port": 7125 }
    ]
}

In my example, 3 printers are added with the IP and with the default Moonraker port 7125. When I now open Mainsail, it looks like this:

In my example, you can see that the first two printers are already connected and the third one has not been reached until now (it is currently switched off). For the first two printers, the name has also been loaded from the interface settings.

Fixed socket settings

This case is rather unusual, but it is also possible with Mainsail. Here you can set up a printer directly if it does not match the currently opened url. For example, the web interface is available via http://192.168.0.200 but the printer (Moonraker) has the IP address 192.168.0.210. Then the config.json should look like this:

{
    "defaultLocale": "en",
    "instancesDB": "moonraker",
    "hostname": "192.168.0.210",
    "port": 7125
}

In this case, the specific printer simply opens immediately without the "select printer" dialog.

my.mainsail.xyz
Mainsail Remote Mode select printer dialog