### Webhook Logging Examples Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Demonstrates logging job start and completion events using webhook services. ```gcode (Log job start) $HTTP/Command=@webhook_log_start ``` ```gcode (Log job completion) $HTTP/Command=@webhook_log_complete ``` -------------------------------- ### Install Screen on Ubuntu/Debian Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/linux-python3/HOWTO-INSTALL.txt If 'screen' is not preinstalled on your Ubuntu or Debian system, use this command to install it. ```bash sudo apt update sudo apt install screen ``` -------------------------------- ### Set Speed Command Example Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Provides a concrete example of sending a command to set the spindle to forward run and verifies the command by checking the echoed response. ```text Send: 01 06 20 00 00 01 43 CA Recv: 01 06 20 00 00 01 43 CA ``` -------------------------------- ### Modbus Command Structure Example Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Shows the general structure of a Modbus command, including address, function code, starting address, and quantity of registers. ```text Send: 01 03 3000 0004 // Command 0x3000, number of results = 4 Recv: 01 03 0008 0002 0000 0000 0000 D285 #bytes #1 #2 #3 #4 CRC ``` -------------------------------- ### Run Fluidterm Separately Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/linux-python3/HOWTO-INSTALL.txt If Fluidterm does not start automatically after installation, you can run it manually using this command. ```bash sh fluidterm.sh ``` ```bash ./fluidterm.sh ``` -------------------------------- ### Example YAML Configuration Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Configuration/Parser.md This is an example of a YAML configuration file that the parser can process. It demonstrates basic key-value pairs, nested sections, and different data types. ```yaml name: "Debug config" board: Debug-board axes: number_axis: 3 coolant: flood: gpio.2 ``` -------------------------------- ### Monitoring and Metrics Examples Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Examples for checking system health, submitting job metrics, and posting data to InfluxDB for monitoring purposes. ```gcode (Check system health before starting) $HTTP/Command=@check_system_health ``` ```gcode (Submit job metrics when done) $HTTP/Command=@post_job_metrics ``` ```gcode (Post data to InfluxDB for long-term trending) $HTTP/Command=@post_to_influxdb ``` -------------------------------- ### G10 L2 Parameter Setting Examples Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/tests/parser-result.txt Provides examples of setting work offsets using G10 L2 with specific parameters (P, X, Y, Z). It shows successful updates and an error for an invalid parameter 'R'. ```gcode g10 l2 p0 x1 y2 z3 ok ``` ```gcode g10 l2 p2 x2 y3 z4 ok ``` ```gcode g10 l2 p6 x3 y4 z5 ok ``` ```gcode g10 l2 p6 x3 y4 z5 r1 error:20 ``` ```gcode g10 l2 p7 x5 y4 z3 error:29 ``` ```gcode g10 l20 p0 x5 y4 z3 ok ``` ```gcode g10 l20 p6 x5 y4 z3 ok ``` ```gcode g10 l20 p7 x5 y4 z3 error:29 ``` -------------------------------- ### Install PyInstaller Source: https://github.com/bdring/fluidnc/blob/main/fluidterm/HOWTO-COMPILE.md Install the PyInstaller package using pip. This is a prerequisite for compiling Fluidterm into an executable. ```bash python3 -m pip install pyinstaller ``` -------------------------------- ### Install Tool Dependencies Source: https://github.com/bdring/fluidnc/blob/main/fixture_tests/README.md Install the necessary Python dependencies for the fixture testing tool using pip. ```bash pip install -r requirements.txt ``` -------------------------------- ### Start HTTP Test Server on All Interfaces Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Starts the test HTTP server, making it accessible from other machines on the network by listening on all available network interfaces. ```bash python3 http_command_server.py --host 0.0.0.0 --port 8000 ``` -------------------------------- ### Install Dependencies for Source Execution Source: https://github.com/bdring/fluidnc/blob/main/fluidterm/HOWTO-COMPILE.md Install the necessary Python packages for running Fluidterm directly from the source code. This only needs to be done once. ```bash python3 -m pip install -q pyserial xmodem ``` -------------------------------- ### Install FluidNC WiFi Version Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/linux-python3/HOWTO-INSTALL.txt Run this script to install the WiFi version of FluidNC on your ESP32. ```bash sh install-wifi.sh ``` -------------------------------- ### Home Automation Examples Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Demonstrates using HttpCommand for common home automation tasks like fetching room temperature and triggering automations. ```gcode (Get temperature from Home Assistant) $HTTP/Command=@ha_get_room_temp ``` ```gcode (Trigger automation when job completes) $HTTP/Command=@ha_call_automation ``` -------------------------------- ### Install FluidNC Bluetooth Version Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/linux-python3/HOWTO-INSTALL.txt Run this script to install the Bluetooth version of FluidNC on your ESP32. ```bash sh install-bt.sh ``` -------------------------------- ### Configurable Class Example Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Configuration/ConfigurationHandlers.md Demonstrates how a class can inherit from `Configurable` and define its configuration fields and validation logic. ```c++ class I2SOBus : public Configuration::Configurable { public: I2SOBus() = default; Pin _bck; Pin _data; Pin _ws; void validate() override { if (!_bck.undefined() || !_data.undefined() || !_ws.undefined()) { Assert(!_bck.undefined(), "I2SO BCK pin should be configured once."); Assert(!_data.undefined(), "I2SO Data pin should be configured once."); Assert(!_ws.undefined(), "I2SO WS pin should be configured once."); } // more validations? } void group(Configuration::HandlerBase& handler) { handler.item("bck", _bck); handler.item("data", _data); handler.item("ws", _ws); } ~I2SOBus() = default; }; ``` -------------------------------- ### Start HTTP Test Server Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Launches the test HTTP server on a specified port. Use --verbose for detailed request logging. ```bash python3 http_command_server.py python3 http_command_server.py --port 9000 python3 http_command_server.py --port 8000 --verbose ``` -------------------------------- ### Job Queuing Example Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Illustrates fetching the next job from a queue and using extracted job details like ID and part count. ```gcode (Get next job from queue) $HTTP/Command=@get_next_job (Use extracted job_id and part_count) # = #<_job_id> # = #<_part_count> (... process parts ...) ``` -------------------------------- ### Basic Google Test Structure Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/test/UnitTests.md This is a standard template for a Google Test. It includes setup for test data, calling the function under test, and asserting the expected outcome. Use this as a starting point for new tests. ```cpp #include "gtest/gtest.h" #include namespace { TEST(TestSuiteName, TestName) { // Arrange - set up test data int expected = 42; // Act - call the function under test int actual = myFunction(); // Assert - verify the result EXPECT_EQ(actual, expected); } TEST(TestSuiteName, AnotherTest) { // Add more tests... EXPECT_TRUE(someCondition()); EXPECT_FLOAT_EQ(3.14f, calculatePi(), 0.01f); } } // namespace ``` -------------------------------- ### Install GCC on Ubuntu/Debian Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/test/UnitTests.md Install GCC and G++ on Ubuntu or Debian systems using apt-get to resolve linker errors related to gcov. ```bash # Ubuntu/Debian sudo apt-get install gcc g++ ``` -------------------------------- ### Get Current RPM Command Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Shows how to query the VFD for its current operating RPM and provides an example of interpreting the received speed value. ```text Send: 01 03 700C 0002 Recv: 01 03 0004 095D 0000 D149 ---- 2397 RPM (~ 10%) ``` -------------------------------- ### Get Current Status Command Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Example of sending a command to query the VFD's current operational status and the expected response format. ```text Send: 01 03 30 00 00 01 8B 0A Recv: 01 03 00 02 00 02 65 CB ``` -------------------------------- ### Install gcovr for Coverage Reporting Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/test/UnitTests.md Install the gcovr tool using pip to resolve 'gcovr: command not found' errors when running coverage reports. ```bash pip install gcovr ``` -------------------------------- ### Install FluidNC WiFi Version (ESP32) Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/win64/HOWTO-INSTALL.txt Installs the WiFi version of FluidNC on the ESP32. This script should be run after unpacking the release zip file. ```batch install-wifi.bat ``` -------------------------------- ### Install FluidNC Bluetooth Version (ESP32) Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/win64/HOWTO-INSTALL.txt Installs the Bluetooth version of FluidNC on the ESP32. This script should be run after unpacking the release zip file. ```batch install-bt.bat ``` -------------------------------- ### Install FluidNC WiFi Version (ESP32S3) Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/win64/HOWTO-INSTALL.txt Installs the WiFi version of FluidNC on the ESP32S3. This script should be run after unpacking the release zip file. ```batch install-wifi_s3.bat ``` -------------------------------- ### Install 'screen' Terminal (Debian/Ubuntu) Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/posix/HOWTO-INSTALL.txt Installs the 'screen' utility, a common serial terminal program, on Debian-based Linux distributions. This is an alternative for interacting with FluidNC if FluidTerm has issues. ```shell sudo apt update sudo apt install screen ``` -------------------------------- ### Install GCC on macOS Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/test/UnitTests.md Install the GCC compiler on macOS using Homebrew to resolve linker errors related to gcov. ```bash # macOS brew install gcc ``` -------------------------------- ### Implement Basic Configurable Class Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Configuration/_Overview.md Example of a basic structural class implementing `Configurable`. It defines configurable fields, a constructor, validation logic, and a `handle` method to map settings to fields. ```c++ class I2SOBus : public Configuration::Configurable { public: I2SOBus() = default; Pin _bck; // ... void validate() override { if (!_bck.undefined() || !_data.undefined() || !_ws.undefined()) { Assert(!_bck.undefined(), "I2SO BCK pin should be configured once."); // ... } } void group(Configuration::HandlerBase& handler) { handler.item("bck", _bck); // ... } ~I2SOBus() = default; }; ``` -------------------------------- ### Multi-step Macro Example Source: https://context7.com/bdring/fluidnc/llms.txt Macros can execute multiple GCode commands separated by '&'. This allows for complex sequences to be triggered by a single macro. ```gcode ; Macros can also be multi-step using '&' as separator: ; Macro0: G53G0Z-5 & G28XY & M5 ``` -------------------------------- ### Cartesian Kinematics Configuration Source: https://context7.com/bdring/fluidnc/llms.txt Enable the default Cartesian kinematic system. No specific parameters are required for basic setup. ```yaml kinematics: Cartesian: ``` -------------------------------- ### Forward Run Command Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Example of the Modbus command to initiate forward rotation of the spindle. ```text 01 06 2000 0001 ``` -------------------------------- ### vtable_in_dram.ld Content for RAM Placement Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/ld/esp32s3/README.md Specify which object file sections (.rodata, .xt.prop) should be placed in RAM. This example targets Spindle, Dynamixel2, and StepStick related files. ```linker-script **Spindle.cpp.o(.rodata .rodata.* .xt.prop .xt.prop.*) *Dynamixel2.cpp.o(.rodata .rodata.* .xt.prop .xt.prop.*) *StepStick.cpp.o(.rodata .rodata.* .xt.prop .xt.prop.*) ``` -------------------------------- ### Generate vcxproj File Source: https://github.com/bdring/fluidnc/blob/main/VisualStudio.md Use this command to generate the necessary vcxproj file for Visual Studio. Ensure Python is installed and accessible in your PATH. ```bash python generate_vcxproj.py ``` -------------------------------- ### Backward Run Command Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Example of the Modbus command to initiate reverse rotation of the spindle. ```text 01 06 2000 0002 ``` -------------------------------- ### Run Fixture Test for Alarms Source: https://github.com/bdring/fluidnc/blob/main/fixture_tests/README.md Execute a fixture test to check the alarm state of the ESP32 hardware. This example sends a command to check the alarm status and verifies the expected responses. ```bash ./run_fixture /dev/cu.usbserial-31320 fixtures/alarms.nc -> $X <~ [MSG:INFO: Caution: Unlocked] <- ok -> $Alarm/Send=10 <- ok <- [MSG:INFO: ALARM: Spindle Control] Fixture fixtures/alarms.nc passed ``` -------------------------------- ### G-code Reset Command Examples Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/tests/parser-result.txt Demonstrates the use of the '$rst' command to reset Grbl. It shows setting the reset to 'gcode' and then to '#', with 'ok' responses. ```gcode $rst=gcode ok ``` ```gcode $rst=# ok ``` ```gcode $# [G54:0.000,0.000,0.000] [G55:0.000,0.000,0.000] [G56:0.000,0.000,0.000] [G57:0.000,0.000,0.000] [G58:0.000,0.000,0.000] [G59:0.000,0.000,0.000] [G28:0.000,0.000,0.000] [G30:0.000,0.000,0.000] [G92:0.000,0.000,0.000] [TLO:0.000] [PRB:0.000,0.000,0.000:0] ok ``` -------------------------------- ### Clear Status Area and Initialize Source: https://github.com/bdring/fluidnc/blob/main/stack-trace-decoder.html Clears the status display area and sets up an event listener to load releases when the DOM is fully loaded. This is typically part of the initial page setup. ```javascript d("statusArea").innerHTML = ""; } // ── Init ─────────────────────────────────────────────────────────── window.addEventListener("DOMContentLoaded", loadReleases); ``` -------------------------------- ### G4 Dwell Command Examples Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/tests/parser-result.txt Illustrates the G4 dwell command, which pauses machine execution for a specified duration. 'g4 p0' is a valid command, while other variations might be unsupported. ```gcode g4 p0 ok ``` -------------------------------- ### Replace Local Filesystem (ESP32) Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/win64/HOWTO-INSTALL.txt Replaces the local filesystem on the ESP32, useful for updating WebUI files or starting with a clean slate. This is primarily for the WiFi version. ```batch install-fs.bat ``` -------------------------------- ### Generate Code Coverage Reports Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/test/UnitTests.md Instructions for generating code coverage reports using pip and Python scripts. This involves installing necessary tools and running coverage analysis. ```bash pip install gcovr python coverage.py # Runs tests_coverage + text report python coverage.py --html # Runs tests_coverage + interactive HTML report ``` -------------------------------- ### Run Fixture Test for Idle Status Source: https://github.com/bdring/fluidnc/blob/main/fixture_tests/README.md Execute a fixture test to verify the idle status reporting of the ESP32 hardware. This example checks for an idle state and specific machine position reporting. ```bash ./run_fixture /dev/cu.usbserial-31320 fixtures/idle_status.nc -> $X <~ [MSG:INFO: Caution: Unlocked] <- ok -> ?? <| Fixture fixtures/idle_status.nc passed ``` -------------------------------- ### G28/G30 Home Position Commands Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/tests/parser-result.txt Shows commands for moving to the predefined home position (G28) or the alternate home position (G30). Includes examples with coordinate arguments and their status updates. ```gcode g28 ok ``` ```gcode g28 x3 ok ``` ```gcode g28.1 ok ``` ```gcode g28.1 x3 ok ``` ```gcode g30 y1 ok ``` ```gcode g30.1 ok ``` ```gcode g30.1 y2 ok ``` -------------------------------- ### Minimal 3-axis Cartesian Machine Configuration Source: https://context7.com/bdring/fluidnc/llms.txt This is a basic example of a FluidNC configuration file for a 3-axis Cartesian machine. It defines stepping engine parameters, kinematics, and axis-specific settings including homing and motor driver pins. ```yaml # Minimal 3-axis Cartesian machine with TMC2209 drivers board: My CNC Board name: 3-Axis Mill meta: 2024-01-01 Initial setup stepping: engine: RMT # Step pulse engine: TIMED | RMT | I2S_STATIC | I2S_STREAM idle_ms: 255 # Motor idle delay in ms (255 = always energized) pulse_us: 4 # Step pulse width in microseconds dir_delay_us: 1 # Direction setup time before step pulse disable_delay_us: 0 segments: 12 # Step segment buffer size kinematics: Cartesian: # Options: Cartesian, CoreXY, WallPlotter, ParallelDelta, Midtbot axes: shared_stepper_disable_pin: NO_PIN homing_runs: 2 # Number of approach/pulloff homing cycles x: steps_per_mm: 400.0 max_rate_mm_per_min: 3000.0 acceleration_mm_per_sec2: 200.0 max_travel_mm: 300.0 soft_limits: true homing: cycle: 2 # Auto-home cycle order (1 = first) positive_direction: false mpos_mm: 0.0 # Machine position after homing seek_mm_per_min: 1500.0 # First approach speed feed_mm_per_min: 700.0 # Slow second approach speed seek_scaler: 1.1 feed_scaler: 1.1 settle_ms: 250 motor0: limit_neg_pin: gpio.35:low # Active-low limit switch on GPIO 35 limit_pos_pin: NO_PIN hard_limits: true pulloff_mm: 2.0 standard_stepper: # Motor driver type step_pin: gpio.26 direction_pin: gpio.27 disable_pin: gpio.25 # Select config file at runtime # $Config/Filename=myMachine.yaml ``` -------------------------------- ### Command Reference Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Illustrates how to invoke predefined HTTP commands using the '@' syntax. ```gcode $HTTP/Command=@fetch_temperature ``` ```gcode $HTTP/Command=@ha_call_automation ``` -------------------------------- ### Switching FluidNC Configuration Files Source: https://context7.com/bdring/fluidnc/llms.txt Demonstrates how to switch between different configuration files stored on the ESP32's local filesystem. Send the `$Config/Filename=` command and then reboot the device to apply the new configuration. ```text # Send over serial or WebUI terminal: $Config/Filename=laser.yaml # Reboot to apply: [ESP444]RESTART ``` -------------------------------- ### Install Python Tkinter on Fedora/RHEL Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/linux-python3/HOWTO-INSTALL.txt If Fluidterm fails with a ModuleNotFoundError for 'tkinter' on Fedora/RHEL systems, install the required system package. ```bash $ sudo dnf install python3-tkinter ``` -------------------------------- ### Install Python Tkinter on Debian/Raspbian Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/linux-python3/HOWTO-INSTALL.txt If Fluidterm fails with a ModuleNotFoundError for 'tkinter' on Debian/Raspbian systems, install the required system package. ```bash $ sudo apt install python3-tk ``` -------------------------------- ### Upload Firmware using PlatformIO CLI Source: https://github.com/bdring/fluidnc/blob/main/VisualStudio.md This command uploads the compiled firmware to your device via the command line. Replace COM7 with your device's serial port. ```bash platformio run --target upload --upload-port COM7 ``` -------------------------------- ### Copy Settings to Device Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Copies the configured http_settings.json file to the device's local storage or prepares for WiFi upload. ```bash # For local testing (ESP32 with SD card) cp http_settings.json /mnt/sd_card/localfs/ # Or via WiFi with FluidNC command interface # $HTTP/Settings/Load would reload after updating /localfs/http_settings.json ``` -------------------------------- ### Configure Probe Inputs Source: https://context7.com/bdring/fluidnc/llms.txt Set up probe and toolsetter pins, and define behavior during probing cycles. 'hard_stop' should be false for most probing operations. ```yaml probe: pin: gpio.36:low # Probe input pin (active-low) toolsetter_pin: gpio.33:low:pu # Toolsetter for ATC check_mode_start: true # Position source after probe in check mode hard_stop: false # Halt immediately on probe contact ``` -------------------------------- ### Configure SD Card Interface Source: https://context7.com/bdring/fluidnc/llms.txt Set up the SD card interface by specifying the chip select (CS) pin and SPI frequency. 'card_detect_pin' can be used if available. ```yaml sdcard: cs_pin: gpio.5 card_detect_pin: NO_PIN frequency_hz: 8000000 ``` -------------------------------- ### Configure Macros Source: https://context7.com/bdring/fluidnc/llms.txt Define GCode macros to be executed on startup, after homing, reset, or unlock. Macros can also be triggered by specific hardware inputs. ```yaml macros: startup_line0: G21 G90 G94 ; Run at startup: metric, absolute, feed/min mode startup_line1: after_homing: G10 L20 P1 Z0 ; Set Z work offset after homing after_reset: after_unlock: Macro0: G28 ; Triggered by realtime byte 0x87 Macro1: M8 & G4 P2 ; Triggered by realtime byte 0x88 Macro2: Macro3: ``` -------------------------------- ### Connect to FluidNC using Screen Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/linux-python3/HOWTO-INSTALL.txt Use the 'screen' utility to connect to the FluidNC serial port. Replace '/dev/ttyUSBWHATEVER' with the actual serial port name. ```bash screen /dev/ttyUSBWHATEVER 115200 ``` -------------------------------- ### Stop Command Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Example of the Modbus command to stop the spindle rotation. ```text 01 06 2000 0006 ``` -------------------------------- ### Configure WiFi Settings Source: https://context7.com/bdring/fluidnc/llms.txt Set up WiFi credentials and mode for network connectivity. This allows access to the WebUI and other network features. ```text ; WiFi configuration via settings: $Wifi/SSID=MyNetwork $Wifi/Password=secret $Wifi/Mode=STA ; STA = client mode, AP = access point $Wifi/Hostname=fluidnc ; Connect and control via browser at http://fluidnc.local ; Or use WebDAV to upload/manage files: http://fluidnc.local/webdav ``` -------------------------------- ### FluidNC Boot Log Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/tests/parser-result.txt This log details the FluidNC boot process, including reset cause, flash configuration, and memory loading. It indicates the system's initialization sequence. ```text ets Jul 29 2019 12:21:46 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1216 ho 0 tail 12 room 4 load:0x40078000,len:9720 ho 0 tail 12 room 4 load:0x40080400,len:6352 entry 0x400806b8 ``` -------------------------------- ### CRC Calculation Example Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Illustrates the byte ordering and structure for CRC calculation in Modbus communication with VFDs. ```text 01: Address of device, usually 1 06: 03 = read, 06 = write, 07 = command 20: Byte 1 of 0x2000 (set command) 00: Byte 2 of 0x2000 00: Byte 1 of 0x0002 (rev run) 02: Byte 2 of 0x0002 03: crc_value & 0xFF CB: (crc_value >> 8) & 0xFF ``` -------------------------------- ### Firmware and Status Commands Source: https://context7.com/bdring/fluidnc/llms.txt Utilize GCode and WebUI commands to retrieve firmware build information, list settings, check modal state, manage alarms, and control system power states. ```text $I ; Print firmware build info (version, URL) $$ ; List all $ settings $G ; Print current GCode modal state $# ; Print coordinate system offsets $C ; Toggle check mode (syntax validation, no motion) $X ; Clear alarm $H ; Home all axes $SLP ; Enter sleep mode (disables steppers, WiFi stays up) ``` ```text ; WebUI ESP commands: [ESP420] ; JSON system stats (CPU, memory, WiFi, firmware version) [ESP444]RESTART ; Reboot the ESP32 ``` -------------------------------- ### Erase ESP32S3 Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/win64/HOWTO-INSTALL.txt Removes all existing software from the ESP32S3, preparing it for a fresh FluidNC installation. Run this if other software is present. ```batch erase_s3.bat ``` -------------------------------- ### Dollar ($) Settings and Commands Source: https://context7.com/bdring/fluidnc/llms.txt Manage FluidNC settings and runtime configuration using dollar commands. These allow listing, reading, and writing settings, initiating homing, probing, and modifying runtime parameters. ```text $$ List all settings $ Read a setting value $=val Write a setting value ``` ```text ; Config system $Config/Filename=config.yaml ; Active config file ``` ```text ; Logging $Message/Level=Info ; None|Error|Warning|Info|Debug|Verbose ``` ```text ; Status $GCode/Echo=OFF ; Echo GCode lines before execution ``` ```text ; Homing $H ; Home all axes $HX ; Home X axis only $HY ; Home Y axis $HZ ; Home Z axis ``` ```text ; Probing (runtime coordinate set) $I ; Print build info $N ; Print startup lines $N0=G54 ; Set startup line 0 $# ; Print GCode parameter state ($G28, $G30, etc.) $G ; Print GCode modal state $C ; Toggle check mode (dry run) $X ; Kill alarm lock (if safe) $SLP ; Enter sleep mode ``` ```text ; Runtime config changes (traverses YAML tree) $coolant/flood=gpio.2:pu ; Change flood pin at runtime $axes/x/steps_per_mm=400 ; Change steps per mm ``` -------------------------------- ### Immediate Digital Output On Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/user_io.md Turns an immediate digital output ON. Use the P word to indicate the digital output number (0-3). Immediate commands do not wait for buffered steps to complete. ```gcode M64 P0 ``` -------------------------------- ### Erase ESP32 Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/win64/HOWTO-INSTALL.txt Removes all existing software from the ESP32, preparing it for a fresh FluidNC installation. Run this if other software is present. ```batch erase.bat ``` -------------------------------- ### Run PlatformIO Tests with Verbose Output Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/test/UnitTests.md Use the '-vv' flag with 'pio test' to display detailed compilation commands, helpful for debugging missing header errors. ```bash pio test -e tests -vv ``` -------------------------------- ### Erase ESP32 Device Source: https://github.com/bdring/fluidnc/blob/main/install_scripts/posix/HOWTO-INSTALL.txt Execute this script to completely erase all software from your ESP32. This is recommended before installing FluidNC if the device has other software on it. ```shell sh erase.sh ``` -------------------------------- ### Get Max RPM Command Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H2AProtocol.md Demonstrates the Modbus command to retrieve the maximum RPM setting (b0.05) from the VFD and how to interpret the response. ```text Max RPM: b0.05 Send: 01 03 B0 05 00 02 F2 CA Recv: 01 03 00 04 5D C0 03 F6 D0 21 -- -- = 24000 ``` -------------------------------- ### Data Extraction from HTTP Response Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Example of executing a command and extracting multiple numeric JSON values into GCode parameters for later use. ```gcode $HTTP/Command=@fetch_all_sensors (#<_temperature> = fetched temperature value) (#<_humidity> = fetched humidity value) (#<_pressure> = fetched pressure value) ``` -------------------------------- ### Grbl Version and Help Prompt Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/tests/parser-result.txt Displays the Grbl version and the prompt for help. This is the initial interface presented to the user after connection. ```text Grbl 1.3a ['$' for help] ; paste with a terminal emulator with a 200 ms delay between lines ``` -------------------------------- ### Load Local .addrinfo File Source: https://github.com/bdring/fluidnc/blob/main/stack-trace-decoder.html Handles the selection and loading of a local .addrinfo file via a file input element. Parses the JSON content and updates the application state. ```javascript document.addEventListener("DOMContentLoaded", () => { document.getElementById("localFile").addEventListener("change", async (ev) => { const file = ev.target.files[0]; if (!file) return; showStatus(`Loading ${file.name}…`, "info"); try { const text = await file.text(); const data = JSON.parse(text); if (!data.symbols || !Array.isArray(data.symbols)) { throw new Error("Invalid .addrinfo file (no symbols array)."); } addrinfo = data; addrinfoSource = file.name; showAddrInfoMeta(); showStatus(`Loaded ${data.symbols.length.toLocaleString()} symbols from ${file.name}.`, "ok"); } catch (e) { showStatus(`Failed to load file: ${e.message}`, "err"); } }); }); ``` -------------------------------- ### H100 Spindle Control Commands Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H100Protocol.md Examples of commands to control the H100 spindle's direction and stop functionality. These commands include the address, function code, payload, and checksum. ```plaintext [01] [05] [00 49] [ff 00] [0c 2c] -- forward run ``` ```plaintext [01] [05] [00 4A] [ff 00] [0c 2c] -- reverse run ``` ```plaintext [01] [05] [00 4B] [ff 00] [0c 2c] -- stop ``` -------------------------------- ### Token Substitution for IP Address Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Shows how a token can be used to dynamically set the IP address in an HTTP request. ```gcode $HTTP/Command=http://${ip}/data{"headers":{"Authorization":"${ha_token}"}} ``` -------------------------------- ### Status Report (?) Source: https://context7.com/bdring/fluidnc/llms.txt Sending '?' requests the machine state in a Grbl-compatible format. The report includes machine position, feed/spindle speed, work coordinate offset, and override values. ```text ``` ```text ; Fields: ; MPos: Machine position (mm) ; WPos: Work position (shown when WCO not reported) ; FS: Feed rate (mm/min), Spindle speed (RPM) ; WCO: Work coordinate offset (reported periodically) ; Ov: Override values: feed%, rapid%, spindle% ; Bf: Planner buffer blocks available, serial RX bytes ; A: Accessories: S=spindle CW, C=spindle CCW, F=flood, M=mist ``` -------------------------------- ### Token Substitution in URL Source: https://github.com/bdring/fluidnc/blob/main/examples/http_command/README_HTTP.md Demonstrates how to use a stored token for authentication within an HTTP request URL. ```gcode $HTTP/Command=http://api.example.com/data{"headers":{"Authorization":"${ha_token}"}} ``` -------------------------------- ### Realtime Commands Source: https://context7.com/bdring/fluidnc/llms.txt Inject single-byte realtime commands directly into the serial stream at any time, even during motion. These control various machine functions like hold, start, reset, and overrides. ```text ? ASCII 0x3F - Status report request ! ASCII 0x21 - Feed hold ~ ASCII 0x7E - Cycle start / resume Ctrl-X ASCII 0x18 - Soft reset ``` ```text 0x84 Safety door 0x85 Jog cancel ``` ```text 0x90 Feed override reset to 100% 0x91 Feed override +10% 0x92 Feed override -10% 0x93 Feed override +1% 0x94 Feed override -1% ``` ```text 0x95 Rapid override reset to 100% 0x96 Rapid override 50% 0x97 Rapid override 25% ``` ```text 0x99 Spindle override reset to 100% 0x9A Spindle override +10% 0x9B Spindle override -10% 0x9C Spindle override +1% 0x9D Spindle override -1% 0x9E Spindle override stop (toggle) ``` ```text 0xA0 Coolant flood toggle 0xA1 Coolant mist toggle ``` ```text 0x87 Execute Macro0 0x88 Execute Macro1 0x89 Execute Macro2 0x8A Execute Macro3 ``` -------------------------------- ### Load GitHub Releases List Source: https://github.com/bdring/fluidnc/blob/main/stack-trace-decoder.html Fetches a list of FluidNC releases from the GitHub API to populate a release selection dropdown. Displays an error message if the fetch fails. ```javascript async function loadReleases() { try { const resp = await fetch("https://api.github.com/repos/bdring/FluidNC/releases?per_page=30"); if (!resp.ok) throw new Error(`HTTP ${resp.status}`); releases = await resp.json(); const sel = document.getElementById("releaseSelect"); sel.innerHTML = ''; for (const r of releases) { const opt = document.createElement("option"); opt.value = r.tag_name; opt.textContent = `${r.tag_name} (${r.published_at?.split("T")[0] || "draft"})`; sel.appendChild(opt); } } catch (e) { const sel = document.getElementById("releaseSelect"); sel.innerHTML = ''; } } ``` -------------------------------- ### Multi-Spindle ATC Test Sequence Source: https://github.com/bdring/fluidnc/blob/main/fixture_tests/fixtures/atc_manual.txt This sequence tests multi-spindle ATC operations, specifically focusing on changing to a higher tool number. It verifies spindle start and tool identification after the change. ```gcode M3 ; Spindle on M6T10 ; Spindle off, spindle changes; $G ; Tool 10 and S0 M3S12000; New spindle is on. ``` -------------------------------- ### Include vtable_in_dram.ld in sections.ld Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/ld/esp32s3/README.md Add this line to sections.ld to include the vtable RAM placement directives. This line should be placed within the section that puts code into data RAM. ```linker-script INCLUDE ( vtable_in_dram.ld ) ``` -------------------------------- ### Execute HTTP Requests from GCode Source: https://context7.com/bdring/fluidnc/llms.txt Send GET or POST requests, optionally with JSON bodies and header authentication. Response status can be stored, and specific fields extracted into named parameters. ```gcode ; Send GET request, store HTTP status in #_http_status $HTTP=http://sensor.local:8000/api/temperature ``` ```gcode ; POST with JSON body, extract response fields into named params $HTTP=http://api.local/jobs/next{"headers":{"X-API-Key":"abc123"},"extract":{"_job_id":"id","_qty":"quantity"}} ``` ```gcode ; Use a named command shortcut $HTTP=fetch_temp ``` ```gcode ; Use extracted value in next GCode move G1 X#_job_id F500 ``` -------------------------------- ### Get Current G-code Settings ($G) Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/tests/parser-result.txt Retrieves the current G-code parser state, including active modal groups like G-codes, coordinate systems, and units. This is useful for debugging. ```gcode $G [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0] ok ``` ```gcode $G [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G54 G18 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G54 G19 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G55 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G56 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G57 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` ```gcode $g [GC:G0 G58 G17 G21 G90 G94 M5 M9 T0 F1000 S0] ok ``` -------------------------------- ### CoreXY Kinematics Configuration Source: https://context7.com/bdring/fluidnc/llms.txt Configure the CoreXY kinematic system. An optional scaling factor can be applied to the X-axis movements. ```yaml kinematics: CoreXY: x_scaler: 1.0 # Optional scaling factor ``` -------------------------------- ### Configure Control Pins Source: https://context7.com/bdring/fluidnc/llms.txt Assign GPIO pins for various machine control functions like safety door, reset, feed hold, and cycle start. 'fault_pin' is an output indicating alarm state. ```yaml control: safety_door_pin: gpio.32:low:pu # Triggers feed hold / door state reset_pin: gpio.33:low:pu # Triggers soft reset feed_hold_pin: gpio.34:low # Pause motion cycle_start_pin: gpio.35:low # Resume motion macro0_pin: gpio.36:low # Hardware trigger for Macro0 macro1_pin: NO_PIN macro2_pin: NO_PIN macro3_pin: NO_PIN fault_pin: NO_PIN # Output: active in alarm state estop_pin: NO_PIN # E-stop input ``` -------------------------------- ### Load Symbol Info from GitHub Release Source: https://github.com/bdring/fluidnc/blob/main/stack-trace-decoder.html Fetches and loads symbol information (.addrinfo file) from a specified FluidNC GitHub release and variant. Handles potential errors during download or parsing. ```javascript async function loadFromRelease() { const tag = document.getElementById("releaseSelect").value; const variant = document.getElementById("variantSelect").value; if (!tag) { showStatus("Please select a FluidNC release.", "err"); return false; } const vi = variantInfo(variant); // The .addrinfo files are published in the fluidnc-releases repo under // releases////firmware.addrinfo const urls = [ `https://raw.githubusercontent.com/bdring/fluidnc-releases/main/releases/${tag}/${vi.mcu}/${vi.build}/firmware.addrinfo`, ]; showStatus(`Downloading firmware.addrinfo for ${tag} / ${variant}…`, "info"); try { let data = null; let lastErr = ""; for (const url of urls) { try { const resp = await fetch(url); if (resp.ok) { data = await resp.json(); break; } lastErr = `HTTP ${resp.status}`; } catch (e) { lastErr = e.message; } } if (!data) { throw new Error(`${lastErr} — the .addrinfo file may not exist for this release/variant.`); } if (!data.symbols || !Array.isArray(data.symbols)) { throw new Error("Invalid .addrinfo file (no symbols array)."); } addrinfo = data; addrinfoSource = `${tag} / ${variant}`; showAddrInfoMeta(); showStatus(`Loaded ${data.symbols.length.toLocaleString()} symbols from ${tag} / ${variant}.`, "ok"); return true; } catch (e) { showStatus(`Failed to load symbol data: ${e.message}`, "err"); addrinfo = null; return false; } } ``` -------------------------------- ### H100 Protocol Message Structure Source: https://github.com/bdring/fluidnc/blob/main/FluidNC/src/Spindles/VFD/H100Protocol.md The general structure of H100 protocol messages includes an ID, function code, start address, payload, and checksum. This format is used for both reading and writing data to the spindle controller. ```plaintext [id] [fcn code] [start addr] [payload] [checksum] ``` -------------------------------- ### Configure HTTP Settings Source: https://context7.com/bdring/fluidnc/llms.txt Define tokens and commands for outbound HTTP requests. Tokens like API keys and base URLs are stored in this JSON file. ```json // /localfs/http_settings.json { "tokens": { "ha_token": "Bearer eyJ...", "ip": "sensor.local:8000" }, "commands": { "fetch_temp": "http://${ip}/api/temperature", "notify_done": "http://homeassistant.local:8123/api/webhook/cnc_done{\"method\":\"POST\",\"headers\":{\"Authorization\":\"${ha_token}\",\"Content-Type\":\"application/json\"},\"body\":\"{\\\"status\\\":\\\"done\\\"}\"}" } } ```