Skip to content

Using a user-defined Python version for systems with other Python versions active #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MartyMacGyver opened this issue Jan 14, 2017 · 8 comments

Comments

@MartyMacGyver
Copy link
Contributor

If your default python is not 2.7, you run into trouble pretty quickly (while I have 2.7 installed my default is 3.6).

I found that platform.txt can be changed to allow easier setting of the Python executables. While it's not very extensible (given the inelegant way Arduino parses its settings) it allows the user to manually configure things to suit their dev environment. To that end, I moved the following settings to near the top of the file, e.g. (for my installation):

name=ESP32 Arduino
version=0.0.1

tools.esptool.cmd=python27
tools.esptool.cmd.windows=C:\Python27\python.exe
tools.esptool.network_cmd=python27
tools.esptool.network_cmd.windows=C:\Python27\python.exe
compiler.python.cmd=python27
compiler.python.cmd.windows=C:\Python27\python.exe

....

It would be far better to have two new vars (one for Unix, one for Windows) that the others reference but... that's not something Arduino seems to allow.

Whether this file is reordered as above or not, it'd be useful to let people know about this in the documentation (and that the editing must be done with Arduino closed - some of these specific vars can change on the fly, but some of them will not). It's pretty easy and effective - I was up and running in no time once I hardcoded the Windows vars as above (Unix ones updated for illustration).

Thoughts?

@me-no-dev
Copy link
Member

this have been an issue for quite some time :) PATH and many things are different while Arduino is compiling and that caused me so much headbanging over the years :)
I can move the definitions towards the top :) though very few people look at the configuration files (or so I think)

@MartyMacGyver
Copy link
Contributor Author

Thank you! Whether or not you move the defs (though I think it's easier to group them this way), updating the docs to mention this is the key. I'm probably not the only person who will be using this in a more complex dev environment (nor is it always desirable to make Python 2.7 the default for a whole system), and had this been called out I'd have known to edit each cmd for Unix, and each cmd.windows for Windows, for all the ones listed above. Given how fragile Arduino seems to be in these ways, a little direction will go a very long way.

(Would that one could simply have a new menu item where one could simply change the appropriate persistent values in a dialog, but that appears to be beyond the scope of the Arduino framework.)

@projectgus
Copy link
Contributor

projectgus commented Jan 16, 2017

FWIW, the latest esptool.py (in latest esp-idf) supports Python 2.7 & 3.x, so some of this problem can be avoided by upgrading esptool.py. However there's till the problem of needing pyserial installed in that particular Python environment.

@MartyMacGyver
Copy link
Contributor Author

I'm curious what the story is on pyserial. Is there some known issue with it in 3.x?

@me-no-dev
Copy link
Member

There is one single definition for esptool on top of platform.txt now and Windows uses binary form of get.py and esptool.py, so Python and pip no longer matter if you are not using IDF.
I think this issue can be closed :)

@MartyMacGyver
Copy link
Contributor Author

MartyMacGyver commented Jan 22, 2017

It's working a lot better now thanks to the executable versions of get and esptool! No manual config needed. From that perspective, we can close this.

Further notes:

I noticed that the compiler is a minor bump up from the ones on Espressif's site and in the MSYS2 bundle currently.

Also, the following process works and is a bit simpler and saved installing and configuring the full Windows git:

# Install Arduino as normal

# Install MSYS2 from Espressif (just download and extract to C:\ so you get C:\msys32)

# From the MSYS2 shell:
cd /c/Users/$USER/Documents/Arduino/hardware/espressif  # $USER is automatically set in MSYS2
git clone https://github.com/espressif/arduino-esp32.git esp32  # If initializing
cd esp32
git pull  # If updating arduino-esp32
cd tools
./get

# Then proceed with adding the board in Arduino and building normally

One other note: while this seems to work great for ESP32-DevKitC (though you usually have to use the BOOT button on the board), the ESP-WROVER-KIT can be tricky (you never need to use the BOOT button, but it always ends up stuck in download mode the moment you open the serial monitor... not sure why. It takes several tries to get serial comms actually working normally.)

I'm mentioning that for discussion (as @projectgus is on the thread too) - curious if there's any workarounds on either board for those issues.

@me-no-dev
Copy link
Member

@MartyMacGyver when you say that given board is not properly reset, please specify how you are running things :) Are you compiling/uploading through Arduino IDE, or through IDF or Eclipse, so on :) It matters.
I use both boards and have 0 issues resetting or flashing (on a Mac).

@MartyMacGyver
Copy link
Contributor Author

Perhaps this is better discussed on the forum if it's not something obvious - I noted it here because users of this would be more likely to notice the difference when the IDE fails to upload and might be more likely to use serial at all.

It's in Windows, as noted above. Just considering the Arduino 1.8.1 IDE / putty, the Core Board v2 and the ESP-WROVER-KIT act differently upon serial disconnect, and from what I can tell the Core board V2 will never take a flash unless you press the BOOT button. However, when you connect to it via the serial monitor or putty, it doesn't reset into download mode (which is good), while the ESP-WROVER-KIT will sometimes do so.

As I've got a lot more data than this on it now, I'll open a topic on the ESP32 forum for further discussion soon. Right now I'm not seeing an obvious workaround that prevents the board from resetting on serial disconnect.

Jason2866 added a commit to Jason2866/arduino-esp32 that referenced this issue Apr 19, 2022
* Tasmota changes (espressif#123)

* Initial S3 Support

Just so we can compile and test! Some things might/will not work. SPI and UART baud detect need to be looked at.

* Add S3 Toolchain

* Update Esptool and add some missing adjustments

* Add Dual-Core Support

* Fix bootloop issue and enable DSP optimization

* Run Arduino on Core1

* Rework USB selection

* Update HWCDC.cpp

* Update USB.cpp

* Update esp32-hal-tinyusb.c

* fix S3 flash image base (espressif#6208)

* Added my new Unexpected Maker ESP32-S3 boards (espressif#6211)

* Fixes UART_1 TX Pin setup

When passing the PR to this branch, it seems that the change to this line was forgotten.

* Initial SPI support and S3-Box variant

* Bootloader is at 0x0000 for S3 (espressif#6215)

* small adjustments for NVS and PSRAM init

* WIP: Initial support for PSRAM (QSPI and OPI)

* [FEATURE] Basic implementation of Arduino's I2S library (espressif#5304)

Basic version of Arduino's I2S library. We currently support only 16bps + 16000 Hz sampling frequency. Other bitrates and sample rates will print warning and continue to operate, however the resulting audio quality may be poor.
There will be further effort to fix these issues.

* [I2S] Fix lib-builder error

* Update idf_component.yml (espressif#6232)

took me a while

* Fixes RMT examples and adds ESP32-S3 config (espressif#6235)

* WIP: Initial OPI support

* Update Libs with the new lib-builder scripts

* Update board menu for ESP32-S3

* fix ethernet clock runtime setting (espressif#6340)

this was not possible anymore since the GPIO refactoring.

This superseeds espressif/esp32-arduino-lib-builder#60
(which works only for clock on GPIO17). A PR will provided to revert this.
@me-no-dev fyi

The fix is done from @arendst Credits go to him!

* Update IDF libs and fix missing BLE 4.2 features

* Update CI scripts

* script fixes

* Add guard to USB examples

* Disable some examples for ESP32-S3

* skip one more sketch and try again PIO

* Fox SPI example and add proper esptool for PIO CI

* Update ResetReason.ino

* Update IDF, Add ESP-SR and RainMaker

* Enable RainMaker on all chips

* Enable hardware test on ESP32-S3

* Adjust build dir for tests and sketches

* Update tests_build.sh

* Send event also if tests fail

* Add helper script for updating the core version

* [Docs] Added/Updated Lib builder docs (espressif#6401)

* [Docs] Added/Updated Lib builder docs

* [Docs] Fixes according to the PR review

* [Docs] Fixes according to the PR review

* SD_MMC: add ESP32-S3 support

* CmakeList + Rainmaker src files edit

* remove Rainmaker

* Tasmota change

* Fix Unicore WDT on HTTP OTA update

* Revert "ESP32-S3 SDMMC support" (#20)

* Fix reboot into download from TinyUSB on ESP32-S3

Requires manual reboot back into the new firmware after flashing has finished

* Fix psram crash pico d4 (espressif#110)

* Fix reboot into download from TinyUSB on ESP32-S3 (espressif#111)

Requires manual reboot back into the new firmware after flashing has finished

Co-authored-by: me-no-dev <hristo@espressif.com>

* Revert "Fix psram crash pico d4 (espressif#110)" (espressif#113)

This reverts commit 56cf555.

* Fix boot freeze when trying to init PSRAM on Pico D4

* revert tinyusb

* hal/usb_serial_jtag_ll.h only C3, H2, S3

* Fix sd mmc

* add wpa_supplicant as requirement

* Update platform.txt

* remove Rainmaker

* Update boards.txt

* Update HardwareSerial.h

* Update USBCDC.cpp

* Update esptool.py

* Update platformio-build-esp32.py

* Update platformio-build-esp32c3.py

* Update platformio-build-esp32s2.py

* Update platformio-build-esp32s3.py

* fix merge errors

* Reordering - HardwareSerial Constructor

* Update platformio-build-esp32.py

* Update platformio-build-esp32c3.py

* Update platformio-build-esp32s2.py

* Update platformio-build-esp32s3.py

* Update pins_arduino.h

* Update platformio-build-esp32.py

* Update platformio-build-esp32c3.py

* Update platformio-build-esp32s2.py

* Update platformio-build-esp32s3.py

Co-authored-by: me-no-dev <hristo@espressif.com>
Co-authored-by: Unexpected Maker <seon@unexpectedmaker.com>
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com>
Co-authored-by: Ivan Grokhotkov <ivan@espressif.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* Bugfix fs read+speed improvements (espressif#127)

* Revert "Edited VFSFileImpl::read to use both read/fread (espressif#6456)"

This reverts commit 7b89b39.

* Added default file buffer size + function to change it by user

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

Co-authored-by: me-no-dev <hristo@espressif.com>
Co-authored-by: Unexpected Maker <seon@unexpectedmaker.com>
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com>
Co-authored-by: Ivan Grokhotkov <ivan@espressif.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
brentru added a commit to adafruit/arduino-esp32 that referenced this issue Oct 22, 2024

Unverified

No user is associated with the committer email.
fix uf2 board id for samd51 boards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants