[FluidNC Issue#1537] Problem: FluidNC crashes after some time

未分类 bolang 4个月前 (10-14) 36次浏览

Issue #1537 | 状态: 进行中 | 作者: TomKamphuys | 创建时间: 2025-08-04


Wiki Search Terms

crash freeze

Controller Board

AZDelivery ESP32 NodeMCU D1 R32 WLAN development board with CH340G and WiFi + Bluetooth IoT with micro USB compatible with Arduino

https://www.az-delivery.de/en/products/esp32-d1-r32-board?pos=2&sid=911b0b730&_ss=r

Machine Description

I’m building a scanner to measure speaker output at several positions. I’m using a python program running on a raspberry pi to send a position to fluidnc and wait until it is ready and do an audio sweep at 500 to 5000 points.

Input Circuits


Configuration file

board: ESPDUINO-32
name: PANT.S.

axes: sharedstepperdisable_pin: gpio.12:high x: stepspermm: 17.778 maxratemmpermin: 100000 accelerationmmper_sec2: 5000 maxtravelmm: 1000 homing: cycle: 2 mpos_mm: 10 positive_direction: false motor0: stepstick: direction_pin: gpio.16 step_pin: gpio.26

y: stepspermm: 17.778 maxratemmpermin: 100000 accelerationmmper_sec2: 5000 maxtravelmm: 1000 homing: cycle: 2 mpos_mm: 10 positive_direction: false

motor0: stepstick: direction_pin: gpio.27 step_pin: gpio.25

z: stepspermm: 17.778 maxratemmpermin: 100000 accelerationmmper_sec2: 5000 maxtravelmm: 1000 homing: cycle: 1 mpos_mm: 10 positive_direction: true

motor0: stepstick: direction_pin: gpio.14 step_pin: gpio.17

a: stepspermm: 17.778 maxratemmpermin: 100000 accelerationmmper_sec2: 5000 maxtravelmm: 1000 homing: cycle: 1 mpos_mm: 10 positive_direction: true

motor0: stepstick: direction_pin: gpio.18 step_pin: gpio.19

Startup Messages

websockets.client DEBUG    = connection is CONNECTING
websockets.client DEBUG    > GET / HTTP/1.1
websockets.client DEBUG    > Host: fluidnc2.local:81
websockets.client DEBUG    > Upgrade: websocket
websockets.client DEBUG    > Connection: Upgrade
websockets.client DEBUG    > Sec-WebSocket-Key: SRu4a1BqSF3al+y5UZmD+g==
websockets.client DEBUG    > Sec-WebSocket-Version: 13
websockets.client DEBUG    > Sec-WebSocket-Extensions: permessage-deflate; clientmaxwindow_bits
websockets.client DEBUG    > User-Agent: Python/3.11 websockets/15.0.1
websockets.client DEBUG    < HTTP/1.1 101 Switching Protocols
websockets.client DEBUG    < Server: arduino-WebSocketsServer
websockets.client DEBUG    < Upgrade: websocket
websockets.client DEBUG    < Connection: Upgrade
websockets.client DEBUG    < Sec-WebSocket-Version: 13
websockets.client DEBUG    < Sec-WebSocket-Accept: v6n+Z412DpC+V6e3Qns7IQ/gNAc=
websockets.client DEBUG    = connection is OPEN
websockets.client DEBUG    > TEXT '$X\n' [3 bytes]
websockets.client DEBUG    < PING '' [0 bytes]
websockets.client DEBUG    > PONG '' [0 bytes]
websockets.client DEBUG    < TEXT 'CURRENT_ID:0' [12 bytes]
websockets.client DEBUG    < TEXT 'ACTIVE_ID:0' [11 bytes]
websockets.client DEBUG    < BINARY 5b 4d 53 47 3a 49 4e 46 4f 3a 20 43 61 75 74 69 ... 6c 6f 63 6b 65 64 5d 0a [30 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT '$/axes/x/stepspermm=72.752\n' [29 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT '$/axes/x/maxratemmpermin=25000.0\n' [37 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT '$/axes/x/accelerationmmper_sec2=100.0\n' [40 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT '$/axes/y/stepspermm=72.752\n' [29 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT '$/axes/y/maxratemmpermin=25000.0\n' [37 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT '$/axes/y/accelerationmmper_sec2=100.0\n' [40 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT 'G92 X0 Y230\n' [12 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]
websockets.client DEBUG    > TEXT '$10=0\n' [6 bytes]
websockets.client DEBUG    < BINARY 6f 6b 0a [3 bytes]

User Interface Software

Custom python program connecting through websocket

What happened?

During the measurement(s), it stops. Fluidnc is not reacting anymore, so the measurement process freezes.

GCode File

n.a.

Other Information

I have tried to make the setup as small as possible in trying to find out what is wrong. I've ended up with a wifi router, a raspberry pi, the esp32 board with fluidnc and a laptop to control everything. If I only ping fluidnc I get some time-outs every now and then, but it recovers.

Image

When I start my measurements program, the frequency of the time-outs seems to increase and fluidnc does not recover.

Image

Pinging of the raspberry pi and router show no abnormalities.


评论 (13)

#1 - MitchBradley 于 2025-08-05

It might be a good idea to attach your Python program if you expect us to be able to reproduce your problem


#2 - TomKamphuys 于 2025-08-05

https://github.com/TomKamphuys/NFS/tree/feature/arcs

N.B. use the feature arcs branch

Look at the bottom of this file how to start:
https://github.com/TomKamphuys/NFS/blob/feature/arcs/Documents/BuildDescription.md

Change config.ini before starting.

Audio mock to True
Fluidnc1 type to Mock
Nrofpoints to 10000

!Image

N.B. fluidnc has to be reachable on fluidnc2.local
That can be changed by the web_socket variable in the fluidnc2 section

After starting, go to ipaddress:8086 in a webrowser and press zero scanner and start measurements. ipaddress is the IP address of the computer running the python program.


#3 - TomKamphuys 于 2025-08-05

I'm planning to output the gcode commands to a file and see if running that file from e.g. UGS has the same problems.


#4 - MitchBradley 于 2025-08-05

Are you using STA mode or AP mode?


#5 - TomKamphuys 于 2025-08-05

STA


#6 - MitchBradley 于 2025-08-05

Ok. I will try to reproduce the problem tomorrow.


#7 - MitchBradley 于 2025-08-05

This setup is too complicated. I tried to run nfs_app.py on WSL, after installing the dependencies via requirements.txt and changing config.ini as instructed above. It failed with "OSError: PortAudio library not found" from audio.py. I eventually resolved that by installing all the packages to allow the pyaudio wheel to build, but then it failed with "Command '/usr/bin/x-www-browser' requires the firefox snap to be installed." I don't have time to go to a deeper circle of Dependency Hell, nor to set up a Raspberry Pi for the test.

I presume that most of this infrastructure is unrelated to the specific problem at hand. Perhaps you could construct a simpler test without all the bells and whistles.


#8 - TomKamphuys 于 2025-08-05

I understand. I'll try to reproduce it with a gcode file or a simple python script with as little dependencies as possible sending gcodes via a socket.

I'll report back.


#9 - MitchBradley 于 2025-08-05

I suspect that the problem has something to do with the network stack, which can in some cases consume a lot of memory. If that is the case, it probably will not fail with a gcode file.


#10 - TomKamphuys 于 2025-08-06

I created a gcode file:

grblfile.zip

Since I couldn't get UGS to connect to fluidnc using websocket, I tried OpenBuilds control. It connected via wifi and is running the file without problems this far. I'm not sure what situation I've created exactly. I will continue to try to make the problem smaller.

Edit: I missed the G04 P0 messages. It's probably too late.... I'll come back to it tomorrow


#11 - TomKamphuys 于 2025-08-09

It has taken me a bit more time, but I can reproduce the problem every now and then by running the gcode file in OpenBuildsControl.

Attached is a zip file with the gcode file and some output of cases where it went wrong.

Image

problem.zip


#12 - TomKamphuys 于 2025-08-13

I've done a ton of testing over the last days. At one point it seemed that the wifi signal was important. Putting the esp32 on the router gave great results. So I ordered a new router to replace the compact travel router. During shipping I continued testing and it seemed that even further away things kept going well. Once I included the steppers in the mix the problem popped up again. Even when using the new router it stopped sometimes. And now even with the steppers not connected I experienced the problem again.

This is a typical ping result:

Image

You see the ping times increase and then it stops.

As I'm writing this comment, the communication has started again and the program continues sending gcode:

Image

Does anyone have any idea what to test next? Where to look at?


#13 - TomKamphuys 于 2025-08-29

I've been testing a lot. It's still inconclusive. Is there anything I can watch (cpu load, memory usage, ...) or debug?


原始Issue: https://github.com/bdring/FluidNC/issues/1537

喜欢 (0)