Skip to content

Support Upload and Print feature on Creality K1  #2103

@victornpb

Description

@victornpb

I really want this feature on Orca slicer
image

I tried just setting up as a Octoprint/Klipper and giving it an IP, the device tab works but It doesn't understand the API.

What does the API normally looks like?

This is what uploading a gcode file on the web interface looks like:

It is just a POST on /upload/filename.gcode endpoint

curl 'http://192.168.0.104/upload/K1%20Exaust%20Fan%20Muffler%20(2)_PLA_1h45m.gcode' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en-US,en;q=0.9,pt;q=0.8' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7cSZUxfFJUfMXs3r' \
  -H 'Origin: http://192.168.0.104' \
  -H 'Referer: http://192.168.0.104/' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36' \
  --data-raw $'------WebKitFormBoundary7cSZUxfFJUfMXs3r\r\nContent-Disposition: form-data; name="file"; filename="K1 Exaust Fan Muffler (2)_PLA_1h45m.gcode"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n------WebKitFormBoundary7cSZUxfFJUfMXs3r--\r\n' \
  --compressed \
  --insecure

Starting a print is done via websocket, this is where the ws is

curl 'ws://192.168.0.104:9999/' \
  -H 'Pragma: no-cache' \
  -H 'Origin: http://192.168.0.104' \
  -H 'Accept-Language: en-US,en;q=0.9,pt;q=0.8' \
  -H 'Sec-WebSocket-Key: hujCwV9dGN8BJF+uYwObAg==' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36' \
  -H 'Upgrade: websocket' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: Upgrade' \
  -H 'Sec-WebSocket-Version: 13' \
  -H 'Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits' \
  --compressed

And this is the actual message:

  {"method":"set","params":{"opGcodeFile":"printprt:/usr/data/printer_data/gcodes/K1 Exaust Fan Muffler (2)_PLA_1h45m.gcode"}}
image

Does this looks like something that could be easily implemented? If you need more details on anything including running tests I'll be happy to help

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions