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

    M118 Error logging?

    Scheduled Pinned Locked Moved Solved
    Duet Web Control wishlist
    3
    9
    412
    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.
    • oozeBotundefined
      oozeBot
      last edited by

      I'm trying to produce error logging within DWC using M118 but don't see an option for it. Is there not an option for it? If not, could it be added? Thanks

      1 Reply Last reply Reply Quote 0
      • oozeBotundefined oozeBot marked this topic as a question
      • oozeBotundefined
        oozeBot
        last edited by

        @chrishamm - any insight on this?

        1 Reply Last reply Reply Quote 0
        • oozeBotundefined
          oozeBot
          last edited by

          I guess there are currently no options for this.. we have found several use cases for manually logging errors and would like to see this added.

          @Phaedrux - would you mind moving this thread to the wishlist category?

          T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
          • Phaedruxundefined Phaedrux moved this topic from Duet Web Control
          • T3P3Tonyundefined
            T3P3Tony administrators @oozeBot
            last edited by

            @oozebot sorry for the delay in replying @chrishamm and I have been away at Formnext.

            If i understand this correctly you would like to use an M118 command to generate a DWC message that shows up as an "error" or "warning" and currently that show up as "info"? This is sperate from saving a M118 output to the log file (which is supported already by RRF).

            www.duet3d.com

            oozeBotundefined 1 Reply Last reply Reply Quote 0
            • oozeBotundefined
              oozeBot @T3P3Tony
              last edited by oozeBot

              @t3p3tony Yes - we want to programmatically be able to display and log error messages from the SBC. Specifically, the red messages that do not automatically close unless toggled from within DWC.

              One example stems from the other thread about reporting actual voltage on the 5v rail. Recently, the 5v power supply on one of our original prototypes began having issues where the RPi was being throttled and we had no idea. Our simple solution was a CRON job every 10 minutes to poll the power state of the RPi, based on the following.

              /usr/bin/vcgencmd get_throttled
              0          1    Under-voltage detected
              1          2    Arm frequency capped
              2          4    Currently throttled
              3          8    Soft temperature limit active
              16     10000    Under-voltage has occurred
              17     20000    Arm frequency capping has occurred
              18     40000    Throttling has occurred
              19     80000    Soft temperature limit has occurred
              A value of 0x50000 (16+18) means from the boot moment up to now Under-Voltage has occurred.
              

              And then push the results (if non-zero) to DSF like the following. However, there is currently no "L" option for Error logging.

              echo m118 P0 S\"Error! Under-voltage detected on the SBC!\" L2 | sudo /opt/dsf/bin/CodeConsole
              

              Thanks!

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

                @oozebot For external programs a DSF plugin or a script that uses the proper DSF API would be better. It allows you to send custom messages as well (including error messages), see https://duet3d.github.io/DuetSoftwareFramework/api/DuetAPI.Commands.WriteMessage.html#properties

                Unfortunately M118 cannot be used to generate error-type messages.

                Duet software engineer

                oozeBotundefined 1 Reply Last reply Reply Quote 0
                • oozeBotundefined
                  oozeBot @chrishamm
                  last edited by

                  @chrishamm Thanks. I was hoping it would be as simple as adding "L4" as a parameter.

                  Lnnn Log level of this message (0 = do not log this line, 1 = log as WARN, 2 = log as INFO, 3 = log as DEBUG (default)) (RRF >= 3.2.0-beta3)
                  

                  The API is interesting. Any examples calling it from Bash? 🙂

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

                    @oozebot I don't think there is a bash API client yet but you could use the Python one from https://github.com/Duet3D/dsf-python

                    Duet software engineer

                    1 Reply Last reply Reply Quote 0
                    • oozeBotundefined
                      oozeBot
                      last edited by

                      I'm marking this as solved. We were able to accomplish what we wanted through dsf-python as @chrishamm suggested.

                      For posterity, see this thread: https://forum.duet3d.com/topic/26090/dsf-python-script-to-monitor-sbc-and-log-results-through-dsf

                      1 Reply Last reply Reply Quote 2
                      • oozeBotundefined oozeBot has marked this topic as solved
                      • First post
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA