Wiznet makers

irina

Published May 07, 2026 ©

172 UCC

5 WCC

104 VAR

0 Contests

0 Followers

0 Following

Original Link

FluidNC CNC Firmware

Fork of open-source FluidNC CNC firmware (ESP32-based GRBL successor) adding W5500 Ethernet support. Send G-code over wired TCP without WiFi. 2025 community for

COMPONENTS Hardware components

WIZnet - W5500

x 1


PROJECT DESCRIPTION

📌 개요

이 프로젝트는 인기 오픈소스 CNC 펌웨어 FluidNCWIZnet W5500 SPI 이더넷 지원을 추가한 것입니다. FluidNC는 ESP32 기반 CNC 컨트롤러를 위한 차세대 펌웨어로, Grbl_ESP32의 후속 프로젝트입니다. 이 포크는 기존 FluidNC의 WiFi 네트워크 대신 또는 함께 W5500 유선 이더넷을 사용할 수 있도록 EthernetConfig.cppEthernetConfig.h 파일을 추가하고, WifiConfig.cppENABLE_ETHERNET 컴파일 플래그를 통한 조건부 통합 코드를 삽입한 것이 핵심입니다.

CNC 머신 환경에서는 스테퍼 모터 드라이버, VFD, 스핀들 모터에서 발생하는 강한 전자기 간섭(EMI)이 WiFi 연결을 불안정하게 만들 수 있습니다. W5500 유선 이더넷은 이러한 노이즈에 면역이 있어 G코드 스트리밍과 WebUI 접근을 안정적으로 유지합니다.

GRBL (AVR)
   ↓
Grbl_ESP32
   ↓
FluidNC(재설계)
   ↓
FluidNC + W5500

 

📌 Two Build Environments

WiFi-only vs W5500 Ethernet 빌드 비교]

 

📌 주요 기능

W5500 SPI 이더넷 추가 — ENABLE_ETHERNET 플래그 기존 FluidNC에는 없던 EthernetConfig.cppEthernetConfig.h를 신규 추가했습니다. WifiConfig.cpp#ifdef ENABLE_ETHERNET 조건부 컴파일로 통합됩니다. 빌드 시 이 플래그를 활성화하면 W5500 이더넷이 초기화됩니다.

SD카드와 SPI 버스 공유 — SPI2_HOST W5500은 FluidNC의 SD카드 드라이버가 이미 사용 중인 SPI2_HOST를 공유합니다. spi_bus_initialize()를 새로 호출하지 않고 기존 버스에 두 번째 디바이스로 추가합니다. CS는 GPIO 14, INT는 GPIO 9, SPI 속도는 20MHz입니다.

ESP-IDF 네이티브 이더넷 스택 사용 esp_eth_mac_new_w5500(), esp_eth_phy_new_w5500(), esp_netif_new(), esp_eth_start()로 구성된 ESP-IDF 표준 W5500 드라이버 초기화 흐름을 따릅니다. lwIP TCP/IP 스택에 자동으로 붙으며 DHCP 클라이언트가 동작합니다.

GRBL 완전 호환 유지 FluidNC 원본의 GRBL 호환성을 그대로 유지합니다. G코드 전송/응답 프로토콜 변경 없음, 모든 GRBL G코드 지원, 기존 G코드 센더(UGS, CNCjs, Candle 등)와 호환됩니다.

WebUI 유지 FluidNC 내장 브라우저 기반 WebUI(Esp32_WebUI)가 이더넷 네트워크에서도 정상 동작합니다. PC, 스마트폰, 태블릿으로 CNC 머신을 제어할 수 있습니다.

YAML 기반 머신 설정 FluidNC 원본의 YAML 설정 파일 방식을 그대로 사용합니다. 펌웨어 재컴파일 없이 config.yaml만 수정하면 머신 구성을 변경할 수 있습니다.

 

📌 시스템 아키텍처

W5500 통합 아키텍처 — SPI2_HOST 공유 구조

 

📌 핵심 코드 — EthernetConfig.cpp

실제 추가된 EthernetConfig.cpp의 핵심 구조입니다:

// GPIO 핀 정의 (dpCREATOR R2 보드 기준)
#define W5500_CS_GPIO   14
#define W5500_INT_GPIO   9
#define W5500_SPI_HOST  SPI2_HOST  // SD카드와 공유
#define W5500_SPI_HZ    20000000   // 20MHz

void ethernet_init() {
    // 1. spi_bus_initialize() 호출 안 함 — SD카드 드라이버가 이미 소유
    // 2. W5500을 기존 SPI2_HOST의 두 번째 디바이스로 추가
    spi_device_interface_config_t spi_devcfg = {};
    spi_devcfg.clock_speed_hz = W5500_SPI_HZ;
    spi_devcfg.spics_io_num   = W5500_CS_GPIO;

    // 3. ESP-IDF W5500 MAC/PHY 생성
    eth_w5500_config_t w5500_config = 
        ETH_W5500_DEFAULT_CONFIG(W5500_SPI_HOST, &spi_devcfg);
    w5500_config.int_gpio_num = W5500_INT_GPIO;

    esp_eth_mac_t* mac = esp_eth_mac_new_w5500(&w5500_config, &mac_config);
    esp_eth_phy_t* phy = esp_eth_phy_new_w5500(&phy_config);

    // 4. 드라이버 설치 + lwIP netif 연결 + 이벤트 핸들러
    esp_eth_driver_install(&eth_config, &s_eth_handle);
    esp_netif_attach(eth_netif, esp_eth_new_netif_glue(s_eth_handle));
    esp_eth_start(s_eth_handle);
}

📌 빌드 및 플래시

요구사항: PlatformIO, ESP-IDF v5.x (ESP_IDF_VERSION_MAJOR >= 5)

# 1. 저장소 클론
git clone https://github.com/val218/fluidNC-with-w5500-support

# 2. ENABLE_ETHERNET 플래그 활성화 (platformio.ini 또는 build_flags)
# build_flags = -DENABLE_ETHERNET

# 3. 빌드 및 업로드
pio run -t upload

# 4. 시리얼 모니터
pio device monitor --baud 115200

머신 설정:

  1. USB/시리얼 또는 WiFi로 config.yaml 업로드
  2. WebUI: http://<이더넷 IP>/ 접속

릴리즈 태그: v4.0.3_r2_w5500 (원본 FluidNC v4.0.3 기반)


📌 WIZnet W5500 칩의 역할

사용 칩 모델명: W5500

이 포크에서 W5500은 FluidNC의 네트워크 계층에 유선 이더넷 경로를 추가하는 역할을 합니다. 구체적으로는:

  • G코드 스트리밍 안정성: WiFi EMI 간섭 없이 G코드 센더에서 CNC 머신으로 G코드를 안정적으로 전송
  • WebUI 접근: 브라우저 기반 FluidNC WebUI를 이더넷 네트워크에서 접근
  • DHCP 클라이언트: ESP-IDF lwIP 스택과 자동 연동
  • SD카드와 SPI 공유: spi_bus_initialize() 재호출 없이 기존 SPI2_HOST 버스에 두 번째 디바이스로 추가 — 리소스 충돌 없음

왜 W5500이 필요한가: CNC 환경은 EMI가 매우 심합니다. 스테퍼 드라이버와 VFD의 스위칭 노이즈가 2.4GHz WiFi 신호를 간섭합니다. 긴 가공 작업 중 WiFi 연결이 끊기면 G코드 스트리밍이 중단되고 공작물이 망가질 수 있습니다. W5500 유선 이더넷은 이런 환경에서도 안정적으로 동작합니다.

📌 지원 하드웨어

이 포크의 W5500 핀 설정은 dpCREATOR R2 보드 기준으로 확인됐습니다:

신호GPIO
W5500 CSGPIO 14
W5500 INTGPIO 9
SPI MOSIGPIO 11
SPI MISOGPIO 13
SPI SCKGPIO 12
SPI HostSPI2_HOST (SD카드와 공유)

다른 ESP32 기반 CNC 보드에서는 EthernetConfig.cpp의 GPIO 핀 정의를 수정해 사용할 수 있습니다.

📌 시스템 아키텍처 다이어그램

G코드 센더 → W5500/WiFi → FluidNC → CNC 축 흐름

📌 시장 및 활용 가치

DIY CNC 메이커, 홈 머시닝 작업장, 소규모 제조업체, 레이저 커터 사용자가 핵심 시장입니다. 특히 산업 환경의 EMI로 WiFi가 불안정한 CNC 머신 운영자에게 실용적인 솔루션을 제공합니다. 기존 FluidNC 생태계(G코드 센더, WebUI, YAML 설정)를 그대로 활용하면서 네트워크 안정성만 W5500으로 강화할 수 있습니다.

📌 WIZnet 전략적 가치

이 포크는 W5500이 WiFi 불안정 문제를 해결하는 실용적인 솔루션으로서 CNC 펌웨어 생태계에 진입하는 사례입니다. 특히 기존 SPI 버스를 재사용하는 설계 패턴(SD카드 + W5500 공유)은 리소스가 제한된 ESP32 환경에서 W5500을 최소한의 변경으로 추가하는 레퍼런스 구현으로 활용 가치가 높습니다.

📌 요약

FluidNC W5500 포크는 EthernetConfig.cpp 추가와 ENABLE_ETHERNET 컴파일 플래그로 FluidNC CNC 펌웨어에 W5500 유선 이더넷 지원을 통합합니다. SD카드와 SPI2_HOST를 공유하고, ESP-IDF 표준 W5500 드라이버를 사용하며, 기존 FluidNC GRBL 호환성과 WebUI를 모두 유지합니다. CNC 환경의 EMI 문제로 WiFi가 불안정한 상황에서 안정적인 G코드 스트리밍과 WebUI 접근을 보장합니다. GPLv3 라이선스.


📌 FAQ

Q1. 이 포크와 원본 FluidNC의 차이점은 무엇인가요? 핵심 차이는 EthernetConfig.cppEthernetConfig.h의 추가, WifiConfig.cppENABLE_ETHERNET 조건부 통합 코드입니다. W5500 SPI 이더넷을 통해 유선 네트워크로 FluidNC를 운용할 수 있습니다.

Q2. W5500과 SD카드를 같은 SPI 버스에 연결해도 충돌이 없나요? 예. spi_bus_initialize()를 새로 호출하지 않고 FluidNC SD카드 드라이버가 소유한 SPI2_HOST에 W5500을 두 번째 디바이스로 추가합니다. CS 핀(GPIO 14)으로 디바이스를 분리해 충돌을 방지합니다.

Q3. ENABLE_ETHERNET 플래그는 어떻게 활성화하나요? platformio.inibuild_flags-DENABLE_ETHERNET을 추가합니다. 이 플래그 없이 빌드하면 기존 FluidNC WiFi 동작을 그대로 사용합니다.

Q4. 기존 FluidNC G코드 센더와 호환되나요? 예. GRBL 호환성을 완전히 유지합니다. UGS, CNCjs, Candle 등 기존 G코드 센더를 이더넷 IP 주소로 연결하면 그대로 동작합니다.

Q5. dpCREATOR R2 이외의 보드에서 사용할 수 있나요? EthernetConfig.cppW5500_CS_GPIO(14), W5500_INT_GPIO(9), SPI 핀 정의를 대상 보드의 실제 배선에 맞게 수정하면 다른 ESP32 기반 CNC 보드에서도 사용할 수 있습니다.

Q6. WiFi와 이더넷을 동시에 사용할 수 있나요? 이 포크는 W5500 이더넷을 추가하는 것이 목적이며, WiFi와 동시 운용은 명시적으로 구현되어 있지 않습니다. 기본적으로 ENABLE_ETHERNET 플래그로 이더넷 초기화를 활성화하는 방식입니다.

Q7. WebUI는 이더넷에서도 동작하나요? 예. FluidNC 내장 브라우저 기반 WebUI(Esp32_WebUI)는 이더넷 IP 주소로 접근하면 정상 동작합니다.

Q8. 릴리즈 버전은 무엇인가요? v4.0.3_r2_w5500 태그 기준으로, 원본 FluidNC v4.0.3에 W5500 지원을 추가한 버전입니다.

Q9. DHCP는 자동으로 동작하나요? 예. ESP-IDF의 esp_netif와 lwIP 스택에 자동으로 연결되어 DHCP 클라이언트가 동작합니다. IP 주소는 시리얼 모니터에서 IP: xxx.xxx.xxx.xxx 로그로 확인할 수 있습니다.

Q10. 라이선스는 무엇인가요? 원본 FluidNC와 동일한 GPLv3 라이선스입니다.

 

📌 참고 링크


📌 Overview

This project is a community fork of FluidNC — the popular open-source CNC firmware for ESP32 — with WIZnet W5500 SPI Ethernet support added. FluidNC is the next-generation firmware for ESP32-based CNC controllers and the successor to Grbl_ESP32. This fork introduces EthernetConfig.cpp and EthernetConfig.h as new files, and integrates conditional compilation via the ENABLE_ETHERNET flag in WifiConfig.cpp, enabling W5500 wired Ethernet alongside or instead of WiFi.

In CNC machine environments, strong electromagnetic interference (EMI) from stepper motor drivers, VFDs, and spindle motors can disrupt WiFi connectivity. W5500 wired Ethernet is immune to this noise, keeping G-code streaming and WebUI access stable throughout long machining operations.

 

📌 Two Build Environments

 WiFi-only vs W5500 Ethernet build comparison

 

📌 Key Features

W5500 SPI Ethernet — ENABLE_ETHERNET flag Introduces EthernetConfig.cpp and EthernetConfig.h — new files not present in the original FluidNC. Integration into WifiConfig.cpp is done via #ifdef ENABLE_ETHERNET conditional compilation. When this flag is enabled at build time, W5500 Ethernet initializes.

Shared SPI bus with SD card — SPI2_HOST W5500 shares the SPI2_HOST already owned by FluidNC's SD card driver. Rather than calling spi_bus_initialize() again, W5500 is added as a second device on the existing bus. CS is GPIO 14, INT is GPIO 9, SPI speed is 20 MHz.

Native ESP-IDF Ethernet stack Follows the standard ESP-IDF W5500 driver initialization sequence: esp_eth_mac_new_w5500(), esp_eth_phy_new_w5500(), esp_netif_new(), esp_eth_start(). Automatically attaches to the lwIP TCP/IP stack with DHCP client.

Full GRBL compatibility preserved Retains the original FluidNC's complete GRBL compatibility. No changes to G-code send/response protocol. Supports all GRBL G-code commands. Works with existing G-code senders (UGS, CNCjs, Candle, etc.).

WebUI preserved FluidNC's built-in browser-based WebUI (Esp32_WebUI) works normally over an Ethernet network. Control the CNC machine from a PC, smartphone, or tablet.

YAML-based machine configuration Uses the same YAML configuration file system as the original FluidNC. Machine configuration can be changed by editing config.yaml alone — no firmware recompilation needed.

 

📌 System Architecture

W5500 integration architecture — SPI2_HOST shared bus structure

📌 Core Code — EthernetConfig.cpp

Key structure of the newly added EthernetConfig.cpp:

// GPIO pin definitions (dpCREATOR R2 board)
#define W5500_CS_GPIO   14
#define W5500_INT_GPIO   9
#define W5500_SPI_HOST  SPI2_HOST  // Shared with SD card
#define W5500_SPI_HZ    20000000   // 20 MHz

void ethernet_init() {
    // 1. spi_bus_initialize() NOT called — SD card driver already owns the bus
    // 2. Add W5500 as second device on existing SPI2_HOST
    spi_device_interface_config_t spi_devcfg = {};
    spi_devcfg.clock_speed_hz = W5500_SPI_HZ;
    spi_devcfg.spics_io_num   = W5500_CS_GPIO;

    // 3. Create ESP-IDF W5500 MAC/PHY
    eth_w5500_config_t w5500_config =
        ETH_W5500_DEFAULT_CONFIG(W5500_SPI_HOST, &spi_devcfg);
    w5500_config.int_gpio_num = W5500_INT_GPIO;

    esp_eth_mac_t* mac = esp_eth_mac_new_w5500(&w5500_config, &mac_config);
    esp_eth_phy_t* phy = esp_eth_phy_new_w5500(&phy_config);

    // 4. Install driver + attach lwIP netif + event handlers
    esp_eth_driver_install(&eth_config, &s_eth_handle);
    esp_netif_attach(eth_netif, esp_eth_new_netif_glue(s_eth_handle));
    esp_eth_start(s_eth_handle);
}

📌 Build & Flash

Requirements: PlatformIO, ESP-IDF v5.x (ESP_IDF_VERSION_MAJOR >= 5)

# 1. Clone the repository
git clone https://github.com/val218/fluidNC-with-w5500-support

# 2. Enable ENABLE_ETHERNET flag (platformio.ini or build_flags)
# build_flags = -DENABLE_ETHERNET

# 3. Build and upload
pio run -t upload

# 4. Serial monitor
pio device monitor --baud 115200

Machine configuration:

  1. Upload config.yaml via USB/serial or WiFi
  2. WebUI: navigate to http://<ethernet IP>/

Release tag: v4.0.3_r2_w5500 (based on upstream FluidNC v4.0.3)


📌 Role and Application of the WIZnet's Chip

Chip model: W5500

In this fork, the W5500 adds a wired Ethernet path to FluidNC's networking layer. Specifically:

  • G-code streaming stability: Delivers G-code from sender to CNC machine reliably without WiFi EMI interference
  • WebUI serving: Serves the browser-based FluidNC WebUI over an Ethernet network
  • DHCP client: Automatically connected to the ESP-IDF lwIP stack
  • Shared SPI with SD card: Added as a second device on the existing SPI2_HOST bus without calling spi_bus_initialize() again — no resource conflict

Why W5500: CNC environments are electrically noisy. Switching noise from stepper drivers and VFDs interferes with 2.4 GHz WiFi. If the WiFi connection drops mid-job, G-code streaming stops and the workpiece is ruined. W5500 wired Ethernet is immune to this interference.


📌 Supported Hardware

W5500 pin assignments in this fork are confirmed for the dpCREATOR R2 board:

SignalGPIO
W5500 CSGPIO 14
W5500 INTGPIO 9
SPI MOSIGPIO 11
SPI MISOGPIO 13
SPI SCKGPIO 12
SPI HostSPI2_HOST (shared with SD card)

Other ESP32-based CNC boards can be supported by modifying the GPIO pin definitions in EthernetConfig.cpp.


📌 G-code Flow Diagram

G-code sender → W5500/WiFi → FluidNC → CNC axes flow

📌 Market & Application Value

DIY CNC makers, home machining shops, small manufacturers, and laser cutter users are the core market. Particularly valuable for CNC machine operators in industrial environments where EMI makes WiFi unstable. Leverages the full existing FluidNC ecosystem (G-code senders, WebUI, YAML configuration) while upgrading network reliability to W5500.


📌 WIZnet Strategic Value

This fork demonstrates W5500 entering the CNC firmware ecosystem as a practical solution to WiFi instability. The design pattern of reusing an existing SPI bus (SD card + W5500 shared on SPI2_HOST) is a clean, reusable reference implementation for adding W5500 to resource-constrained ESP32 systems with minimal code changes.


📌 Summary

This FluidNC fork integrates W5500 wired Ethernet support into FluidNC CNC firmware via EthernetConfig.cpp and the ENABLE_ETHERNET compile flag. W5500 shares the SD card's SPI2_HOST bus, uses the standard ESP-IDF W5500 driver, and preserves full FluidNC GRBL compatibility and WebUI. In EMI-heavy CNC environments, W5500 delivers stable G-code streaming and WebUI access that WiFi cannot guarantee. GPLv3 licensed.


📌 FAQ

Q1. What is the difference between this fork and the original FluidNC? The core difference is the addition of EthernetConfig.cpp and EthernetConfig.h, plus ENABLE_ETHERNET conditional integration code in WifiConfig.cpp. This enables W5500 SPI Ethernet for wired network operation.

Q2. Is there a conflict between W5500 and the SD card on the same SPI bus? No. W5500 is added as a second device on the SPI2_HOST already owned by the FluidNC SD card driver, without calling spi_bus_initialize() again. The CS pin (GPIO 14) separates the two devices — no conflict.

Q3. How do I enable the ENABLE_ETHERNET flag? Add -DENABLE_ETHERNET to build_flags in platformio.ini. Building without this flag retains the original FluidNC WiFi behavior.

Q4. Is it compatible with existing FluidNC G-code senders? Yes. Full GRBL compatibility is preserved. Connect existing G-code senders (UGS, CNCjs, Candle, etc.) to the Ethernet IP address and they work as-is.

Q5. Can I use it on boards other than dpCREATOR R2? Modify the GPIO definitions in EthernetConfig.cpp (W5500_CS_GPIO=14, W5500_INT_GPIO=9, SPI pins) to match the actual wiring on your target ESP32-based CNC board.

Q6. Can WiFi and Ethernet be used simultaneously? This fork focuses on adding W5500 Ethernet. Simultaneous WiFi + Ethernet operation is not explicitly implemented. The ENABLE_ETHERNET flag activates Ethernet initialization at build time.

Q7. Does the WebUI work over Ethernet? Yes. FluidNC's built-in browser-based WebUI (Esp32_WebUI) works normally when accessed via the Ethernet IP address.

Q8. What is the release version? Tag v4.0.3_r2_w5500 — based on upstream FluidNC v4.0.3 with W5500 support added.

Q9. Is DHCP automatic? Yes. Automatically connected to ESP-IDF's esp_netif and lwIP stack. The assigned IP address appears in the serial monitor as IP: xxx.xxx.xxx.xxx.

Q10. What is the license? GPLv3 — same as the original FluidNC.


📌 Reference Links

Documents
Comments Write