please check/fix my daemon.g, it seems to cause software reset
-
Hi all,
I've recently played around with using the daemon.g file to change the LED colors of my Voron Stealthburner print head, in order to use it as a status light. This seems to work nicely, however I've had software resets that occur after x amount of uptime, or print time specifically. I could link it to the daemon.g by deleting its content for another 10+ hours print job which came out perfectly.
See my M122 below, the reason for last software reset was "GCodes spinning" and while diagnosing it, using daemon.g like below, it seemed like the "never used RAM" steadily declined. I can't really recreate it or show screenshots though unfortunately.
Please someone with more of an idea about what's happening here please check if there are any bad errors in my amateur programming that could lead to the problem. Thank you!
best, Niklas
m122 === Diagnostics === RepRapFirmware for Duet 3 Mini 5+ version 3.4.1 (2022-06-01 21:06:56) running on Duet 3 Mini5plus WiFi (SBC mode) Board ID: Y86Q1-L296U-D65J0-40KMN-3D03Z-HP6Y0 Used output buffers: 1 of 40 (12 max) === RTOS === Static ram: 103684 Dynamic ram: 99340 of which 16 recycled Never used RAM 35144, free system stack 132 words Tasks: SBC(ready,2.8%,452) HEAT(notifyWait,0.0%,342) Move(notifyWait,0.0%,268) CanReceiv(notifyWait,0.0%,772) CanSender(notifyWait,0.0%,356) CanClock(delaying,0.0%,351) TMC(notifyWait,1.2%,79) MAIN(running,95.1%,484) IDLE(ready,0.1%,29) AIN(delaying,0.8%,264), total 100.0% Owned mutexes: HTTP(MAIN) === Platform === Last reset 00:39:19 ago, cause: power up Last software reset at 2023-01-12 20:14, reason: OutOfMemory, GCodes spinning, available RAM 728, slot 1 Software reset code 0x41c3 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0047d000 BFAR 0xe000ed38 SP 0x20030910 Task SBC Freestk 679 ok Stack: 200318bc 0001d079 00000000 20031bd8 20002f9c 00010233 0000000a 20030950 20030958 00010385 20030be3 00000065 20030958 20030a40 20030ccc 00058147 20030958 00000065 636f7270 69737365 8000676e 47c0cd80 41200000 200323c1 0000000b 0008f541 00000001 Error status: 0x00 MCU revision 3, ADC conversions started 2359863, completed 2359862, timed out 0, errs 0 Step timer max interval 1480 MCU temperature: min 18.5, current 33.0, max 33.0 Supply voltage: min 24.0, current 24.1, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 99/7, heap memory allocated/used/recyclable 2048/122/0, gc cycles 0 Events: 0 queued, 0 completed Driver 0: standstill, SG min 0, read errors 0, write errors 0, ifcnt 15, reads 17889, writes 15, timeouts 0, DMA errors 0, CC errors 0 Driver 1: standstill, SG min 0, read errors 0, write errors 0, ifcnt 15, reads 17889, writes 15, timeouts 0, DMA errors 0, CC errors 0 Driver 2: standstill, SG min 0, read errors 0, write errors 0, ifcnt 15, reads 17888, writes 15, timeouts 0, DMA errors 0, CC errors 0 Driver 3: standstill, SG min 0, read errors 0, write errors 0, ifcnt 15, reads 17888, writes 15, timeouts 0, DMA errors 0, CC errors 0 Driver 4: standstill, SG min 0, read errors 0, write errors 0, ifcnt 9, reads 17895, writes 9, timeouts 0, DMA errors 0, CC errors 0 Driver 5: standstill, SG min 0, read errors 0, write errors 0, ifcnt 25, reads 17878, writes 25, timeouts 0, DMA errors 0, CC errors 0 Driver 6: standstill, SG min 0, read errors 0, write errors 0, ifcnt 25, reads 17878, writes 25, timeouts 0, DMA errors 0, CC errors 0 Date/time: 2023-01-29 10:26:18 Cache data hit count 4294967295 Slowest loop: 52.10ms; fastest: 0.08ms === Storage === Free file entries: 10 SD card 0 not detected, interface speed: 0.0MBytes/sec SD card longest read time 0.0ms, write time 0.0ms, max retries 0 === Move === DMs created 83, segments created 28, maxWait 2319917ms, bed compensation in use: none, comp offset 0.000 === MainDDARing === Scheduled moves 19, completed 19, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === AuxDDARing === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 Heater 0 is on, I-accum = 0.1 === GCodes === Segments left: 0 Movement lock held by null HTTP* is doing "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 SBC is idle in state(s) 0 Daemon is idle in state(s) 0 Aux2 is idle in state(s) 0 Autopause is idle in state(s) 0 Code queue is empty === CAN === Messages queued 21210, received 47046, lost 0, boc 0 Longest wait 3ms for reply type 6053, peak Tx sync delay 267, free buffers 18 (min 17), ts 11800/11799/0 Tx timeouts 0,0,0,0,0,0 === SBC interface === Transfer state: 5, failed transfers: 0, checksum errors: 0 RX/TX seq numbers: 27184/27184 SPI underruns 0, overruns 0 State: 5, disconnects: 0, timeouts: 0 total, 0 by SBC, IAP RAM available 0x0f1ec Buffer RX/TX: 0/0-0, open files: 0 === Duet Control Server === Duet Control Server v3.4.1 Code buffer space: 4096 Configured SPI speed: 8000000Hz, TfrRdy pin glitches: 0 Full transfers per second: 0.07, max time between full transfers: 199.6ms, max pin wait times: 55.4ms/2.2ms Codes per second: 0.00 Maximum length of RX/TX data transfers: 3856/804
the daemon.g in question:
; daemon.g to set status & nozzle light ; by Niklas Eutebach, created 06.11.2022 ; query machine's status to determine status LED color if {state.status} == "idle" ; setting the status LED to a nice green when the machine is idle set global.statusLEDR = 0 set global.statusLEDU = 255 set global.statusLEDB = 16 elif {state.status} == "processing" ; setting the status LED to a piercing purple when processing, i.e. running a print job set global.statusLEDR = 255 set global.statusLEDU = 0 set global.statusLEDB = 255 elif {state.status} == "busy" ; setting the status LED to a piercing purple when processing, i.e. running a print job set global.statusLEDR = 0 set global.statusLEDU = 255 set global.statusLEDB = 255 elif {state.status} == "pausing" || {state.status} == "paused" || {state.status} == "resuming" ; setting the status LED to yellow during any kind of paused status set global.statusLEDR = 255 set global.statusLEDU = 255 set global.statusLEDB = 0 elif {state.status} == "cancelling" ; setting the status LED to dark orange when cancelling a print job or emergency stopping the machine set global.statusLEDR = 255 set global.statusLEDU = 16 set global.statusLEDB = 0 ; query nozzleLight variable to determine nozzle Light brightness (off/on, might add intermediates later) if global.nozzleLight set global.nozzleLightBrightness = 255 else set global.nozzleLightBrightness = 0 M150 R{global.statusLEDR} U{global.statusLEDU} B{global.statusLEDB} S1 P{global.statusLEDBrightness} F1 M150 R255 U255 B255 S2 P{global.nozzleLightBrightness} F0
excerpt from config.g (the last lines):
; Miscellaneous M150 X1 ; initialise Neopixel LEDs M912 P0 S-1.3 ; calibrate MCU temperature M955 P121.0 I46 ; define accelerometer on toolboard 121.0, orientation i-4-6 ( M593 P"zvdd" F33 ; activate input shaping M501 ; load saved parameters from non-volatile memory m98 p"scripts/variables.g" ; create variables saved in script
the "variables.g" file that is called in config.g:
global zProbeIsPickedUp=false global nozzleLight=false global statusLEDR=0 global statusLEDU=0 global statusLEDB=0 global statusLEDBrightness=255 global nozzleLightBrightness=0
-
@sonderzug said in please check/fix my daemon.g, it seems to cause software reset:
reason: OutOfMemory,
Your last reset was actually out of memory. I don't see anything obviously wrong with your gcode. It is probably worth updating to the latest version 3.4.5 (you are currently running 3.4.1) to see if that resolves the issue.