Author Topic: V2 PC Connectivity  (Read 618 times)

uniquesounds

  • Newbie
  • *
  • Posts: 5
    • View Profile
V2 PC Connectivity
« on: July 19, 2021, 08:42:36 AM »
Am I correct in thinking that the only way to either modify the settings for the Gecho V2 (ie config.txt file) or for updating its firmware (via my own custom code) is through the SD card and that the USB connection does not yet work?

mario

  • Administrator
  • Full Member
  • *****
  • Posts: 185
    • View Profile
Re: V2 PC Connectivity
« Reply #1 on: July 20, 2021, 02:01:01 PM »
Updating the Flash memory where config, firmware and background samples are stored can be done over the USB too, and is perhaps a lot handier. It requires a python script, which is part of the official IDE - you can find more info here.

Depending on what edition of v2 you have, you may or may not need to install drivers. Units with serial number below 1000 use FTDI chip and no drivers are needed, units above 1000 use CH340G and may need drivers (e.g. in Windows), here the same applies as for the v1 Gecho (but the app is not compatible).

If you need any help or advice I'm here 8)

uniquesounds

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: V2 PC Connectivity
« Reply #2 on: July 31, 2021, 08:59:32 AM »
Thanks Mario - apologies for the slow reply to your reply - I do not have a lot of time these days unfortunately but I definitely want get to program the Gecho, small slow steps and at first they may be quite slow ;)

I used to be a proper programmer  (started in micro controllers OMG 30 years ago then into stuff like C and Delphi (lovely language) but gradually went down the corporate line.... not exactly sure what I want to do with this thing but first I think will be to work on the  UI - things like the key combinations of RST-B1 and so on driving me nuts (since RST turns the program off if you don't get the exact timing), starting programs with line input mode too.

Anyhow I will continue to get the tool chain up and going so I can start to program it via USB.

I am right that if I totally brick it it is restorable just using the service menu B3 ?

uniquesounds

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: V2 PC Connectivity
« Reply #3 on: August 01, 2021, 11:08:30 PM »
environment is windows pc - trying to run the target 'flash'  (gecho not connected but would expect compile first then some kind of timeout)
getting the following issues (after quite some setting up of environment variables, installing gnu make , cygwin and so on :)  plus some mods the the subprocess.py to make shell=True

any ideas?

23:03:25 **** Build of configuration Default for project whale-v150 ****
python C:/bin/esp-idf-v4.0.3/tools/windows/eclipse_make.py flash
/bin/esp-idf-v4.0.3/make/project_config.mk:125: *** multiple target patterns.  Stop.
Running make in 'C:/project/gecho/git/Glo_v1'
Traceback (most recent call last):
  File "C:\bin\esp-idf-v4.0.3\tools\windows\eclipse_make.py", line 43, in <module>
    main()
  File "C:\bin\esp-idf-v4.0.3\tools\windows\eclipse_make.py", line 37, in main
    line = re.sub(UNIX_PATH_RE, lambda m: check_path(m.group(0)), line)
  File "C:\Users\steve\AppData\Local\Programs\Python\Python39\lib\re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: cannot use a string pattern on a bytes-like object
"python C:/bin/esp-idf-v4.0.3/tools/windows/eclipse_make.py flash" terminated with exit code 1. Build might be incomplete.

mario

  • Administrator
  • Full Member
  • *****
  • Posts: 185
    • View Profile
Re: V2 PC Connectivity
« Reply #4 on: August 03, 2021, 10:18:19 AM »
That's cool :) Yes I remember Delphi, or earlier Pascal in DOS which was the first language we used at school.

Quote
things like the key combinations of RST-B1 and so on driving me nuts (since RST turns the program off if you don't get the exact timing)

Yes that's an unfortunate combination, I've put it only for presumably less important / less often required settings, which one in particular do you use more often? It could be changed everywhere to more handy way where SET invokes a sub-menu, just like it's in the Dekrispator.

Quote
starting programs with line input mode too

At some point this setting was remembered in Flash, but I've been receiving a mail a day about "my microphones do not work anymore". :D But makes sense to allow it again, maybe add an option somewhere in config file if it should be remembered - the same with all input levels, for example when using Gecho + T-ape it's quite annoying to have to set them every time as the signal from T-ape is too strong.

Quote
I am right that if I totally brick it it is restorable just using the service menu B3 ?

There is only one binary handling everything so if it is missing or corrupted then it can't restore its own backup or flash an update from SD, you'd need to use USB to restore it.

Quote
trying to run the target 'flash'  (gecho not connected but would expect compile first then some kind of timeout)

That's correct expectation, but it looks your IDE does not issue the build command, just tries to flash the result? make flash is the last step, for the compile / build to happen you first need to run something like this:

Code: [Select]
python C:/bin/esp-idf-v4.0.3/tools/windows/eclipse_make.py -j6 all
If you press Ctrl+B it should rebuilt all that's necessary, I don't use IDE to flash it as it will flash bootloader + partitions + code every time, and possibly at the wrong address, so instead I just do this in a separate MinGW window:

Code: [Select]
python C:/path/to/esptool/esptool.py --chip esp32 --port COM2 --baud 1500000 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0x30000 C:/path/to/workspace/whale-v150/build/app-template.bin
Of course you could also modify the settings in IDE to match these parameters.

uniquesounds

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: V2 PC Connectivity
« Reply #5 on: August 05, 2021, 11:02:54 AM »
Quote
things like the key combinations of RST-B1 and so on driving me nuts (since RST turns the program off if you don't get the exact timing)

Yes that's an unfortunate combination, I've put it only for presumably less important / less often required settings, which one in particular do you use more often?

Delay persistence on the loopers, so you can fade out a pattern and introduce a new one - Nils Frahm'ish kind of use  which is one reason I was looking to use line input .....
So something set "Set 1" to put it into 'tape mode' buttons 1 and 2 speeding up slowing down, buttons 3 and 4 adjusting the persistence

Quote
At some point this setting was remembered in Flash, but I've been receiving a mail a day about "my microphones do not work anymore". :D But makes sense to allow it again

That is a tricky one because sometimes you want mics sometimes you want line input and at least the Gecho remembers for the session -  I think the idea of a 'power user' config that can be saved in the config.txt file but doesn't have a button option should go someway to give users the option but the type of user that mails 'the microphones no longer work' would probably not be the sort to use that.

For my part once I get the build working I think the first thing I will do is just to create alternate versions  of the programmes that initialize with line input :)



I will try the build suggestions over the weekend. Thanks for getting back.

uniquesounds

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: V2 PC Connectivity
« Reply #6 on: August 06, 2021, 09:33:41 PM »
I tried the build all command getting the following .... not really so sure how to fix this tbh (python version  3.9.6

Would I be better off using my Apple Mac to do this build and so on with rather than the PC I am using at the moment?

Python /bin/esp-idf-v4.0.3/tools/windows/eclipse_make.py -j6 all

Running make in 'C:\project\gecho\git\Glo_v1'
process_begin: CreateProcess(NULL, cygpath -m /bin/esp-idf-v4.0.3/components/app_trace/Kconfig /bin/esp-idf-v4.0.3/components/bt/Kconfig /bin/esp-idf-v4.0.3/components/driver/Kconfig /bin/esp-idf-v4.0.3/components/efuse/Kconfig /bin/esp-idf-v4.0.3/components/esp-tls/Kconfig /bin/esp-idf-v4.0.3/components/esp32/Kconfig /bin/esp-idf-v4.0.3/components/esp_adc_cal/Kconfig /bin/esp-idf-v4.0.3/components/esp_common/Kconfig /bin/esp-idf-v4.0.3/components/esp_eth/Kconfig /bin/esp-idf-v4.0.3/components/esp_event/Kconfig /bin/esp-idf-v4.0.3/components/esp_gdbstub/Kconfig /bin/esp-idf-v4.0.3/components/esp_http_client/Kconfig /bin/esp-idf-v4.0.3/components/esp_http_server/Kconfig /bin/esp-idf-v4.0.3/components/esp_https_ota/Kconfig /bin/esp-idf-v4.0.3/components/esp_https_server/Kconfig /bin/esp-idf-v4.0.3/components/esp_wifi/Kconfig /bin/esp-idf-v4.0.3/components/espcoredump/Kconfig /bin/esp-idf-v4.0.3/components/fatfs/Kconfig /bin/esp-idf-v4.0.3/components/freemodbus/Kconfig /bin/esp-idf-v4.0.3/components/freertos/Kconfig /bin/esp-idf-v4.0.3/components/heap/Kconfig /bin/esp-idf-v4.0.3/components/libsodium/Kconfig /bin/esp-idf-v4.0.3/components/log/Kconfig /bin/esp-idf-v4.0.3/components/lwip/Kconfig /bin/esp-idf-v4.0.3/components/mbedtls/Kconfig /bin/esp-idf-v4.0.3/components/mdns/Kconfig /bin/esp-idf-v4.0.3/components/mqtt/Kconfig /bin/esp-idf-v4.0.3/components/newlib/Kconfig /bin/esp-idf-v4.0.3/components/nvs_flash/Kconfig /bin/esp-idf-v4.0.3/components/openssl/Kconfig /bin/esp-idf-v4.0.3/components/pthread/Kconfig /bin/esp-idf-v4.0.3/components/spi_flash/Kconfig /bin/esp-idf-v4.0.3/components/spiffs/Kconfig /bin/esp-idf-v4.0.3/components/tcpip_adapter/Kconfig /bin/esp-idf-v4.0.3/components/unity/Kconfig /bin/esp-idf-v4.0.3/components/vfs/Kconfig /bin/esp-idf-v4.0.3/components/wear_levelling/Kconfig /bin/esp-idf-v4.0.3/components/wifi_provisioning/Kconfig /bin/esp-idf-v4.0.3/components/wpa_supplicant/Kconfig, ...) failed.
process_begin: CreateProcess(NULL, cygpath -m /bin/esp-idf-v4.0.3/components/app_update/Kconfig.projbuild /bin/esp-idf-v4.0.3/components/bootloader/Kconfig.projbuild /bin/esp-idf-v4.0.3/components/esptool_py/Kconfig.projbuild /bin/esp-idf-v4.0.3/components/partition_table/Kconfig.projbuild, ...) failed.
process_begin: CreateProcess(NULL, cygpath -m /bin/esp-idf-v4.0.3/components/app_trace/sdkconfig.rename /bin/esp-idf-v4.0.3/components/bootloader/sdkconfig.rename /bin/esp-idf-v4.0.3/components/bt/sdkconfig.rename /bin/esp-idf-v4.0.3/components/driver/sdkconfig.rename /bin/esp-idf-v4.0.3/components/esp32/sdkconfig.rename /bin/esp-idf-v4.0.3/components/esp_common/sdkconfig.rename /bin/esp-idf-v4.0.3/components/esp_event/sdkconfig.rename /bin/esp-idf-v4.0.3/components/esp_wifi/sdkconfig.rename /bin/esp-idf-v4.0.3/components/esptool_py/sdkconfig.rename /bin/esp-idf-v4.0.3/components/freemodbus/sdkconfig.rename /bin/esp-idf-v4.0.3/components/freertos/sdkconfig.rename /bin/esp-idf-v4.0.3/components/lwip/sdkconfig.rename /bin/esp-idf-v4.0.3/components/pthread/sdkconfig.rename /bin/esp-idf-v4.0.3/components/spi_flash/sdkconfig.rename /bin/esp-idf-v4.0.3/components/tcpip_adapter/sdkconfig.rename /bin/esp-idf-v4.0.3/components/vfs/sdkconfig.rename, ...) failed.
/bin/esp-idf-v4.0.3/make/project_config.mk:125: *** multiple target patterns.  Stop.
Traceback (most recent call last):
  File "C:\bin\esp-idf-v4.0.3\tools\windows\eclipse_make.py", line 43, in <module>
    main()
  File "C:\bin\esp-idf-v4.0.3\tools\windows\eclipse_make.py", line 37, in main
    line = re.sub(UNIX_PATH_RE, lambda m: check_path(m.group(0)), line)
  File "C:\Users\steve\AppData\Local\Programs\Python\Python39\lib\re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: cannot use a string pattern on a bytes-like object

mario

  • Administrator
  • Full Member
  • *****
  • Posts: 185
    • View Profile
Re: V2 PC Connectivity
« Reply #7 on: August 07, 2021, 08:16:12 AM »
The problem is probably with "multiple target patterns". If you google that error message you get many examples what to try. Maybe it is incorrectly set path to the IDE: https://github.com/espressif/esp-va-sdk/issues/46#issuecomment-496440042

Quote
Would I be better off using my Apple Mac to do this build and so on with rather than the PC I am using at the moment?

I don't know much about Mac, Espressif have a good forum where you can ask all questions: https://www.esp32.com/ and there is setup guide available too: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/macos-setup.html

But personally I believe that if you stick to PC it will be easier simply because more people use the ESP-IDF on PC and there is more advice available online.