question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build process wont differantiate env and install on both

See original GitHub issue

What kind of issue is this?

  • Development Platform or Board. All issues (building, uploading, adding new boards, etc.) related to PlatformIO development platforms should be reported to appropriate repository related to your hardware https://github.com/topics/platformio-platform
  • PlatformIO Core. If you’ve found a bug, please provide an information below.

Configuration

Operating system: MacOS 10.13.6 (17G4015)

PlatformIO Version (platformio --version): PlatformIO, version 3.6.7

Description of problem

I wanna use analogWrite on a ESP32 as well on a ESP8266. ESP32 needs an additional lib, because it’s (still) not implemented yet.

Steps to Reproduce

  1. Setup new project with platformio.ini
  2. Copy/Paste this into your `main.cpp
  3. Compile
  4. you will also see, that ESP32 AnalogWrite is present in heltec_wifi_kit_8 and .piolibdeps.

Actual Results

ESP8266 is not compiling, because it’s implementing ESP32 AnalogWrite, which is NOT in the ESP8266 env.

Expected Results

ESP32 AND ESP8266 should compile without ESP32 AnalogRead

If problems with PlatformIO Build System:

The content of platformio.ini:

[env]
monitor_speed = 115200

[env:heltec_wifi_kit_8]
platform = espressif8266
board = heltec_wifi_kit_8
framework = arduino
build_flags = -DESP8266


[env:heltec_wifi_kit_32]
platform = espressif32
board = heltec_wifi_kit_32
framework = arduino
lib_deps = ESP32 AnalogWrite
build_flags = -DESP32

Source file to reproduce issue:

#include <Arduino.h>
#ifdef ESP32
    #include <analogWrite.h>  // <<<<---- SHOULD ONLY BE INCLUDED ON ESP32
#endif // ESP32

int brightStep = 1;
int brightness = 0;

void setup()
{
}

void loop()
{
    brightness += brightStep;
    if (brightness == 0 || brightness == 255)
    {
        brightStep = -brightStep;
    }

    analogWrite(LED_BUILTIN, brightness);
    delay(10);
}

Additional info

Here is a list of libs automatically implemented on build time: As you can see heltec_wifi_kit_8 also includes ESP32 AnalogWrite which should not be there:

Bildschirmfoto 2019-05-31 um 11 23 25

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ivankravetscommented, Jun 1, 2019

You do not need to fix custom path. Be sure that there are no multiple PIO Cores in a system. After that, please remove ~/.platformio/penv and restart VSCode. If you enbaled dev/version in IDE before, installer with install the latest dev/ version autoamtically.

Please re-test.

0reactions
exocodecommented, Jun 1, 2019

@ivankravets: YES. I only had to fix my customPATH in the settings. Hope this gets fixed in the stable version 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing multiple environment configurations in React App
Install env -cmd npm: Either use the command npm install env-cmd or npm install -g env-cmd. Different scenarios in React App have been...
Read more >
'virtualenv' won't activate on Windows - Stack Overflow
To install a virtual environment in Windows PowerShell only, but to activate, you'll need to run Windows PowerShell as an Administrator:.
Read more >
Python Virtual Environments: A Primer
If you install two different versions of the same package into your global Python environment, the second installation overwrites the first one.
Read more >
How to set up iOS environments: develop, staging ... - Sarunw
Learn how to create a separate environment for your app with the help of Configuration and Scheme. Create a different app and variables...
Read more >
Python Virtual Environments tutorial using Virtualenv and Poetry
A mini-guided Python tutorial showing how to use virtual environment and why it's matters on virtualenv and poetry illustrated examples.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found