OctoPrint / OctoPrint-FirmwareUpdater

OctoPrint plugin for flashing pre-compiled firmware images to a 3D printer.
https://plugins.octoprint.org/plugins/firmwareupdater/
GNU Affero General Public License v3.0
351 stars 76 forks source link

{disableverify} does not get replaced by space or -v if it is the last thing on the command line #351

Closed cdsmith69 closed 2 months ago

cdsmith69 commented 1 year ago

The {disableverify} parameter should be replaced by either -v or by a space, depending on the check box for "Disable write verification." But if it is the last thing on the command line the text {disableverify} is left unchanged in the command line that is called.

I believe this may be because of the trailing spaces in the replace commands in bossac.py:

if bossac_disableverify:
    bossac_command = bossac_command.replace(" {disableverify} ", " ")
else:
    bossac_command = bossac_command.replace(" {disableverify} ", " -v ")

If {disableverify} is the last thing on the command line the trailing space does not exist and the replace doesn't happen.

The context here is that I have a device that requires a more complicated flashing process than just one call to bossac, so I thought I would just put a shell script on the Raspberry Pi called proflash.sh that does the multiple steps I need, and run that script with the command line /home/pi/proflash.sh {bossac} {port} {firmware} {disableverify} instead of the usual bossac command line. But my script was getting "{disableverify}" instead of a space or -v. Flipping the order to /home/pi/proflash.sh {bossac} {port} {disableverify} {firmware} fixes the issue and the script gets the proper space or -v in place of {disableverify}.

benlye commented 1 year ago

Good catch, I'll take care of it.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any recent activity. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed in 5 days.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any recent activity. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed in 5 days.

bhuliu commented 2 months ago

Good catch!!! ——————————————————

benlye commented 2 months ago

Resolved in 1.14.1

github-actions[bot] commented 1 month ago

This issue has been automatically locked because there was no further activity after it was closed. Please open a new issue for any related problems.