ESP32 with FluidNC does not cooperate with LightBurn

I have an ESP32 DEVKIT V1 and FluidNC v.3.9.1 wifi version installed on it with this config.yaml file:

name: "ESP32 Dev Controller V4"
board: "ESP32 Dev Controller V4"

stepping:
  engine: RMT
  idle_ms: 250
  dir_delay_us: 1
  pulse_us: 2
  disable_delay_us: 0

axes:
  shared_stepper_disable_pin: gpio.13:low

  x:
    steps_per_mm: 80.174
    max_rate_mm_per_min: 24000
    acceleration_mm_per_sec2: 3000
    max_travel_mm: 603
    homing:
      cycle: 2
      mpos_mm: 3
      positive_direction: false
    motor0:
      limit_all_pin: gpio.17:low:pu
      stepstick:
        direction_pin: gpio.14
        step_pin: gpio.12
    motor1:
      null_motor:

  y:
    steps_per_mm: 53.422
    max_rate_mm_per_min: 12000
    acceleration_mm_per_sec2: 3000
    max_travel_mm: 1203
    homing:
      cycle: 2
      mpos_mm: 3
      positive_direction: false
    motor0:
      limit_all_pin: gpio.4:low:pu
      stepstick:
        direction_pin: gpio.15
        step_pin: gpio.26
    motor1:
      null_motor:

  z:
    steps_per_mm: 1701.023
    max_rate_mm_per_min: 500
    acceleration_mm_per_sec2: 80
    max_travel_mm: 79.6
    homing:
      cycle: 1
      mpos_mm: 3
      positive_direction: true
    motor0:
      limit_all_pin: gpio.16:low:pu
      stepstick:
        direction_pin: gpio.33
        step_pin: gpio.27
    motor1:
      null_motor:

spi:
  miso_pin: gpio.19
  mosi_pin: gpio.23
  sck_pin: gpio.18

sdcard:
  cs_pin: gpio.5
  card_detect_pin: NO_PIN

coolant:
  flood_pin: gpio.25
  mist_pin: gpio.21

probe:
  pin: gpio.32:low:pu

PWM:
  pwm_hz: 5000
  output_pin: gpio.2
  enable_pin: gpio.22
  direction_pin: NO_PIN
  disable_with_s0: false
  s0_with_disable: true
  spinup_ms: 0
  spindown_ms: 0
  tool_num: 0
  speed_map: 0=0% 1=100%

My ESP cooperates smoothly only with LaserGRBL and fluidterm…
With UGS sometimes it works sometimes doesn’t.
But the biggest issue is that it is not working with LightBurn…
Lightburn has 3 moods:

Spamming G0 when it thinks that it is connected

G0
G0
G0
G0
G0

spamming

ALARM:14
RM: Unhomed]

or being always BUSY:

it (ALARM 14) also happens on fluidterm and it causes bluescreen while using fluidterm. LightBurn somehow manages not to do that.

Screens from LaserGRBL:


That’s my current LBrn settings…

Enabling DTR signal changed nothing.

Please, help.

Do you have homing switches on this machine? I think that’s it’s main complaint is it can’t home.

:smile_cat:

Since I’m only testing if FluidNC will have mood to cooperate with LBrn (it don’t want to coop), ESP32 is not physically connected to the machine nor limit switches. I’m simulating homing by short circuit GND and GPIOs with correct sequence, as it is homing on real machine. It works. The problem is communication between Lbrn and ESP32. How to correctly configure the FluidNC step by step so it can coop with LBrn?

Is that why it’s always saying unhomed ?


Error 14 is Line length exceeded and is usually a built in length (computed at compile) set value.

I don’t know if the sd card is trying to load it or ? I’d think Lightburn would not send long lines.

Good luck

:smile_cat:

I mean

I mean I’m simulating the homing sequence, I haven’t connected ESP32 to machine yet.
DEVKIT V1 doesn’t have SD card plug. You mean that the FluidNC wouldn’t work without SD card connected?

I’m running that on one of my controllers, but I don’t really know. It’s also not hooked up to a machine at this time. Something is attempting to send it a line that is longer than it can handle.

I really don’t know FluidNC at all, so I’m running by error messages. Since it’s not wired up to anything, it makes things a bit more difficult.

If there’s no sd card, it can’t be coming from there. Do you get the same type errors with other terminals instead of Lightburn?


Might want to disable home on startup in the device settings …

:smile_cat:

What firmware do you use on DLC32? Standard GRBL? How did you managed to upload it? Could you please send some yt links how to do it?

As I sent photo in the first post, the problem doesn’t occur at all in LaserGRBL, it ignores messages and somehow is managing to connect with ESP. Only Universal Gcode sender, fluidterm and LightBurn have problems to communicate with ESP

I did this over a year ago, but I’m pretty sure it was Fluid NC that was loaded directly from their site. It’s been packed away so I can’t even plug it in and check. You should be able to load any grbl for your platform.

I used the standard tools… I run Linux, so it’s more limited. I think I did it via the USB connection.

Usually if Lasergrbl will run on it and I’d expect the other gcode senders, including Lightburn to use it without an issue.

:smile_cat:

Do you know if DLC32 has 5V output for DIR, PUL and PWM Signal? Or is it 3.3V for PWM, DIR and PUL? Do I need to buy this level shifters to convert 3.3V signal from ESP32 to 5V for my DM542 and 100W LPS?


Maybe the issue is I am using “normal” ESP32 DEVKIT V1 and not DLC32 which is created to control CNC…

On the DLC32, the stepper motors go through a shift register (74HC595D) that outputs TTL signal levels.


The pwm goes through a voltage translator, so it’s also TTL. J7 is the spindle and J18 is the laser control on the upper right of the DLC32.


You may need to translate the voltages if you are planning on using a plain ESP32 for a laser cnc. For sure the PWM needs to be ttl signal levels. The PWM input to IN can be digital or analog and the input range is 0 to 5V. The pwm gets changed to an analog voltage within the lps, which is why you need the total TTL voltage swing.

A voltage of 3.3V will usually be a 1 (high) for ttl control so you can probably get away with driving the motor driver directly – if it can supply enough current to the motor driver input. You’d have to look at the motor driver data sheet to see what current is required.

Good luck

:smile_cat:

2 Likes

TTL signal is signal translated from 3.3V to 5V?:smiley:

It is with the DLC32 board. It has the hardware to do this, doubt your esp32 has the extra hardware for this translation.

The value that’s critical is the pwm signal. If it doesn’t make a full 5V swing, you can’t adjust current limit above 3.3V in a 5V world.

:smile_cat:

1 Like

Bought MKS DLC32, it has 5V logic output, so there is no problem, you don’t need logic level shifters, you can connect it directly to stepper motor drivers and LPS. Writing bc somebody would need this info. There is no problem, plug-and-play, you don’t even have to instal FluidNC on it, the grbl-like firmware is installed on it by default. Great thing!