Upload files using Marlin Binary File Transfer Mark II
Install via the bundled Plugin Manager or manually using this URL:
https://github.com/charleswillis3/OctoPrint-MarlinBft/archive/master.zip
This will transfer a file to a printer using Marlin firmware's experimental binary file transfer protocol.
- Marlin bugfix-2.0.x
- Enable BINARY_FILE_TRANSFER feature in Configuration_adv.h
- Ensure capability reporting is enabled
General use:
- Connect to the printer
- Click the Marlin BFT icon in the Nav bar to open the transfer dialog
- Click the gear icon to adjust the timeouts in the settings dialog
- Back in the transfer dialog, adjust the transfer settings "Reconnect" and "Send GCode after Transfer"
- Click the upload button to select the file. Transfer will start immediately
- The dialog will close automatically when the transfer and post-transfer phases are complete
Updating firmware on BigTreeTech boards:
- In settings:
- Ensure
bin
is in the "Accept file extensions" list - Set "Wait before reconnect" to a reasonable value like 12000 (12 seconds)
- Ensure
- In the transfer dialog:
- Enable "Send GCode after transfer" and set the Gcode to
M997
(marlin reset) - Click the upload button and select the
firmware.bin
file. Click OK. - After the M997 reset, reconnect the printer (or enable "Reconnect after transfer")
- Enable "Send GCode after transfer" and set the Gcode to
It's also possible to transfer a file using the http api.
- Upload the file to OctoPrint using the
files
api - Disconnect the printer using the
connection
api - POST a json object to the
marlinbft
api:
POST /api/plugin/marlinbft
Content-Type: application/json
X-Api-Key: abcdef...
Body:
{
"command": "start_transfer",
"handler_type": "api"
"port": "/dev/ttyACM0",
"baudrate": 250000,
"local_path": "marlinbft/firmware.bin",
"comm_timeout_ms": 1000,
"wait_after_connect_ms": 3000,
"post_transfer_gcode_enable": true,
"post_transfer_gcode": ["M997"]
}
The properties:
command
: required. must be the value "start_transfer"
api
: required. must be the value "api"
port
: required. the serial port the printer is connected on
baudrate
: required.
local_path
: required. the local path on the server to the uploaded file
comm_timeout_ms
: optional, settings override, int. the communication timeout
wait_after_connect_ms
: optional, settings override, int. if provided, how long to wait after establishing connection
post_transfer_gcode_enable
: optional, settings override, bool. whether to send gcode after the transfer completes
post_transfer_gcode
: optional, settings override, string array. the gcode to send
For settings override properties, if no value is provided the current configuration will be used.