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.
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
[...]
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.
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)?
Originally posted by @fritzw in https://github.com/Renaud11232/OctoPrint-Marlin-Flasher/issues/73#issuecomment-848619610