Skip to content

Environment File (.env)

Claudio Prezzi edited this page Feb 22, 2021 · 5 revisions

To configure some parameters of lw.comm-server, you can place an .env file into the installation folder. The filename MUST be .env only, without any prefix or extention!

The following params are available:

  • WEB_PORT (the port for the webserver and websocket API)
  • IP (use 127.0.0.1 to only accept local access)
  • VERBOSE_LEVEL (debug messages in console, 0 is off and 3 is maximum)
  • LOG_LEVEL (debug messages to log file, 0 is off and 3 is maximum)
  • RESET_ON_CONNECT (should we send a reset command to the controller on each connect, 0 or 1)
  • DRO_DECIMALS (how many decimal digits should the DRO show)
  • FIRMWARE_WAIT_TIME (max total wait time for a firmware string after connect)
  • GRBL_WAIT_TIME (how long should we wait for the grbl welcome message)
  • SMOOTHIE_WAIT_TIME (how long should we wait for the smoothieware firmware string)
  • TINYG_WAIT_TIME (how long should we wait for the tinyg firmware string)

Example (with defaults):

WEB_PORT=8000
IP=0.0.0.0
VERBOSE_LEVEL=1
LOG_LEVEL=0
RESET_ON_CONNECT=0
DRO_DECIMALS=2
FIRMWARE_WAIT_TIME=10
GRBL_WAIT_TIME=1
SMOOTHIE_WAIT_TIME=1
TINYG_WAIT_TIME=1

(all wait times in seconds)

This is the process for auto detecting the firmware:

  1. Wait for GRBL_WAIT_TIME to get the grbl welcome string
  2. Send "version\n" and wait for SMOOTHIE_WAIT_TIME to get the Smoothieware firmware string
  3. Send "{fb:n}\n" and wait for TINYG_WAIT_TIME to get the TinyG firmware string
  4. Send "M115\n" and wait for the rest of FIRMWARE_WAIT_TIME to get the Marlin firmware string
  5. Timeout to "No supported firmware detected"
Clone this wiki locally