Skip to content
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

PlatformIO UPLOAD button does only build, but no upload to device #47

Closed
beegee-tokyo opened this issue Sep 22, 2017 · 13 comments
Closed

Comments

@beegee-tokyo
Copy link

beegee-tokyo commented Sep 22, 2017

Environment:

PlatformIO
Version Home 0.3.0·Core 3.5.0a15

Plattform:
Espressif32 Version 0.10.0
Espressif32_stage Version bcfaefd

Framework:
Arduino

How to recreate

Any ESP32 project (or example) will show the problem.
Select project
Press UPLOAD button (or select from Menu PlatformIO->Upload
==> Build starts
==> After build is finished nothing else happens, last message is:

Calculating size .pioenvs\esp32dev\firmware.elf
text       data     bss     dec     hex filename
415909    72348   27160  515417   7dd59 .pioenvs\esp32dev\firmware.elf
 [SUCCESS] Took 2.70 seconds

#Workaround
Open PlatformIO terminal and enter
platformio run --target upload
to build and upload

Additional info

When building for ESP8266 or Arduino Uno the behavior of PlatformIO UPLOAD button is as expected.

@YannikW
Copy link

YannikW commented Nov 1, 2017

I notices the same problem with ESP8266.

Try to add tagets = upload to you projects platformio.ini, this works for me.

image

@beegee-tokyo
Copy link
Author

@YannikW thanks for the tip, that works. But now all buttons try to upload. so not the final solution

@ivankravets
Copy link
Member

What is your OS? Atom or VSCode?

@ivankravets
Copy link
Member

If Atom, please open PlatformIO IDE Settings and Check “Use Development version of IDE”. Please wait for a while. Restart.

@beegee-tokyo
Copy link
Author

@ivankravets
I switched to development version of IDE. After a while I got a message to restart PlatformIO.
After restart I created a new project outside of the default location.
Now pushing "CLEAN" gives me error:

PlatformIO: Failed to run a command: clean
Please make sure that "build" package is installed and activated.

Pushing "UPLOAD" gives me error:

PlatformIO: Failed to run a command: upload
Please make sure that "build" package is installed and activated.

Pushing "BUILD" gives me error :

PlatformIO: Failed to run a command: build
Please make sure that "build" package is installed and activated. 

Existing projects still works.
Creating new project in default folder still works.

Maybe I am doing something wrong. My usual steps:

  1. Create empty directory in my project directory (which is e.g. B:\Projects\ESP32\Test)
  2. From PlatformIO Home select New Project
  3. Select board Espressif ESP32 Dev Module
  4. Select Framework Arduino
  5. Uncheck Location: O Use default location
  6. Navigate to B:\Projects\ESP32\Test in the folder structure shown
  7. Select folder Test
  8. Click Finish and wait for message from PlatformIO

What I am doing right now to get around this problem is to create a project in the default project folder. Then I copy the folder that PlatformIO created to my prefered location and rename the folder to the prefered project name.
Then I add the folder manually with File->Add Project Folder. By doing this the buttons work as they should.
I tried to compare the project folder in the default location and the newly created one in my folder and cannot see any difference.

@ivankravets
Copy link
Member

ivankravets commented Nov 2, 2017

Please open PIO IDE Terminal and type pio upgrade, should be PIO Core 3.5.0b1.

Now, close all projects in Atom (right click, remove from TreeView). Also, remove %HOME_DIR%/.platformio/homestate.json file. Restart IDE.

Now all should work. Please confirm.

@beegee-tokyo
Copy link
Author

Tried to pio upgrade. First error message:

PS C:\Users\beegee> pio upgrade
Updating tool-pioplus                    @ 0.10.11        [0.10.13]
Uninstalling tool-pioplus @ 0.10.11:    Please manually remove file `C:\SPB_Data\.platformio\packages\tool-pioplu
s\pioplus.exe`
Error: Traceback (most recent call last):
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\__main__.py", line 120, in main
    cli(None, None, None)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\click\core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\click\core.py", line 680, in main
    rv = self.invoke(ctx)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\click\core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "c:\users\beegee\.platformio\penv\lib\site-packages\click\core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\commands\upgrade.py", line 28, in cli
    update_core_packages(silent=True)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\managers\core.py", line 91, in update_core_
packages
    pm.update(name, requirements, only_check=only_check)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\managers\core.py", line 53, in update
    result = PackageManager.update(self, *args, **kwargs)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 732, in update
    self.uninstall(pkg_dir, trigger_event=False)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 673, in uninstal
l
    util.rmtree_(pkg_dir)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\util.py", line 638, in rmtree_
    return rmtree(path, onerror=_onerror)

  File "C:\Python27\Lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\users\beegee\.platformio\penv\lib\site-packages\platformio\util.py", line 636, in _onerror
    raise e
WindowsError: [Error 5] Access is denied: 'C:\\SPB_Data\\.platformio\\packages\\tool-pioplus\\pioplus.exe'

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

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
  http://docs.platformio.org/page/faq.html

* Report this problem to the developers

  https://github.com/platformio/platformio-core/issues

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

As suggested in the error message, I manually removed C:\SPB_Data\.platformio\packages\tool-pioplus\pioplus.exe then tried pio upgrade again. Next error message:

PS C:\Users\beegee> pio upgrade
Please wait while upgrading PlatformIO ...
Error: ['c:\\users\\beegee\\.platformio\\penv\\scripts\\python.exe', '-m', 'pip', '--no-cache-dir', 'install', '-
-upgrade', 'https://github.com/platformio/platformio-core/archive/develop.zip']
Collecting https://github.com/platformio/platformio-core/archive/develop.zip
  Downloading https://github.com/platformio/platformio-core/archive/develop.zip (198kB)
Requirement already up-to-date: arrow<1 in c:\users\beegee\.platformio\penv\lib\site-packages (from platformio==3.5.0b1)
Requirement already up-to-date: bottle<0.13 in c:\users\beegee\.platformio\penv\lib\site-packages (from platformio==3.5.0b1)
Requirement already up-to-date: click<6,>=5 in c:\users\beegee\.platformio\penv\lib\site-packages (from platformio==3.5.0b1)
Requirement already up-to-date: colorama in c:\users\beegee\.platformio\penv\lib\site-packages (from platformio==3.5.0b1)

Requirement already up-to-date: lockfile<0.13,>=0.9.1 in c:\users\beegee\.platformio\penv\lib\site-packages (from platformio==3.5.0b1)
Requirement already up-to-date: pyserial!=3.3,<4,>=3 in c:\users\beegee\.platformio\penv\lib\site-packages (fromplatformio==3.5.0b1)
Requirement already up-to-date: requests<3,>=2.4.0 in c:\users\beegee\.platformio\penv\lib\site-packages (from platformio==3.5.0b1)
Requirement already up-to-date: semantic_version>=2.5.0 in c:\users\beegee\.platformio\penv\lib\site-packages (from platformio==3.5.0b1)
Requirement already up-to-date: python-dateutil in c:\users\beegee\.platformio\penv\lib\site-packages (from arrow<1->platformio==3.5.0b1)
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in c:\users\beegee\.platformio\penv\lib\site-packages (from requests<3,>=2.4.0->platformio==3.5.0b1)
Requirement already up-to-date: idna<2.7,>=2.5 in c:\users\beegee\.platformio\penv\lib\site-packages (from requests<3,>=2.4.0->platformio==3.5.0b1)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in c:\users\beegee\.platformio\penv\lib\site-packages (from requests<3,>=2.4.0->platformio==3.5.0b1)
Requirement already up-to-date: certifi>=2017.4.17 in c:\users\beegee\.platformio\penv\lib\site-packages (from requests<3,>=2.4.0->platformio==3.5.0b1)
Collecting six>=1.5 (from python-dateutil->arrow<1->platformio==3.5.0b1)
  Downloading six-1.11.0-py2.py3-none-any.whl
Installing collected packages: platformio, six
  Found existing installation: platformio 3.5.0b1
    Uninstalling platformio-3.5.0b1:
      Successfully uninstalled platformio-3.5.0b1
  Running setup.py install for platformio: started
    Running setup.py install for platformio: finished with status 'done'

  Found existing installation: six 1.10.0
    Uninstalling six-1.10.0:
      Successfully uninstalled six-1.10.0
  Rolling back uninstall of six

Exception:
Traceback (most recent call last):
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pip\req\req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,

  File "c:\users\beegee\.platformio\penv\lib\site-packages\pip\wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pip\locations.py", line 140, in distutils_scheme
    d = Distribution(dist_args)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\setuptools\dist.py", line 321, in __init__
    _Distribution.__init__(self, attrs)
  File "C:\Python27\Lib\distutils\dist.py", line 287, in __init__
    self.finalize_options()
  File "c:\users\beegee\.platformio\penv\lib\site-packages\setuptools\dist.py", line 389, in finalize_options  ep.require(installer=self.fetch_build_egg)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 2324, in require  items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 862, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 2568, in requires  dm = self._dep_map
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 2815, in _dep_map  self.__dep_map = self._compute_dependencies()
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 2824, in _compute_dependencies  for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 2806, in _parsed_pkg_info  metadata = self.get_metadata(self.PKG_INFO)
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 1468, in get_metadata  value = self._get(self._fn(self.egg_info, name))
  File "c:\users\beegee\.platformio\penv\lib\site-packages\pkg_resources\__init__.py", line 1577, in _get
    with open(path, 'rb') as stream:
IOError: [Errno 2] No such file or directory: 'c:\\users\\beegee\\.platformio\\penv\\lib\\site-packages\\six-1.10.0.dist-info\\METADATA'


* Upgrade using `pip install -U platformio`
* Try different installation/upgrading steps:
  http://docs.platformio.org/page/installation.html

So I did pip install -U platformio which told me that I am already up to date?????

Next try of pio upgrade just said:

You're up-to-date!
`PlatformIO 3.5.0b1 is currently the newest version available.`

So I closed PlatformIO and deleted $HOME_DIR%/.platformio/homestate.json

Next start of PlatformIO the 'PlatformIO Home' tab is empty beside of a spinning busy icon.

I tried a 'pio update' and I saw a 'Updating contrib-piohome @ 0.3.1 [Fixed]' line.

But after restarting PlatformIO I still get the same empty 'PlatformIO Home' tab.

Next I went to 'PlatformIO->Settings' and saw that 'Use built-in PlatformIO Core' was unchecked. I changed it, but still getting an empty 'PlatformIO Home' tab.

Giving up at this point and will try a fresh clean install.
Will give a feedback after the new installation is finished.

@beegee-tokyo
Copy link
Author

New installation finished, still having the problem with the empty 'PlatformIO Home' tab.
Trying 'pio home' in terminal throws

PS C:\Users\beegee> pio home
PlatformIO Plus (https://pioplus.com) v0.10.13
CorePackageManager: Installing contrib-piohome @ >=0.3.2,<2
Error: Detected unknown package 'contrib-piohome'

@beegee-tokyo
Copy link
Author

beegee-tokyo commented Nov 3, 2017

Solved that problem with downloading the contrib-piohome package manually and unpack it in packages folder. There is no version 0.3.2 available on bintray, only 0.3.1, I guess that might be the problem because in core.py it requests version 0.3.2.

But for the projects created outside of the default directory I still get the build errors like

PlatformIO: Failed to run a command: clean
Please make sure that "build" package is installed and activated.

I checked that I am on developer IDE and latest core version.

When I open a terminal and use
platformio run --target clean
platformio run --target -D
platformio run --target upload
it works as expected.

@ivankravets
Copy link
Member

Fixed, just run pio update. Should be PIO Home 0.3.2

@ivankravets
Copy link
Member

  1. Please be sure that you use PIO Core 3.5.0b1 and PIO Home 0.3.2
  2. Close/remove all projects from Atom
  3. Close Atom
  4. Remove %HOME_DIR%/.platformio/homestate.json file
  5. Start Atom and open project. Now, all should work.

@beegee-tokyo
Copy link
Author

Confirmation
After another pio upgrade

PS C:\Users\beegee> pio upgrade
Please wait while upgrading PlatformIO ...
PlatformIO has been successfully upgraded to 3.5.0b2
Release notes: http://docs.platformio.org/en/latest/history.html

The PIO Home screen shows
Home 0.3.2·Core 3.5.0b1

Creating a new project outside of the default location works now as expected. Clean, Build and Upload buttons work as excpected.

Thank you.

@Jeremaiha-xmetix
Copy link

Had the very same issue, even when operating Arduino's native IDE.
Apparently, reset pin was connected (accidentally) and does prevent upload new code.

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

4 participants