Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. cnc65
    3. Best
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 16
    • Best 1
    • Controversial 0
    • Groups 0

    Best posts made by cnc65

    • RE: Gcode upload with python and OpenAPI

      @chrishamm @T3P3Tony
      I have changed the requestBody in the OpenAPI.yaml file so that a parameter body is generated in Python. This works for uploading gcode files. I have not tested other files.

      requestBody:
      	required: true
      	description: 'File content'
      		content:
      			application/octet-stream:
      			schema:
      				type: string
      				format: binary
      

      The function call in Python then looks like this:

      # Upload a file
      file = "f:/temp/test.g"
      name = "0:/gcodes/test-1.g"
      try:
          body = open(file).read()
          duet_response = api_instance.rr_upload_post(body, name)
      except ApiException as e:
          print("Exception when calling DefaultApi->rr_upload_post: %s\n" % e)
      
      posted in Third-party software
      cnc65undefined
      cnc65