[esptool] How to add the stub_flasher json files with pyinstaller on MacOS
Posted: Thu Jan 04, 2024 12:24 pm
Hi,
We have written a PyQt5 GUI which uses esptool to upload firmware binaries onto ESP32: https://github.com/sparkfun/SparkFun_RT ... e_Uploader
I am updating it to use esptool 4.7.0: https://github.com/sparkfun/SparkFun_RT ... ree/v1.6.0 . It took me a while to work out that I needed to include the targets/stub_flasher json files for it to work correctly. I now have it working correctly on Windows and Linux. But I can not get it working on MacOS.
I am using GitHub Actions and pyinstaller to build the executables. I am using pip install esptool to install esptool before I call pyinstaller.
On Windows, here is where I add the json files and create the executable: https://github.com/sparkfun/SparkFun_RT ... ml#L42-L46
On Linux: https://github.com/sparkfun/SparkFun_RT ... ml#L41-L43
On MacOS, I do the same thing: https://github.com/sparkfun/SparkFun_RT ... ml#L42-L47
The GUI installs and runs OK on MacOS, but the esptool upload fails because it can not find the stub_flasher json file. The json files are copied into Contents/Resources (Contents/Resources/esptool/targets/stub_flasher). But the executable is in Contents/MacOS and it can not find the json files.
I tried copying the json files into Contents/MacOS (Contents/MacOS/esptool/targets/stub_flasher). But the executable was then "illegal" and would not run - I think because the json files are not signed?
I hope someone can tell me how to add the json files correctly on MacOS.
Thank you,
Paul
We have written a PyQt5 GUI which uses esptool to upload firmware binaries onto ESP32: https://github.com/sparkfun/SparkFun_RT ... e_Uploader
I am updating it to use esptool 4.7.0: https://github.com/sparkfun/SparkFun_RT ... ree/v1.6.0 . It took me a while to work out that I needed to include the targets/stub_flasher json files for it to work correctly. I now have it working correctly on Windows and Linux. But I can not get it working on MacOS.
I am using GitHub Actions and pyinstaller to build the executables. I am using pip install esptool to install esptool before I call pyinstaller.
On Windows, here is where I add the json files and create the executable: https://github.com/sparkfun/SparkFun_RT ... ml#L42-L46
On Linux: https://github.com/sparkfun/SparkFun_RT ... ml#L41-L43
On MacOS, I do the same thing: https://github.com/sparkfun/SparkFun_RT ... ml#L42-L47
The GUI installs and runs OK on MacOS, but the esptool upload fails because it can not find the stub_flasher json file. The json files are copied into Contents/Resources (Contents/Resources/esptool/targets/stub_flasher). But the executable is in Contents/MacOS and it can not find the json files.
I tried copying the json files into Contents/MacOS (Contents/MacOS/esptool/targets/stub_flasher). But the executable was then "illegal" and would not run - I think because the json files are not signed?
I hope someone can tell me how to add the json files correctly on MacOS.
Thank you,
Paul