Coder Social home page Coder Social logo

Comments (5)

ofoxus avatar ofoxus commented on June 26, 2024 1

Update on this issue. I left my octoprint running for 2 days and the strangest things started to happen with my octoprint installation. My fix did work for me then, but it started acting weird today. My monkeypatched version started faulting in another area: the quotes passed to sarge weren't stripped in the call to octoprint/cli/analysis.py resulting in that module not finding the file anymore. I decided to wipe my installation and reinstall it again and now the old version without the quotes works too!

.metadata.json now
cat /octoprint/octoprint/uploads/.metadata.json
{
  "test2.gcode": {
    "hash": "8ff8f92aa165d8c7c3f52829db74d0810d86471e",
    "thumbnail": "plugin/prusaslicerthumbnails/thumbnail/test2.png?20240507190003",
    "thumbnail_src": "prusaslicerthumbnails",
    "analysis": {
      "printingArea": {
        "maxX": 162.985,
        "maxY": 184.212,
        "maxZ": 15.0,
        "minX": 0.0,
        "minY": -5.0,
        "minZ": 0.0
      },
      "dimensions": {
        "depth": 189.212,
        "height": 15.0,
        "width": 162.985
      },
      "travelArea": {
        "maxX": 200.0,
        "maxY": 220.0,
        "maxZ": 20.0,
        "minX": 0.0,
        "minY": -5.0,
        "minZ": 0.0
      },
      "travelDimensions": {
        "depth": 225.0,
        "height": 20.0,
        "width": 200.0
      },
      "estimatedPrintTime": 12142.82217389923,
      "filament": {
        "tool0": {
          "length": 9961.599939999678,
          "volume": 0.0
        }
      }
    },
    "dashboard": {
      "layer_move_array": "[8, 5921, 3672, 3754, 3856, 3890, 3914, 4328, 4685, 4206, 4386, 2217, 2229, 2220, 2235, 2250, 643, 656, 651, 647, 612, 639, 644, 665, 661, 869, 880, 890, 799, 801, 836, 761, 851, 865, 811, 591, 619, 612, 611, 611, 611, 612, 616, 635, 636, 647, 645, 655, 642, 645, 650, 507, 516, 499, 583, 588, 596, 575, 578, 588, 587, 607, 619, 667, 668, 461, 452, 413, 414, 411, 262, 259, 269, 266, 264, 261]",
      "filament_change_array": "[]"
    },
    "history": [
      {
        "timestamp": 1715108778.0424905,
        "success": false,
        "printerProfile": "_default"
      }
    ],
    "statistics": {
      "averagePrintTime": {},
      "lastPrintTime": {}
    }
  },
  "test2 - Copy.gcode": {
    "hash": "8ff8f92aa165d8c7c3f52829db74d0810d86471e",
    "thumbnail": "plugin/prusaslicerthumbnails/thumbnail/test2%20-%20Copy.png?20240507190018",
    "thumbnail_src": "prusaslicerthumbnails",
    "analysis": {
      "printingArea": {
        "maxX": 162.985,
        "maxY": 184.212,
        "maxZ": 15.0,
        "minX": 0.0,
        "minY": -5.0,
        "minZ": 0.0
      },
      "dimensions": {
        "depth": 189.212,
        "height": 15.0,
        "width": 162.985
      },
      "travelArea": {
        "maxX": 200.0,
        "maxY": 220.0,
        "maxZ": 20.0,
        "minX": 0.0,
        "minY": -5.0,
        "minZ": 0.0
      },
      "travelDimensions": {
        "depth": 225.0,
        "height": 20.0,
        "width": 200.0
      },
      "estimatedPrintTime": 12142.82217389923,
      "filament": {
        "tool0": {
          "length": 9961.599939999678,
          "volume": 0.0
        }
      }
    },
    "dashboard": {
      "layer_move_array": "[8, 5921, 3672, 3754, 3856, 3890, 3914, 4328, 4685, 4206, 4386, 2217, 2229, 2220, 2235, 2250, 643, 656, 651, 647, 612, 639, 644, 665, 661, 869, 880, 890, 799, 801, 836, 761, 851, 865, 811, 591, 619, 612, 611, 611, 611, 612, 616, 635, 636, 647, 645, 655, 642, 645, 650, 507, 516, 499, 583, 588, 596, 575, 578, 588, 587, 607, 619, 667, 668, 461, 452, 413, 414, 411, 262, 259, 269, 266, 264, 261]",
      "filament_change_array": "[]"
    }
  },
  "CFFFP_Art Palette.gcode": {
    "hash": "5dc1acc6868494dc97853b3d4c236412fdedac4a",
    "thumbnail": "plugin/prusaslicerthumbnails/thumbnail/CFFFP_Art%20Palette.png?20240507190624",
    "thumbnail_src": "prusaslicerthumbnails",
    "analysis": {
      "printingArea": {
        "maxX": 212.836,
        "maxY": 187.46,
        "maxZ": 4.8,
        "minX": 0.0,
        "minY": -5.0,
        "minZ": 0.0
      },
      "dimensions": {
        "depth": 192.46,
        "height": 4.8,
        "width": 212.836
      },
      "travelArea": {
        "maxX": 212.836,
        "maxY": 220.0,
        "maxZ": 10.0,
        "minX": 0.0,
        "minY": -5.0,
        "minZ": 0.0
      },
      "travelDimensions": {
        "depth": 225.0,
        "height": 10.0,
        "width": 212.836
      },
      "estimatedPrintTime": 27858.101268077822,
      "filament": {
        "tool0": {
          "length": 24140.12336000039,
          "volume": 0.0
        }
      }
    },
    "dashboard": {
      "layer_move_array": "[8, 2348, 2371, 2339, 2374, 2343, 2376, 4700, 8224, 7691, 7883, 8144, 8295, 5878, 5869, 5879, 5008, 6029, 6061, 6790, 6832, 6803, 6862, 7568, 7001]",
      "filament_change_array": "[]"
    }
  }
}

I am really confused by this, as the script is not runnable from the console by entering
/usr/local/bin/python -m octoprint analysis gcode --speed-x=15000 --speed-y=15000 --max-t=10 --throttle=0.0 --throttle-lines=100 --bed-z=0.0 /octoprint/octoprint/uploads/test whitespace.gcode and invoking it from a python script shouldn't differ in behavior.
I wouldn't mind replacing the command string passed to sarge by an arg array call to sarge.Command, just to be on the safe side.
As it only happened to me though, I would recommend reverting my PR for now and I will keep you updated on this if you don't mind.

from octoprint.

foosel avatar foosel commented on June 26, 2024

Thanks! Weird that this didn't show up so far... In any case, I have merged your fix (:+1:) and also backported it to staging/bugfix, so this will be fixed in 1.10.1.

from octoprint.

foosel avatar foosel commented on June 26, 2024

I also missed during review that this already was passing the command as an array. Note how it doesn't use ' '.join(command) for the actual sarge.run invocation, there it uses command, which is a full array.

I have no idea why it originally failed for you, but from the code it already did the right thing (and I have no clue why I missed that during the PR review - the past few weeks were a bit stressful however, so I'll chalk it up to that).

As it looks like there never was an actual bug here (at least not as far as we both can currently see), I'm closing this, but comments are still possible should you have any updates!

from octoprint.

ofoxus avatar ofoxus commented on June 26, 2024

Now that you say it, you are totally right and I am a complete fool. It is already being passed to sarge.run as an array. I am truly sorry!

I will keep a tighter watch on my installation the next time around, should I re-encounter it. It's just so strange and I wish I could roll back to before the re-installation to track down the real culprit. First the .metadata.json wasn't filled and afterwards the empty default set was always used.

from octoprint.

foosel avatar foosel commented on June 26, 2024

Don't worry about it, mistakes happen :)

from octoprint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.