Renaud11232 / OctoPrint-Marlin-Flasher

Arduino/Marlin firmware flasher for OctoPrint
MIT License
38 stars 10 forks source link

The error popup does not show enough information with platformio #76

Closed Renaud11232 closed 2 years ago

Renaud11232 commented 3 years ago

I'd suggest to add more helpful output to the popup in case the compilation or flashing fails. For example, I got the following popup which contains no information at all. Not even a hint, how to proceed to get more relevant information. marlin-flasher-error

When enabling the debug log as explained above, I got the following, which contains the actual problem (PlatformIO outdated).

Maybe it could help to show at least the first 100 lines of stdout in the error message popup when an error occurs (limited to a fixed value in order to prevent excessive memory usage during compilation)?

[...]
2021-05-25 16:42:25,421 - octoprint.plugins.marlin_flasher - INFO - Compiling...
2021-05-25 16:42:25,423 - octoprint.plugins.marlin_flasher - DEBUG - Executing command : /home/pi/.platformio/penv/bin/platformio run -d /home/pi/.octoprint/data/marlin_flasher/firmware_platformio/Marlin
2021-05-25 16:42:28,864 - octoprint.plugins.marlin_flasher - DEBUG - Return code : 1
2021-05-25 16:42:28,865 - octoprint.plugins.marlin_flasher - DEBUG - Standard output : Processing melzi (platform: atmelavr; board: sanguino_atmega1284p; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option

**************************************************
******      An update to PlatformIO is      ******
******  required to build Marlin Firmware.  ******
******                                      ******
******      Minimum version:  (5, 0, 3)     ******
******      Current Version:  (4, 3, 4)     ******
******                                      ******
******   Update PlatformIO and try again.   ******
**************************************************
2021-05-25 16:42:28,865 - octoprint.plugins.marlin_flasher - DEBUG - Error output : ========================== [FAILED] Took 1.85 seconds ==========================
Environment               Status    Duration
------------------------  --------  ------------
mega2560                  IGNORED
mega1280                  IGNORED
MightyBoard1280           IGNORED
[...]

Originally posted by @fritzw in https://github.com/Renaud11232/OctoPrint-Marlin-Flasher/issues/73#issuecomment-848619610