[3.6.0-beta3] Duet2 WIFI SPI timeout
-
This is a split of the thread https://forum.duet3d.com/topic/37322/3-6-0-beta-3-dwc-connection-issues-duet2-duex5
too keep both bugs, long response and WIFI SPI timeout seperated.It is related to https://github.com/Duet3D/RepRapFirmware/issues/1073#issuecomment-2621298665
Printer was idle with one open session.
Error: failed to retrieve WiFi status message: SPI timeout<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 69864 of which 0 recycled<\n> Never used RAM 25444, free system stack 130 words<\n> Tasks: NETWORK(1,nWait 6,10.1%,211) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,264) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,89.0%,698) IDLE(0,ready,0.8%,29), total 100.0%<\n> Owned mutexes: WiFi(NETWORK) USB(MAIN)<\n> === Platform ===<\n> Last reset 24:55:18 ago, cause: power up<\n> Last software reset at 2025-02-03 20:56, reason: User, Gcodes spinning, available RAM 24764, slot 1<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 26.2, current 29.5, max 30.4<\n> Supply voltage: min 23.7, current 24.0, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/256/120, gc cycles 4227<\n> Events: 0 queued, 0 completed<\n> Date/time: 1970-01-01 00:00:00<\n> Slowest loop: 202.01ms; fastest: 0.12ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 9<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 28.9ms, write time 101.0ms, max retries 0<\n> === Move ===<\n> Segments created 38, maxWait 41665760ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 40320.00/40320/-0.00 -24320.00/-24320/-0.00 400.00/400/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min 177<\n> Driver 1: standstill, SG min 167<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 15, completed 15, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0 0 0 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is idle in state(s) 0<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 319057472<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 1, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 201.38ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: active<\n> Module is connected to access point <\n> Failed messages: pending 0, notrdy 5, noresp 261465<\n> Failed to get WiFi status<\n> Socket states: 0 0 0 6 0 0 0 0<\n> ok<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> Error: failed to retrieve WiFi statu
I was able to reset the WIFI module via USB with
M552 S-1 M552 S0 M552 S1
WiFi module stopped<\n> ok<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ok<\n> WiFi module started<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 69864 of which 0 recycled<\n> Never used RAM 25444, free system stack 130 words<\n> Tasks: NETWORK(1,ready,0.9%,211) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,264) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,97.5%,698) IDLE(0,ready,1.5%,29), total 100.0%<\n> Owned mutexes: USB(MAIN)<\n> === Platform ===<\n> Last reset 24:57:54 ago, cause: power up<\n> Last software reset at 2025-02-03 20:56, reason: User, Gcodes spinning, available RAM 24764, slot 1<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 28.7, current 29.7, max 30.2<\n> Supply voltage: min 23.9, current 23.9, max 24.0, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/1164/1028, gc cycles 4234<\n> Events: 0 queued, 0 completed<\n> Date/time: 1970-01-01 00:00:00<\n> Slowest loop: 99.34ms; fastest: 0.22ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 9<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.3ms, write time 4.7ms, max retries 0<\n> === Move ===<\n> Segments created 38, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 40320.00/40320/-0.00 -24320.00/-24320/-0.00 400.00/400/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 15, completed 15, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0 0 0 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is idle in state(s) 0<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 319632530<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 200.20ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: idle<\n> Module is idle<\n> Failed messages: pending 0, notrdy 0, noresp 0<\n> Firmware version 2.2.1<\n> MAC address 00:00:00:00:00:00<\n> Module reset reason: Turned on by main processor, Vcc 3.47, flash size 4194304, free heap 53932<\n> Clock register 00002002<\n> Socket states: 0 0 0 6 0 0 0 0<\n> ok<\n> ok<\n> WiFi module is connected to access point Meltingplot, IP address 10.42.0.2<\n>
From the old thread
HTTP req, command words { GET /rr_gcode HTTP/1.0 }, parameters { gcode=M122 }<\n> Sending JSON reply, length 12<\n> ResponseTimeout, pending=1<\n> ResponseBusy<\n> Bad recv status size<\n> WiFi: ˆ�n�P<24>|�!�-�1Ë�5‹Ðšö›X�%�ú~�)Q*!Ë�è "X*�<7>�í�×�v�'�áêI*�1�T�,�,�)�)DÐ�b9�)�5~�/�<9>�øn�z�A[�a�øºv�<5>¬�<9>�H~�1�hqh�5�5~�9<1>�êt�l�-�§�X�1�¨Y+�5�%�ûþ�<5>1�<11>�<9>�ˆò�A,�<9>�8øºö�<5>1�R�d�!y(�!�‡�z�A‹�ëy¨�%�!y¨�1�R·�v�-<\n> ESP reported status change<\n> ResponseBusy<\n> WiFi: �)�)DP‹�@íy*�-�<9>�øn�z�Aì )ií�§�P�m�N8r�fP�m�Nøphy_version: 1163.0, 665d56c, Jun 24 2020, 10:00:08, RTOS new<\n> ESP reported status change<\n> ResponseBusy<\n> Error: failed to retrieve WiFi status message: another SPI transfer is pending<\n> Error: failed to retrieve WiFi status message: another SPI transfer is pending<\n> ResponseBusy<\n> Bad recv status size<\n> ResponseBusy<\n> Bad recv status size<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> ESP reported status change<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> ResponseTimeout, pending=1<\n> Bad recv status size<\n> ESP reported status change<\n> ResponseTimeout, pending=1<\n> Error: failed to retrie
-
@timschneider Thanks, I've logged this one at https://github.com/Duet3D/WiFiSocketServerRTOS/issues/50
-
@chrishamm
today, the error appeared a little diffent no spamming ofError: failed to retrieve WiFi status message: SPI timeout<\n>
in console instead a proper error message in the output ofM122
=== Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 172 words<\n> Tasks: NETWORK(1,nWait 6,15.2%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,83.6%,692) IDLE(0,ready,1.1%,29), total 100.0%<\n> Owned mutexes: WiFi(NETWORK) USB(MAIN)<\n> === Platform ===<\n> Last reset 20:16:44 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 28.5, current 29.4, max 30.5<\n> Supply voltage: min 23.8, current 24.0, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/1316/1180, gc cycles 3395<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:34:46<\n> Slowest loop: 11.48ms; fastest: 0.21ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 8<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 8.8ms, write time 0.0ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is doing "G4 P100" in state(s) 0 0, running macro<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 247744131<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 210.96ms; fastest: 0.07ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: active<\n> Module is connected to access point <\n> Failed messages: pending 0, notrdy 0, noresp 208248<\n> Failed to get WiFi status<\n> Socket states: 0 6 0 0 0 0 0 0<\n> ok<\n>
But weird things started after changing the WIFI Module state again with
M552 S-1 M552 S0 M552 S1
ok<\n> WiFi module stopped<\n> ok<\n> ok<\n> WiFi module started<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 172 words<\n> Tasks: NETWORK(1,ready,0.9%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,97.7%,692) IDLE(0,ready,1.4%,29), total 100.0%<\n> Owned mutexes: USB(MAIN)<\n> === Platform ===<\n> Last reset 20:18:00 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 29.0, current 29.6, max 30.1<\n> Supply voltage: min 23.8, current 24.0, max 24.1, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/596/460, gc cycles 3399<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:36:03<\n> Slowest loop: 100.04ms; fastest: 0.21ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 9<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.2ms, write time 0.8ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is idle in state(s) 0<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 248049807<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 200.10ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: idle<\n> Module is idle<\n> Failed messages: pending 0, notrdy 0, noresp 0<\n> Firmware version 2.2.1<\n> MAC address 00:00:00:00:00:00<\n> Module reset reason: Turned on by main processor, Vcc 3.46, flash size 4194304, free heap 53932<\n> Clock register 00002002<\n> Socket states: 0 6 0 0 0 0 0 0<\n> ok<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 170 words<\n> Tasks: NETWORK(1,ready,7.1%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,92.8%,692) IDLE(0,ready,0.0%,29), total 100.0%<\n> Owned mutexes: USB(MAIN)<\n> === Platform ===<\n> Last reset 20:18:18 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 29.4, current 29.5, max 30.1<\n> Supply voltage: min 23.9, current 24.0, max 24.1, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/624/488, gc cycles 3400<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:36:20<\n> Slowest loop: 2.95ms; fastest: 0.21ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 8<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.2ms, write time 0.0ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is doing "G4 P100" in state(s) 0 0, running macro<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 248114856<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 0.33ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: idle<\n> Module is idle<\n> Failed messages: pending 0, notrdy 0, noresp 0<\n> Firmware version 2.2.1<\n> MAC address 00:00:00:00:00:00<\n> Module reset reason: Turned on by main processor, Vcc 3.47, flash size 4194304, free heap 53932<\n> Clock register 00002002<\n> Socket states: 0 6 0 0 0 0 0 0<\n> ok<\n> ok<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 170 words<\n> Tasks: NETWORK(1,ready,6.3%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,93.6%,692) IDLE(0,ready,0.0%,29), total 100.0%<\n> Owned mutexes: USB(MAIN)<\n> === Platform ===<\n> Last reset 20:18:29 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 28.9, current 29.0, max 29.7<\n> Supply voltage: min 23.9, current 24.0, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/804/668, gc cycles 3400<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:36:32<\n> Slowest loop: 2.96ms; fastest: 0.21ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 8<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.2ms, write time 0.0ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is doing "G4 P100" in state(s) 0 0, running macro<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 248160411<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 0.29ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: changingMode<\n> Module is trying to connect<\n> Failed messages: pending 0, notrdy 0, noresp 0<\n> Firmware version 2.2.1<\n> MAC address 00:00:00:00:00:00<\n> Module reset reason: Turned on by main processor, Vcc 3.46, flash size 4194304, free heap 47360<\n> Clock register 00002002<\n> Socket states: 0 6 0 0 0 0 0 0<\n> ok<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 170 words<\n> Tasks: NETWORK(1,ready,7.5%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,92.4%,692) IDLE(0,ready,0.0%,29), total 100.0%<\n> Owned mutexes: USB(MAIN)<\n> === Platform ===<\n> Last reset 20:18:31 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 28.8, current 29.0, max 29.2<\n> Supply voltage: min 23.9, current 24.0, max 24.0, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/1144/1008, gc cycles 3400<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:36:34<\n> Slowest loop: 2.39ms; fastest: 0.23ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 8<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.1ms, write time 0.0ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is doing "G4 P100" in state(s) 0 0, running macro<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 248167507<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 0.26ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: changingMode<\n> Module is trying to connect<\n> Failed messages: pending 0, notrdy 0, noresp 0<\n> Firmware version 2.2.1<\n> MAC address 00:00:00:00:00:00<\n> Module reset reason: Turned on by main processor, Vcc 3.46, flash size 4194304, free heap 47380<\n> Clock register 00002002<\n> Socket states: 0 6 0 0 0 0 0 0<\n> ok<\n> Error: WiFi module reported: Authentication failed<\n> WiFi module is idle<\n>
Hope this helps to track that bug down
-
=== Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 170 words<\n> Tasks: NETWORK(1,ready,7.5%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,92.4%,692) IDLE(0,ready,0.0%,29), total 100.0%<\n> Owned mutexes: USB(MAIN)<\n> === Platform ===<\n> Last reset 20:18:32 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 28.9, current 29.1, max 29.3<\n> Supply voltage: min 23.9, current 24.0, max 24.0, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/1344/1208, gc cycles 3400<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:36:35<\n> Slowest loop: 2.41ms; fastest: 0.21ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 8<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.1ms, write time 0.9ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is doing "G4 P100" in state(s) 0 0, running macro<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 248171978<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 3.65ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: changingMode<\n> Module is idle<\n> Failed messages: pending 0, notrdy 0, noresp 0<\n> Failed to get WiFi status<\n> Socket states: 0 6 0 0 0 0 0 0<\n> ok<\n> Error: failed to retrieve WiFi status message: SPI timeout<\n> WiFi module is idle<\n> Error: failed to change WiFi mode: SPI timeout<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 170 words<\n> Tasks: NETWORK(1,ready,7.2%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,92.7%,692) IDLE(0,ready,0.0%,29), total 100.0%<\n> Owned mutexes: USB(MAIN)<\n> === Platform ===<\n> Last reset 20:19:27 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 28.7, current 28.9, max 29.5<\n> Supply voltage: min 23.9, current 24.0, max 24.1, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/1116/980, gc cycles 3403<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:37:30<\n> Slowest loop: 3.15ms; fastest: 0.21ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 9<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.3ms, write time 2.6ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is idle in state(s) 0<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 248378409<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 102.55ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 0 of 8<\n> === WiFi ===<\n> Interface state: disabled<\n> Module is disabled<\n> Failed messages: pending 0, notrdy 0, noresp 3<\n> Socket states: 0 6 0 0 0 0 0 0<\n> ok<\n> ok<\n> ok<\n> WiFi module started<\n> ok<\n> WiFi module is connected to access point Meltingplot_A1_539,3, IP address 10.42.0.2<\n> === Diagnostics ===<\n> RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11<\n> Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN<\n> Used output buffers: 1 of 26 (21 max)<\n> === RTOS ===<\n> Static ram: 23776<\n> Dynamic ram: 68336 of which 0 recycled<\n> Never used RAM 27884, free system stack 170 words<\n> Tasks: NETWORK(1,ready,8.0%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,91.7%,692) IDLE(0,ready,0.1%,29), total 100.0%<\n> Owned mutexes: WiFi(NETWORK) USB(MAIN)<\n> === Platform ===<\n> Last reset 20:20:30 ago, cause: software<\n> Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2<\n> Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a<\n> Error status: 0x00<\n> MCU temperature: min 28.6, current 29.1, max 29.4<\n> Supply voltage: min 23.8, current 24.0, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes<\n> Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/764/628, gc cycles 3406<\n> Events: 0 queued, 0 completed<\n> Date/time: 2025-02-08 10:38:32<\n> Slowest loop: 99.79ms; fastest: 0.20ms<\n> I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0<\n> === Storage ===<\n> Free file entries: 8<\n> SD card 0 detected, interface speed: 20.0MBytes/sec<\n> SD card longest read time 2.3ms, write time 4.1ms, max retries 0<\n> === Move ===<\n> Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00<\n> Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00<\n> no step interrupt scheduled<\n> Driver 0: standstill, SG min n/a<\n> Driver 1: standstill, SG min n/a<\n> Driver 2: standstill, SG min n/a<\n> Driver 3: standstill, SG min n/a<\n> Driver 4: standstill, SG min n/a<\n> Driver 5: standstill, SG min n/a<\n> Driver 6: standstill, SG min n/a<\n> Driver 7: standstill, SG min n/a<\n> Driver 8: standstill, SG min n/a<\n> Driver 9: standstill, SG min n/a<\n> Driver 10: <\n> Driver 11: <\n> === DDARing 0 ===<\n> Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0]<\n> Segments left 0<\n> Code queue is empty<\n> === Heat ===<\n> Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0<\n> === GCodes ===<\n> Movement locks held by null<\n> HTTP is idle in state(s) 0<\n> Telnet is idle in state(s) 0<\n> File is idle in state(s) 0<\n> USB is ready with "M122" in state(s) 0<\n> Aux is idle in state(s) 0<\n> Trigger is idle in state(s) 0<\n> Queue is idle in state(s) 0<\n> LCD is idle in state(s) 0<\n> Daemon is doing "G4 P100" in state(s) 0 0, running macro<\n> Autopause is idle in state(s) 0<\n> === Filament sensors ===<\n> check 0 clear 248611287<\n> Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0<\n> === DueX ===<\n> Read count 0, 0.00 reads/min<\n> === Network ===<\n> Slowest loop: 25.22ms; fastest: 0.00ms<\n> Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)<\n> HTTP sessions: 2 of 8<\n> === WiFi ===<\n> Interface state: active<\n> Module is connected to access point <\n> Failed messages: pending 0, notrdy 0, noresp 0<\n> Firmware version 2.2.1<\n> MAC address bc:dd:c2:31:9a:40<\n> Module reset reason: Turned on by main processor, Vcc 3.46, flash size 4194304, free heap 43088<\n> WiFi IP address 10.42.0.2<\n> Signal strength -21dBm, channel 11, mode 802.11n, reconnections 0<\n> Clock register 00002002<\n> Socket states: 0 0 0 0 0 0 0 0<\n> ok<\n>
-
I'm almost certian that it is some sort of use-after-free bug.
I got the following responses with the command
M111 M122
Debugging on for modules: Debugging off for modules: Platform(0) Network(1) Webserver(2) Gcodes(3) Move(4) Heat(5) Kinematics(6) InputShaping(7) Debug(8) PrintMonitor(9) Storage(10) PortControl(11) DuetExpansion(12) FilamentSensors(13) WiFi(14) Display(15) SbcInterface(16) CAN(17) Expansion(18) === Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11 Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN Used output buffers: 2 of 26 (26 max) === RTOS === Static ram: 23776 Dynamic ram: 68336 of which 0 recycled Never used RAM 27884, free system stack 164 words Tasks: NETWORK(1,ready,32.3%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,66.3%,692) IDLE(0,ready,1.4%,29), total 100.0% Owned mutexes: HTTP(MAIN) === Platform === Last reset 23:01:56 ago, cause: software Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x04 MCU temperature: min 29.0, current 29.1, max 29.4 Supply voltage: min 23.9, current 24.0, max 24.1, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/1204/1068, gc cycles 3854 Events: 0 queued, 0 completed Date/time: 2025-02-08 13:19:58 Slowest loop: 8.41ms; fastest: 0.22ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0 === Storage === Free file entries: 8 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest read time 2.4ms, write time 0.0ms, max retries 0 === Move === Segments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00 Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00 no step interrupt scheduled Driver 0: standstill, SG min n/a Driver 1: standstill, SG min n/a Driver 2: standstill, SG min n/a Driver 3: standstill, SG min n/a Driver 4: standstill, SG min n/a Driver 5: standstill, SG min n/a Driver 6: standstill, SG min n/a Driver 7: standstill, SG min n/a Driver 8: standstill, SG min n/a Driver 9: standstill, SG min n/a Driver 10: Driver 11: === DDARing 0 === Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0] Segments left 0 Code queue is empty === Heat === Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 === GCodes === Movement locks held by null HTTP is ready with "M122" in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 Daemon is doing "G4 P100" in state(s) 0 0, running macro Autopause is idle in state(s) 0 === Filament sensors === check 0 clear 281113629 Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0 === DueX === Read count 0, 0.00 reads/min === Network === Slowest loop: 21.88ms; fastest: 0.07ms Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) HTTP sessions: 3 of 8 === WiFi === Interface state: active Module is connected to access point Failed messages: pending 0, notrdy 0, noresp 0 Firmware version 2.2.1 MAC address bc:dd:c2:31:9a:40 Module reset reason: Turned on by main processor, Vcc 3.45, flash size 4194304, free heap 42524 WiFi IP address 10.42.0.2 Signal strength -19dBm, channel 11, mode 802.11n, reconnections 0 Clock register 00002002 Socket states: 0 0 0 0 0 0 0 0
Debugging on for modules: Debugging off for modules: Platform(0) Network(1) Webserver(2) Gcodes(3) Move(4) Heat(5) Kinematics(6) InputShaping(7) Debug(8) PrintMonitor(9) Storage(10) PortControl(11) DuetExpansion(12) FilamentSensors(13) WiFi(14) Display(15) SbcInterface(16) CAN(17) Expansion(18) === Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-beta.3+4 (2025-02-05 09:48:00) running on Duet WiFi 1.02 or later + DueX5v0.11 Board ID: 08DJM-9178L-L4MSJ-6J1FL-3S86J-TB2LN Used output buffers: 2 of 26 (26 max) === RTOS === Static ram: 23776 Dynamic ram: 68336 of which 0 recycled Never used RAM 27884, free system stack 164 words Tasks: NETWORK(1,ready,44.7%,217) HEAT(3,nWait 5,0.1%,283) Move(4,nWait 5,0.0%,361) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,53.8%,692) IDLE(0,ready,1.4%,29), total 100.0% Owned mutexes: WiFi(NETWORK) HTTP(MAIN) === Platform === Last reset 23:01:58 ago, cause: software Last software reset at 2025-02-07 14:18, reason: User, Gcodes spinning, available RAM 25444, slot 2 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x04 MCU temperature: min 28.9, current 29.3, max 29.4 Supply voltage: min 23.9, current 24.0, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/1424/1288, gc cycles 3854 Events: 0 queued, 0 completed Date/time: 2025-02-08 13:20:00 Slowest loop: 7.44ms; fastest: 0.23ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0 === Storage === Free file entries: 8 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest read time 2.6ms, write time 0.0ms, max retries 0 === Move === Sedded 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00 Pos req/act/dcf: 0.00/0/0.gments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00 Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00 no step interrupt scheduled Driver 0: standstill, SG min n/a Driver 1: standstill, SG min n/a Driver 2: standstill, SG min n/a Driver 3: standstill, SG min n/a Driver 4: standstill, SG min n/a Driver 5: standstill, SG min n/a Driver 6: standstill, SG min n/a Driver 7: standstill, SG min n/a Driver 8: standstill, SG min n/a Driver 9: standstill, SG min n/a Driver 10: Driver 11: === DDARing 0 === Scheduled moves 0, completed 0, LaErrors 0, Underruns [0, 0, 0] Segments left 0 Code queue is empty === Heat === Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 === GCodes === Movement locks held by null HTTP is ready with "M122" in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 Daemon is doing "G4 P100" in state(s) 0 0, running macro Autopause is idle in state(s) 0 === Filament sensors === check 0 clear 281117052 Extruder 0: pos 2160.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0 === DueX === Read count 0, 0.00 reads/min === Network === Slowest loop: 22.33ms; fastest: 0.08ms Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) HTTP sessions: 3 of 8 === WiFi === Interface state: active Module is connected to access point Failed messages: pending 0, notrdy 0, noresp 0 Firmware version 2.2.1 MAC address bc:dd:c2:31:9a:40 Module reset reason: Turned on by main processor, Vcc 3.45, flash size 4194304, free heap 42700 WiFi IP address 10.42.0.2 Signal strength -20dBm, channel 11
pay close attention to the line 31:
=== Move === Sedded 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00 Pos req/act/dcf: 0.00/0/0.gments created 0, maxWait 0ms, bed comp in use: none, height map offset 0.000, hiccups added 0/0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00 Pos req/act/dcf: 0.00/0/0.00 0.00/0/0.00 0.00/0/0.00
for the macro
M98 P"0:/macros/test-bufferoverflow3.g"
I got the following123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
pay attention to line 9
-
i can provide more examples where random data / new line characters are added, sometimes also binary data. But the binary data will not make it through as it is nothing the browser would expect.
line 9, 10 and 25
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567895678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234
-
This post is deleted! -
@chrishamm
I found that adding an overflow check invoid HttpResponder::HandleGCodeReply(const char *_ecv_array reply) noexcept
will help to mitiage the problem. I don't know yet if it is solved in the long run.From e4799bc4e3343878d035cb0074b2f37cfbf524be Mon Sep 17 00:00:00 2001 From: Tim Schneider <tim@schneider.engineering> Date: Tue, 11 Feb 2025 12:03:55 +0100 Subject: [PATCH] - check for OutputBuffer overflow in HttpResponder::HandleGCodeReply --- src/Networking/HttpResponder.cpp | 14 ++++++++++++++ src/Networking/NetworkResponder.cpp | 2 +- src/Networking/NetworkResponder.h | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Networking/HttpResponder.cpp b/src/Networking/HttpResponder.cpp index b9deb5e6..b0ed4e51 100644 --- a/src/Networking/HttpResponder.cpp +++ b/src/Networking/HttpResponder.cpp @@ -1536,6 +1536,20 @@ void HttpResponder::Diagnostics(MessageType mt) const noexcept } buffer->cat(reply); + + if (buffer->HadOverflow()) + { + // We ran out of buffers at some point. + ReportOutputBufferExhaustion(__FILE__, __LINE__); + + // Discard pending replies + while (!gcodeReply.IsEmpty()) + { + OutputBuffer *buf = gcodeReply.Pop(); + OutputBuffer::ReleaseAll(buf); + } + } + clientsServed = 0; seq++; } diff --git a/src/Networking/NetworkResponder.cpp b/src/Networking/NetworkResponder.cpp index a4c025d3..aeaee3c7 100644 --- a/src/Networking/NetworkResponder.cpp +++ b/src/Networking/NetworkResponder.cpp @@ -192,7 +192,7 @@ IPAddress NetworkResponder::GetRemoteIP() const noexcept return (skt == nullptr) ? IPAddress() : skt->GetRemoteIP(); } -void NetworkResponder::ReportOutputBufferExhaustion(const char *_ecv_array sourceFile, int line) noexcept +/*static*/ void NetworkResponder::ReportOutputBufferExhaustion(const char *_ecv_array sourceFile, int line) noexcept { if (reprap.Debug(Module::Webserver)) { diff --git a/src/Networking/NetworkResponder.h b/src/Networking/NetworkResponder.h index 97633ac2..47324738 100644 --- a/src/Networking/NetworkResponder.h +++ b/src/Networking/NetworkResponder.h @@ -69,7 +69,7 @@ protected: virtual void ConnectionLost() noexcept; IPAddress GetRemoteIP() const noexcept; - void ReportOutputBufferExhaustion(const char *_ecv_array sourceFile, int line) noexcept; + static void ReportOutputBufferExhaustion(const char *_ecv_array sourceFile, int line) noexcept; static Platform& GetPlatform() noexcept { return reprap.GetPlatform(); } static Network& GetNetwork() noexcept { return reprap.GetNetwork(); } -- 2.39.2.windows.1
you can see in the following debug log for Module Webserver that this line is triggered sometimes
Ran out of output buffers at ../src/Networking/HttpResponder.cpp(1543)<\n>
HTTP req, command words { GET /rr_gcode HTTP/1.1 }, parameters { gcode=M98 P"0:/macros/test-bufferoverflow4.g" }<\n> Sending JSON reply, length 12<\n> HTTP connection accepted<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending G-Code reply to HTTP client 3 of 5 (length 5065)<\n> Ran out of output buffers at ../src/Networking/HttpResponder.cpp(1543)<\n> Sending JSON reply, length 2915<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { flags=d99fn }<\n> HTTP connection accepted<\n> Sending JSON reply, length 2915<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending reply, file = no<\n> HTTP connection accepted<\n> Sending G-Code reply to HTTP client 1 of 5 (length 844)<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { flags=d99fn }<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vn }<\n> Ran out of output buffers at ../src/Networking/HttpResponder.cpp(1112)<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending reply, file = no<\n> Sending G-Code reply to HTTP client 1 of 5 (length 4432)<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vn }<\n> Ran out of output buffers at ../src/Networking/HttpResponder.cpp(1112)<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending reply, file = no<\n> Sending G-Code reply to HTTP client 2 of 5 (length 4432)<\n> Ran out of output buffers at ../src/Networking/HttpResponder.cpp(1112)<\n> HTTP connection accepted<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending G-Code reply to HTTP client 3 of 5 (length 4432)<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending reply, file = no<\n> Sending G-Code reply to HTTP client 4 of 5 (length 4432)<\n> HTTP connection accepted<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending G-Code reply to HTTP client 5 of 5 (length 4432)<\n> Sending JSON reply, length 3119<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending reply, file = no<\n> HTTP connection accepted<\n> Sending JSON reply, length 2915<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key= flags=fvnd99a0 }<\n> HTTP connection accepted<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> HTTP connection accepted<\n> Sending JSON reply, length 3123<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=vnd2a0 }<\n> HTTP connection accepted<\n> Sending JSON reply, length 65<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=vnd2a12 }<\n> HTTP connection accepted<\n> Sending JSON reply, length 312<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=volumes flags=vnd2a0 }<\n> HTTP connection accepted<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vna12 }<\n> Sending JSON reply, length 66<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending reply, file = no<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vn }<\n> Sending JSON reply, length 3119<\n> HTTP connection accepted<\n> Sending JSON reply, length 308<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=volumes flags=d99vn }<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { flags=d99fn }<\n> Sending JSON reply, length 2914<\n> HTTP connection accepted<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> HTTP connection accepted<\n> Sending JSON reply, length 66<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vna12 }<\n> HTTP connection accepted<\n> Sending JSON reply, length 3119<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vn }<\n> HTTP connection accepted<\n> Sending JSON reply, length 12<\n> HTTP req, command words { GET /rr_gcode HTTP/1.1 }, parameters { gcode=M98 P"0:/macros/test-bufferoverflow4.g" }<\n> HTTP connection accepted<\n> Sending JSON reply, length 308<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=volumes flags=d99vn }<\n> HTTP connection accepted<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vna12 }<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending G-Code reply to HTTP client 1 of 5 (length 1688)<\n> HTTP connection accepted<\n> Sending JSON reply, length 12<\n> HTTP req, command words { GET /rr_gcode HTTP/1.1 }, parameters { gcode=M98 P"0:/macros/test-bufferoverflow4.g" }<\n> HTTP connection accepted<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key= flags=fvnd99a0 }<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { flags=d99fn }<\n> Ran out of output buffers at ../src/Networking/HttpResponder.cpp(1543)<\n> Sending JSON reply, length 2912<\n> Sending JSON reply, length 66<\n> Sending JSON reply, length 2918<\n> HTTP connection accepted<\n> Sending reply, file = no<\n> HTTP req, command words { GET /rr_reply HTTP/1.1 }, parameters { }<\n> Sending G-Code reply to HTTP client 1 of 5 (length 1266)<\n> HTTP connection accepted<\n> HTTP connection accepted<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=vnd2a0 }<\n> HTTP req, command words { GET /rr_model HTTP/1.1 }, parameters { key=inputs flags=d99vn }<\n> HTTP connection accepted<\n>
-
@timschneider Did you have a look at our latest firmware improvements? The culprit was the fact that
buffer->cat(reply);
could use up all available remaining buffers which has been changed. Hence I'm no fan of your extra check there. Even if it "overflows" in the latest build, there will be enough spare output buffers available to send out the G-code reply with an HTTP header to waiting clients, which was not the case before. -
@chrishamm
I used the code with your adjustments to the output buffer and tested it (https://github.com/Duet3D/RepRapFirmware/commit/ddfeb63af628e5c0c47979c96d97ecacdddebcfa). As I said, it works as long as only one client is connected. As soon as several clients are connected, the firmware can crash again.What happens more often, though, is that the output is corrupted, as shown above (stuffed with random data / truncated somewhere and so on).
I'm aware that the OutputBuffer and OutputStack code is quite complicated and complex and has many dependencies.
I suspect that the bug is related to the reference count, but I'm really not sure.The reference count is increased in SendGCodeReply if there is more than one client connected and only reduced when all clients requested the reply or a client timed out.
void HttpResponder::SendGCodeReply() noexcept { { // Do we need to keep the G-Code reply for other clients? bool clearReply = false; MutexLocker Lock(gcodeReplyMutex); if (!gcodeReply.IsEmpty()) { clientsServed++; if (clientsServed < numSessions) { // Yes - make sure the Network class doesn't discard its buffers yet // NB: This must happen here, because NetworkTransaction::Write() might already release OutputBuffers gcodeReply.IncreaseReferences(1); }
But with an increased reference count, no buffer is actual freed up, only the reference count is reduced.
/*static */ OutputBuffer *OutputBuffer::Release(OutputBuffer *buf) noexcept { TaskCriticalSectionLocker lock; OutputBuffer * const nextBuffer = buf->next; // If this one is reused by another piece of code, don't free it up if (buf->references > 1) { buf->references--; buf->bytesRead = 0; } else { // Otherwise prepend it to the list of free output buffers again buf->next = freeOutputBuffers; freeOutputBuffers = buf; usedOutputBuffers--; } return nextBuffer; }
If a large request follows an request with OutputBuffer with hadOverflow == true the request can cause problems as seen above. You have more insight and know the code in depth - maybe you have already a solution in mind. The reason why I use the large output, even if it looks constructed, is just to reproduce a situation where a high load is on the board, like printing a job with object labling and serving an large object model query. I think it's okay to fail in fulfilling the request, but not to lose the Wi-Fi connection or to re-establish the DWC connection.
-
@timschneider Separate to the discussion above about the buffers. Is there an straightforward way for us to reproduce the WIFI SPI timeout bug (that does not interact with these other issues preferably)?
Github issue form your report here:
https://github.com/Duet3D/WiFiSocketServerRTOS/issues/50 -
@T3P3Tony
the printer was just sit in idle (not printing - state busy) with a blocking message box up like 6-12h - but i'll see if I can find a reproducable way on how to get it timed out.The M122 bomb was one way to do it, but this will also interact with the buffers. Repeating a Gcode request very fast (even if it is a small one) was also able to trigger it (with more than one client connected).
I'll let you know.
-
@timschneider thanks!
-
@T3P3Tony @chrishamm @dc42
Hi Tony,
I think the bug is gone, to be honest.
I even deleted the overflow check as Chris suggested, and with the latest changes from Chris (OutputBuffer) and David (Stack of Main Task / M122) the bug is gone. I can construct a case where there is an SPI timeout – but that is far beyond normal use and a corner case. I tested it with this Git tag: https://github.com/Duet3D/RepRapFirmware/commit/4974c4cf3a4d1f1cd1fb1c28599e44ee2c412caaI think the bug was related to the bug in OutputBuffer and filled the stack over time, causing the SPI timeout error from the RRF side – not WIFI. Now that the behaviour has been improved, I can no longer realistically reproduce the bug.
Although a
M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122 M122
can still sometimes trigger the timeout. If in doubt, do it twice and the printer is gone, but as I said this is unrealistic.