Updating RepRap Firmware config.g file

From RepRap
Revision as of 13:05, 17 April 2016 by PRZ (talk | contribs) (Updating 'config.g': recommend formatting)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The 'config.g' file

To configure a board using RepRap Firmware, notably the Duet for a given machine, you have only to edit a file named 'config.g', located on the SD card in the /sys directory. This file is read and executed at startup, but the configuration can be modified later, either by executing a macro or entering commands in the web interface. These configuration modifications will be lost at next startup.

All configuration parameters are entered via 'G' and 'M' parameters, so the reprap firmware G-Code set is relatively extended. A config.g file could be reexecuted via the 'M999' command or an emergency stop.

It shall be noted that a malformed file may hang your board, and this apply to all macros executed by the 'config.g' file.

The first configuration, which shall define name, password and net configuration, will probably be done while writing the file on the SD card, as it is not wise to start a machine with an unverified file, except if you can independently supply logic and power on your board.

Any text editor could be used for modification.

After uploading the file in the SD card, inserting it in the board (while power is shutdown), restarting and connecting to the board, you have other solutions to modify the config.g file without removing the SD card.

As the config.g content is stored in the limited Duet memory at startup, you shall limit this file size, makes your comments short and remove unused lines.

Updating 'config.g'

For the updating of the config.g file, you have three solutions if your board connect properly:

  • Using the incorporated editor in the web interface, but that doesn't work with all browsers, notably not with Microsoft browsers.
    That editor is accessed in the "settings" tab, sub-panel "configuration file".
  • Editing file on your PC/device and uploading with the web interface. In the tab "Settings", there is a button "Upload File(s)", which allow to upload printer system files from your pc. The 'config.g' file will automatically be uploaded in the /sys directory as other system files, while web interface files (model.js and viewmodel.js, formerly interface.js) will be uploaded in /www/js directory. It allow having an up-to date copy on your PC of the printer system files.
  • Editing the config.g file on your PC and uploading it via FTP. Same advantage as web uploading for tracking the printer updates, with a bit more flexibility.
    To log in FTP, you shall use the machine name as defined in the config.g file, for the user name any name e.g. 'whatever' and the password as defined in the config.g file (the leading 'P' indicates parameter and is not part of the name nor password). Beware to upload in the /sys directory.

You could be simultaneously be logged in FTP and in http (web interface). If you have difficulties to connect directly in FTP, connect first with the web interface, this helps FTP connection.

To upload/download to the SD card via FTP, you need a FTP client program (NOT a FTP server) and there is a wide choice for all systems. On Windows, you could use the FTP function of the file viewer 'Total Commander', FileZilla or WinSCP. On Linux, there is a default ftp client named 'ftp'. On a MAC you can use CyberDuck or FileZilla.

If using a new SD card, it is highly recommended to format it (FAT32) before loading an image.

How to configure Duet

There are a few links which may help to configure your board

How do I know that my config.g have been properly executed

Without a LED and if you do not succeed in connecting your board, you can check that the config.g is properly executed by making 'music' with your steppers.

You shall execute a file (or inserting commands it in the config.g file itself), as the last command of your config.g.

See RepRap Firmware macros#Make sound to confirm proper operation