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

    Possible bug with `fileinfo` command in SBC mode

    Scheduled Pinned Locked Moved
    Duet Web Control
    5
    8
    403
    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.
    • adammhaileundefined
      adammhaile
      last edited by dc42

      I'm working on a git-like interface to pull/push/sync files between Duet and a local folder - everything worked well on DWC 3.1 but I'm running into a weird issue on 3.2 and 3.3 when trying to query the file info for non-gcode files.

      For example:

      http://<printer_ip>/machine/fileinfo/sys/heightmap.csv

      Results in:

      CodeParserException in GetFileInfo: Failed to parse major M-code number (ap) in line 1

      Now, I realize that heightmap.csv was moved in later RRF and this file isn't used anymore but I see no reason why it should give a gcode parse error when trying to query the file info.

      This also happens with filaments.csv and I tested with files with other names - it seems something specific to the content of filaments/heightmap.csv as it only seemed to fail if I copied those contents into the test files... such as:

      RepRapFirmware height map file v2 generated at 2021-07-13 16:12
      xmin,xmax,ymin,ymax,radius,xspacing,yspacing,xnum,ynum
      30.00,280.00,66.00,300.00,-1.00,125.00,117.00,3,3
       -0.005,  0.099, -0.035
       -0.051,  0.061, -0.029
       -0.057,  0.046, -0.030
      

      But still - see no reason why it would care what the file contents is. I assume it's trying to parse the layer information (since that shows up in the normal output) but could it not ignore this if the file isn't a .g/.gcode file at least?

      I can work around it for now by just deleting those files as they aren't needed anymore - but that's a weird thing to tell users of the tool I'm writing and I'll probably also have to code around it.

      dc42undefined Nurgelrotundefined chrishammundefined 4 Replies Last reply Reply Quote 0
      • Sindariusundefined
        Sindarius
        last edited by Sindarius

        I’ll need to double check but what I remember offhand is the fileinfo call is designed to parse the gcode contents to get info such as size, layer height, etc. you’re making a call that is trying to fetch gcode metadata essentially so the error makes sense.

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

          @adammhaile I edited the title of your post to make is clear that this only affects SBC mode. I will alert @chrishamm.

          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

          1 Reply Last reply Reply Quote 0
          • Nurgelrotundefined
            Nurgelrot @adammhaile
            last edited by Nurgelrot

            @adammhaile Not really helping you current issue but have you considered other ways to do this rather than going through http? I'm basically backup all my printers "sd card" files with a simple rsync script. Since the SBC is gateway to a UNIX file-system why not use it?

            I set up the ssh key from my fileserver to the printers and run a job through cron. My stuff all dumps onto a ZFS volume on my fileserver so I even get version control since snapshots are turned on for that filesystem.

            I'm sure there are a ton of utilities you could use to do the same thing with Windows (powershell could do 90% of it alone I think). And MacOS is of course just wrapped up pretty UNIX tools... so no issues there.

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

              @adammhaile fileinfo calls are not meant to be used for non-Gcode files. To get the size, change date etc. it's better to use directory queries.

              I'll check again what RRF does when non-Gcode files are queried and adjust the DSF response if necessary.

              Duet software engineer

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

                I can confirm RRF only parses filenames ending with .gcode, .g, .gco, and .gc. I'll change DSF to do the same.

                Duet software engineer

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

                  @chrishamm we should probably include .nc files too.

                  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

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

                    @dc42 Yes, good idea.

                    Duet software engineer

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