Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    [3.5.0-rc1] daemon.g keeps running after renaming

    Scheduled Pinned Locked Moved Solved
    Beta Firmware
    2
    4
    190
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • nikschaundefined
      nikscha
      last edited by nikscha

      Hi all,

      my daemon.g looks like this:

      while true          
          G4 P2000
          echo "test"
      

      when remaning it to daemon1.g it keeps running:
      9ab107bb-79f3-425d-a569-a4a034e6d1c8-image.png

      changing daemon1.g to

      while true             
          G4 P2000
          echo "test2"
      

      yields

      431c16e6-413e-4428-92b2-b9a006dc02e2-image.png

      Stay in school

      nikschaundefined 1 Reply Last reply Reply Quote 0
      • nikschaundefined
        nikscha @nikscha
        last edited by

        @nikscha

        === Diagnostics ===
        RepRapFirmware for Duet 3 MB6HC version 3.5.0-rc.1 (2023-08-31 16:19:24) running on Duet 3 MB6HC v1.01 (SBC mode)
        Board ID: 08DJM-9P63L-DJ3S0-7J1F8-3S86T-TBJZ8
        Used output buffers: 1 of 40 (22 max)
        === RTOS ===
        Static ram: 154852
        Dynamic ram: 90516 of which 1452 recycled
        Never used RAM 92980, free system stack 122 words
        Tasks: SBC(2,ready,1.1%,422) HEAT(3,nWait,0.0%,323) Move(4,nWait,0.4%,214) CanReceiv(6,nWait,0.1%,771) CanSender(5,nWait,0.0%,328) CanClock(7,delaying,0.0%,349) TMC(4,nWait,8.5%,59) MAIN(2,running,89.8%,137) IDLE(0,ready,0.1%,30), total 100.0%
        Owned mutexes: HTTP(MAIN)
        === Platform ===
        Last reset 01:10:35 ago, cause: power up
        Last software reset at 2023-10-16 15:38, reason: User, Expansion spinning, available RAM 92980, slot 0
        Software reset code 0x6012 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0043c000 BFAR 0x00000000 SP 0x00000000 Task SBC Freestk 0 n/a
        Error status: 0x00
        Aux0 errors 0,0,0
        MCU temperature: min 20.1, current 38.5, max 38.9
        Supply voltage: min 24.0, current 24.1, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes
        12V rail voltage: min 12.0, current 12.1, max 12.1, under voltage events: 0
        Heap OK, handles allocated/used 99/15, heap memory allocated/used/recyclable 2048/1572/1248, gc cycles 1
        Events: 0 queued, 0 completed
        Driver 0: standstill, SG min 0, mspos 120, reads 42313, writes 51 timeouts 0
        Driver 1: standstill, SG min 0, mspos 408, reads 42313, writes 51 timeouts 0
        Driver 2: standstill, SG min n/a, mspos 8, reads 42348, writes 16 timeouts 0
        Driver 3: standstill, SG min n/a, mspos 8, reads 42348, writes 16 timeouts 0
        Driver 4: standstill, SG min n/a, mspos 8, reads 42353, writes 11 timeouts 0
        Driver 5: standstill, SG min 0, mspos 856, reads 42321, writes 43 timeouts 0
        Date/time: 2023-10-18 10:41:22
        Slowest loop: 67.45ms; fastest: 0.05ms
        === Storage ===
        Free file entries: 20
        SD card 0 not detected, interface speed: 37.5MBytes/sec
        SD card longest read time 0.0ms, write time 0.0ms, max retries 0
        === Move ===
        DMs created 125, segments created 39, maxWait 701455ms, bed compensation in use: mesh, height map offset -0.016, ebfmin 0.00, ebfmax 0.00
        no step interrupt scheduled
        Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0
        === DDARing 0 ===
        Scheduled moves 29069, completed 29069, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 84], CDDA state -1
        === DDARing 1 ===
        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 -1 -1 -1 -1 -1 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0
        Heater 0 is on, I-accum = 0.1
        Heater 4 is on, I-accum = 0.2
        === GCodes ===
        Movement locks held by null, 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 0, running macro
        Aux2 is idle in state(s) 0
        Autopause is idle in state(s) 0
        File2* is idle in state(s) 0
        Queue2 is idle in state(s) 0
        Q0 segments left 0, axes/extruders owned 0x10000003
        Code queue 0 is empty
        Q1 segments left 0, axes/extruders owned 0x0000000
        Code queue 1 is empty
        === CAN ===
        Messages queued 93461, received 237613, lost 0, boc 0
        Longest wait 56ms for reply type 6041, peak Tx sync delay 536, free buffers 50 (min 49), ts 21178/21177/0
        Tx timeouts 0,0,0,0,0,0
        === SBC interface ===
        Transfer state: 5, failed transfers: 0, checksum errors: 0
        RX/TX seq numbers: 36389/36389
        SPI underruns 0, overruns 0
        State: 5, disconnects: 0, timeouts: 0 total, 0 by SBC, IAP RAM available 0x25a98
        Buffer RX/TX: 0/0-0, open files: 0
        === Duet Control Server ===
        Duet Control Server version 3.5.0-rc.1 (2023-09-01 07:16:31)
        Daemon:
        >> Doing macro daemon.g, started by system
        Code buffer space: 4096
        Configured SPI speed: 8000000Hz, TfrRdy pin glitches: 1
        Full transfers per second: 1.54, max time between full transfers: 83.9ms, max pin wait times: 67.7ms/8.5ms
        Codes per second: 0.84
        Maximum length of RX/TX data transfers: 5684/2152
        

        Stay in school

        dc42undefined 1 Reply Last reply Reply Quote 0
        • dc42undefined
          dc42 administrators @nikscha
          last edited by

          @nikscha yes it will keep running until the file terminates. In your case it never will because of the "while true" loop.

          The usual solution is to use a global variable to control it:

          if !exists(global.runDaemon)
            global runDaemon=true
          while global.runDaemon
            ...
          

          Then you can send set global.runDaemon=false from the console to stop the daemon.

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          nikschaundefined 1 Reply Last reply Reply Quote 1
          • nikschaundefined
            nikscha @dc42
            last edited by nikscha

            @dc42 I see, I expected the file to be "reloaded" after saving and then not being found afterwards because of the renaming. Thank you for the solution!

            Stay in school

            1 Reply Last reply Reply Quote 0
            • nikschaundefined nikscha marked this topic as a question
            • nikschaundefined nikscha has marked this topic as solved
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA