building with vs code/ atom error

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

building with vs code/ atom error

#1 Post by LaurB » 05 Feb 2021, 11:52

Hey,
I'm trying to flash an ESP32-CAM. At first I have tried with the ESP.Easy.Flasher.exe but it didn't work. So I installed VS Code and Platformio.
I opened the source in the download zip as the project folder, then opened ESPEasy.ino in the src folder and hit build. A huge error message came up.

After that I downloaded the esp8266 release, the same message.
Installed atom and platformio, again the same result.

I have python 3.9.1 installed. Ardunio ide is installed with both esp8266 and esp32 added to board manager. Operating system is windows 10.

I'm totally lost here. Any clue?

Code: Select all

Processing custom_ESP8266_4M1M (platform: espressif8266@2.6.2; board: esp12e; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Tool Manager: Installing git+https://github.com/esp8266/Arduino.git#2.7.4
Error: Traceback (most recent call last):
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\__main__.py", line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "c:\users\laurn\.platformio\penv\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\commands\__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\laurn\.platformio\penv\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\click\decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\commands\run\command.py", line 143, in cli
    is_test_running,
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\commands\run\command.py", line 175, in process_env
    result = {"env": name, "duration": time(), "succeeded": ep.process()}
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\commands\run\processor.py", line 79, in process
    result = p.run(build_vars, build_targets, self.silent, self.verbose, self.jobs)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\platform\_run.py", line 60, in run
    self.autoinstall_runtime_packages()
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\platform\_packages.py", line 74, in autoinstall_runtime_packages
    self.pm.install(self.get_package_spec(name))
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 49, in install
    spec, silent=silent, skip_dependencies=skip_dependencies, force=force
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 97, in _install
    pkg = self.install_from_url(spec.url, spec, silent=silent)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 141, in install_from_url
    vcs = VCSClientFactory.new(tmp_dir, url)
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 55, in new
    src_dir, remote_url, tag, silent
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 137, in __init__
    self.configure()
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 146, in configure
    result = proc.exec_command([cls.command, "--exec-path"])
  File "c:\users\laurn\.platformio\penv\lib\site-packages\platformio\proc.py", line 117, in exec_command
    p = subprocess.Popen(*args, **kwargs)
  File "C:\Users\laurn\.platformio\python3\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\laurn\.platformio\python3\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#2 Post by TD-er » 05 Feb 2021, 12:14

Can you check the steps I mentioned here: https://youtu.be/ArqwMcYSMsU

One of the things which are easy to overlook is the need for a Git client to be installed on your system.
See also: https://espeasy.readthedocs.io/en/lates ... requisites

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#3 Post by LaurB » 05 Feb 2021, 12:32

Lol, I feel so stupid. Of course git wasn't installed.

Thanks!

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: building with vs code/ atom error

#4 Post by martinus » 05 Feb 2021, 14:32

LaurB wrote: 05 Feb 2021, 12:32 Lol, I feel so stupid. Of course git wasn't installed.

Thanks!
Same happened to me. Followed more generic instructions that could build regular ESP projects but not ESPEasy.

Would be more user friendly if the IDE would be able to say something like "git client not installed" instead of spitting out lots of hard to understand errors.
I don't know if the platformIO can do such a prerequisite check?

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#5 Post by TD-er » 05 Feb 2021, 15:32

PlatformIO can run some Python code, so maybe I can make a Python check for it and give a more proper error message.

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#6 Post by LaurB » 05 Feb 2021, 16:30

It's there something different with ESP32?
I can build and flash esp8266 without any problems but I can't manage to run espeasy on esp32.

The module restarts continuous after flashing.

Code: Select all

INIT : Booting version:  (ESP32 SDK v3.2.3-14-gd3e562907)
38 : Info   : INIT : Free RAM:295048
38 : Info   : INIT : Cold Boot - Restart Reason: CPU0: Software reset CPU CPU1: Software reset CPU
39 : Info   : FS   : Mounting...
83 : Info   : CRC  : SecuritySettings CRC   ...OK
87 : Info   : WIFI ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
�U37 : Info   : 

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#7 Post by TD-er » 05 Feb 2021, 16:33

What happens if you flash a nightly build on the unit?
What plugins do you have enabled in your build config?

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#8 Post by LaurB » 05 Feb 2021, 16:52

I used ESPEasy_ESP32_mega-20210114.zip
I'm not very good at this so I will attach a picture.
Capture.PNG
Capture.PNG (59.72 KiB) Viewed 9828 times
I did it in the following order:
1. Clean
2. Build
3. Upload and monitor

I don't want to modify anything, I just want to flash an esp32. I use a few esp8266 and I wanted to do some tests with an esp32.

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#9 Post by TD-er » 05 Feb 2021, 16:55

Does your ESP32 have an ethernet connector?
If not, then you should use a PIO env without "eth" in the name.

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#10 Post by LaurB » 05 Feb 2021, 17:10

Same result with normal_ESP32_4M316k
The module is like this, but with an antenna attached.
Capture1.PNG
Capture1.PNG (467.86 KiB) Viewed 9823 times

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#11 Post by TD-er » 05 Feb 2021, 18:19

Hmm you're the second one to report issues with one of those "ESP32S" modules.

When you said you used the "ESPEasy_ESP32_mega-20210114.zip"
Did you flash the pre-compiled binaries, or used the source code to build a version on your own?

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#12 Post by LaurB » 05 Feb 2021, 18:52

At first I used the flasher tool from the zip file and it didn't worked.
So I thought that the flasher tool is not ok for esp32s. So I installed vs code and set the project folder as the source folder.
Unfortunately this is my only esp32, so I can't try on another module.
Capture2.PNG
Capture2.PNG (23.52 KiB) Viewed 9803 times

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#13 Post by TD-er » 05 Feb 2021, 20:06

I should remove that flasher from the ESP32 ZIP as it does indeed not work on ESP32.

For ESP32 you should use Espressif's flasher, which is described here: https://espeasy.readthedocs.io/en/lates ... html#esp32
It is also included in the ZIP

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#14 Post by LaurB » 05 Feb 2021, 21:21

It's just not working.

I used the Espressif flasher and normal_ESP32_4M316k binary with/without _factory and with/without _ETH from 2020-12-27 and 2021-01-14. The same error and restarting:

Code: Select all


INIT : Booting version:  (ESP32 SDK v3.2.3-14-gd3e562907)
37 : Info   : INIT : Free RAM:291228
37 : Info   : INIT : Cold Boot - Restart Reason: CPU0: Software reset CPU CPU1: Software reset CPU
38 : Info   : FS   : Mounting...
81 : Info   : CRC  : SecuritySettings CRC   ...OK 
85 : Info   : Wets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
⸮U36 : Info   : 
I give up.

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#15 Post by TD-er » 05 Feb 2021, 22:36

When flashing via serial you need the "factory" image (as is also explained in the readme)
But I guess you already saw that when flashing the non-factory image that it would not show any logs.

I really don't know what may be causing the crashes you see there.
Does the flasher give any hints or indication on the size of the flash?

Can you try to flash a "blank" bin file (to completely clear the flash) and try again with the image you mentioned?
Or maybe the last build of 2020?

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#16 Post by LaurB » 05 Feb 2021, 23:03

I said I give up but I didn't.
This module is just unbelievable. I tried to upload the web camera example and this is wot I got:

Code: Select all

Brownout detector was triggered

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
I measured the voltage across the power pins and it was stable at 4.96V. I even added a 4700uF capacitor.

User avatar
Ath
Normal user
Posts: 3506
Joined: 10 Jun 2018, 12:06
Location: NL

Re: building with vs code/ atom error

#17 Post by Ath » 05 Feb 2021, 23:07

I think the 3.3V level is more interesting, but 4.95 isn't really high for the 5V input, would expect the ESP will be much more happy with 5.1V.
/Ton (PayPal.me)

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#18 Post by LaurB » 05 Feb 2021, 23:11

I measured the voltage across the voltage regulator and it fluctuates at 3.0-3.2V

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#19 Post by TD-er » 05 Feb 2021, 23:23

I think if you would sample at a higher sample rate you would see much lower dips on the 3v3 line.

Can you add a capacitor (22 - 100 uF) over 3v3 and GND?
Maybe also add a smaller one as close as possible to the 3v3 and GND.

I guess the used SOT23 form factor voltage regulator is one that's really underpowered (much less than 500 mA)
Although on the photo you showed there seems to be an AMS1117 present, but I see that on a lot of boards the trusty AMS1117 is being replaced by a much smaller SOT23 form factor unit often only capable of handling a peak of 150 mA

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#20 Post by LaurB » 05 Feb 2021, 23:41

And success:

Code: Select all

INIT : Booting version:  (ESP32 SDK v3.2.3-14-gd3e562907)
54 : Info   : INIT : Free RAM:291660
54 : Info   : INIT : Cold Boot - Restart Reason: CPU0: Vbat power on reset CPU1: for APP CPU, reseted by PRO CPU
55 : Info   : FS   : Mounting...
98 : Info   : CRC  : SecuritySettings CRC   ...OK 
102 : Info   : WIFI  : Start network scan
2719 : Info   : INIT : Free RAM:231856
2720 : Info   : INIT : I2C
2721 : Info   : INIT : SPI not enabled
2822 : Info   : INFO : Plugins: 47 [Normal] (ESP32 SDK v3.2.3-14-gd3e562907)
2827 : Info   : Webserver: start
2828 : Info   : WIFI : Starting mDNS...
2829 : Info   : WIFI : mDNS started, with name: espressif.local
2834 : Info   : OTA  : Arduino OTA enabled on port 3232
2848 : Info   : WIFI  : Scan finished, found: 8
2855 : Error  : WIFI : No valid wifi settings
2955 : Info   : WIFI : Set WiFi to AP+STA
3792 : Info   : WIFI : AP Mode ssid will be ESP-Easy with address 192.168.4.1
3793 : Error  : WIFI : Could not prepare WiFi!
4185 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 211836 WiFiStatus WL_DISCONNECTED ESPeasy internal wifi status: DISCONNECTED
34191 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 212028 WiFiStatus WL_DISCONNECTED ESPeasy internal wifi status: DISCONNECTED
I ended up powering the module with 9V, which is not ok because after a minute or so the power regulator gets really hot. The voltage on the AMS1117 output is 3.28V. The current, measured on the 9V side, is 130-160mA.

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#21 Post by TD-er » 06 Feb 2021, 00:22

OK, so we know the voltage regulator of the ESP is maybe not a low-drop type and thus getting unstable if the voltage on the 5V drops?
Maybe the used (USB) cable is too thin, thus causing voltage drops when the current increases.
Not sure if something is also powered via the 5V. If so, then I guess you may have damaged it now.

LaurB
Normal user
Posts: 33
Joined: 05 Aug 2019, 13:22

Re: building with vs code/ atom error

#22 Post by LaurB » 06 Feb 2021, 12:50

AMS1117 should be a low dropout regulator, at least according to the datasheet.
At first I powered the module from USB, but after that I switched to a 5V, 500mA power source.
From googleing I found out that this module has some sort of low voltage protection that is very sensible. The low voltage protection is needed to protect the sd card. When the wifi is starting there is a spike in the power consumption and then the protection kicks in, that's way the constant restarts.
I managed to run espeasy by soldering a 47uF capacitor on the power regulator 3.3V output. Now I can power the module from USB.
20210206_132134.jpg
20210206_132134.jpg (133.44 KiB) Viewed 9716 times

TD-er
Core team member
Posts: 8746
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: building with vs code/ atom error

#23 Post by TD-er » 07 Feb 2021, 00:16

Ah great!
Good to know you managed to get it running.

The ESP32 does indeed have a brown-out detection circuit, but to be honest, that wasn't the first one I was thinking about.
Maybe I should look into the boot reasons to perhaps disable starting WiFi to give proper error messages.

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests