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

    daemin.g not being updated

    Scheduled Pinned Locked Moved Solved
    General Discussion
    3
    7
    168
    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.
    • Tinchusundefined
      Tinchus
      last edited by

      Hello. due3 board, SBC mode with 3.5.4

      I have this on my daemon.g

      while global.daemonactive
      	if state.status != "processing"
      		if (heat.heaters[0].current > 60)
      			M42 P3 S1
      		else
      			M42 P3 S0
      	G4 S2
      

      I have this because in some situations I prefers to set the variable to false and so stop daemon from working instead of renaming the file. Not really much use. But today I edited daemon.g nd I just added an echo command. I saved the file. So I was expecting to see the echo command being executed and the result on the console. It never happened. I went crazu ike for 10 minutes trying to find a typo mistake, or something. The echo command was never being executed. I checked the global variable value and it was ok with a true value.

      The echo command was in the else section. The M42P3 S0 was being executed, I know that because that switch turns off and ON a led. If I manually executed the M42 P3 S1 command (with all heater off and coldf) I could see the led being turned on and after 2 secs daemon.g tuned it off. So daemon was working, the if sentence was ok. The echo command was just not being executed.

      Then without any modification I restarted the printer. And this time everything worked as expected. I sidenly started to get the echo command results on the console.

      So, It looks like the daemon.g is not being updated if you edit the file. Tjhe file is updated, but the daemon alredy on memory still is the old one?

      Im doing something wrong to update daemon.g? starting it and stopping it using the variable works ok

      chrishammundefined 1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators @Tinchus
        last edited by

        @Tinchus That's expected. When you upload a new daemon.g, the current daemon.g is moved to daemon.g.bak. My daemon.g looks like this so the new file is automatically restarted when needed:

        if fileexists("/sys/daemon.g.bak")
          M472 P"/sys/daemon.g.bak"
        
        while !fileexists("/sys/daemon.g.bak")
          ...
        

        Duet software engineer

        Tinchusundefined 1 Reply Last reply Reply Quote 1
        • Tinchusundefined
          Tinchus @chrishamm
          last edited by Tinchus

          @chrishamm Ok, thanks. Just to be clear for me: this means what if I modify daemon.g, the old file is moved to a .bak file, and that .bak file is still being executed untiil next restart. If I want the new daemin to be excuted, that .back file need to be deleted. It is like this how it works?

          If annswer is yes, I think it worth adding this info to documentation regarding daemon.g, I was really going crazy believing I did something wrong at my daemion.g editing LOL

          chrishammundefined 1 Reply Last reply Reply Quote 0
          • chrishammundefined
            chrishamm administrators @Tinchus
            last edited by chrishamm

            @Tinchus Yes, daemon.g is moved to daemon.g.bak in recent DWC versions. Hence my check above. @droftarts can you have a look at the docs please?

            Duet software engineer

            Tinchusundefined 1 Reply Last reply Reply Quote 0
            • Tinchusundefined
              Tinchus @chrishamm
              last edited by

              @chrishamm Then this is solved, thaks a lot for the help

              droftartsundefined 1 Reply Last reply Reply Quote 0
              • T3P3Tonyundefined T3P3Tony marked this topic as a question
              • T3P3Tonyundefined T3P3Tony has marked this topic as solved
              • droftartsundefined
                droftarts administrators @Tinchus
                last edited by

                @Tinchus @chrishamm I have updated the docs on daemon.g here, currently compiling some examples to add: https://docs.duet3d.com/en/User_manual/Tuning/Macros#daemong

                Ian

                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                Tinchusundefined 1 Reply Last reply Reply Quote 2
                • Tinchusundefined
                  Tinchus @droftarts
                  last edited by

                  @droftarts thanks a lot!

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA