Grand Unified Libraries... Question?

I just compiled 280_0LED_Uno for an Uno, and it went fine. Same script. Libraries are squiggled, but I did lib_deps.

Ok, that’s good news indeed. The squiggles should vanish after VSCode’s “intellisense” catches up and does the parsing thing on the headers. (Intellisense is not part of PlatformIO by the way.)

I’m surprised. Didn’t you post somewhere, that you had come from the Arduino IDE? All your code so far has been based on writing Arduino sketches - so other than using lib_deps to install a library, everything should be the same.

Adding libraries in the Arduino IDE is easier now that a zip file can be installed, but before that it was a manual process. Download library, extract, lookup proper folder, close IDE, copy to ~/Arduino/libraries, re-open IDE etc.

As the code compiles for an Uno, I would guess that it isn’t 100% compatible with the ESP-32? I can only guess as I don’t have one to test with.

Cheers,
Norm.

Might be more a matter of not giving the full name of the library… it’s called “Adafruit BME280 Library”, not “Adafruit BME280”! :laughing: Give it the wrong name… well… the phrase “Crap in, Crap out” exists in programming for a reason!

The same as the errors earlier

Looking for Adafruit GFX library in registry
Warning! Library `{'name': 'Adafruit GFX', 'requirements': None}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'name': 'Adafruit GFX', 'requirements': None}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
Looking for Adafruit BME280 library in registry
Warning! Library `{'name': 'Adafruit BME280', 'requirements': None}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'name': 'Adafruit BME280', 'requirements': None}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.

The error does say Adafruit GFX has not been found … so there’s no guessing that it wasn’t found… :man_facepalming:… PIO just said you that it wasn’t … which is correct, because it’s name is ‘Adafruit GFX Library’ …

Oh god no… DON’T MESS WITH STUFF LIKE THAT! Guaranteed way to ruin your week. Just. Don’t. Do. It! :shudder:

Ah! Of course it’s the name. But not this morning.

I uninstalled and reinstalled VSCode twice, deleting the users/platformio folder. Pretty sure I deleted the pio folder, certainly will after this.
After the first install, VSCode was unable to find an .exe that I was able to find in the location where it was supposed to be looking.
Whatever I did in settings is undid.

The .h file doesn’t use ‘library’. I added that to lib_deps and didn’t add it to the code. None of the libraries are finding. Only one- #include “Fonts/FreeSerif9pt7b.h”. This is a folder I copied from Adafruit_GFX_Library.

I keep the underscore in the , right? Adafruit**__strong text**
GFX?

That command ‘pio include lib’ thing worked when I typed it in, but it doesn’t happen in the GUI.

I just posted a question about a python thing happening now with this file, which suddenly has 894 errors- down from >1K.

Command did not work this time:

Executing task in folder UVIndex2_OLED_WeMos: C:\Users\joema.platformio\penv\Scripts\platformio.exe device monitor <

— Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...

— Available ports:
— 1: COM1 ‘Communications Port (COM1)’
— 2: COM4 ‘Intel(R) Active Management Technology - SOL (COM4)’
— Enter port index or full name: pio lib install “adafruit/Adafruit BME280 VEML6070”
could not open port ‘pio lib install “adafruit/Adafruit BME280 VEML6070”’: could not open port ‘pio lib install “adafruit/Adafruit BME280 VEML6070”’: OSError(22, ‘The filename, directory name, or volume label syntax is incorrect.’, None, 123)
The terminal process “C:\Users\joema.platformio\penv\Scripts\platformio.exe ‘device’, ‘monitor’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

That is the name of the GitHub page. It doesn’t say ‘library’.

I installed the 64-bit VSCode. That’s the incompatibility. Re-installing the 32-bit.

That didn’t help:
Processing wemos_d1_mini32 (platform: espressif32; board: wemos_d1_mini32; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (2.0.0) > WeMos D1 MINI ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 3.10004.200129 (1.0.4)
  • tool-esptoolpy 1.20600.0 (2.6.0)
  • toolchain-xtensa32 2.50200.80 (5.2.0)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Library Manager: Installing Adafruit/Adafruit VEML6070
    KeyError: ‘versions’:
    File “C:\Users\joema.platformio\penv\lib\site-packages\platformio\builder\main.py”, line 169:
    env.SConscript(“$BUILD_SCRIPT”)
    File “C:\Users\joema.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py”, line 598:
    return _SConscript(self.fs, *files, **subst_kw)
    File “C:\Users\joema.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py”, line 287:
    exec(compile(scriptdata, scriptname, ‘exec’), call_stack[-1].globals)
    File “C:\Users\joema.platformio\platforms\espressif32\builder\main.py”, line 223:
    target_elf = env.BuildProgram()
    File “C:\Users\joema.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py”, line 219:
    return self.method(*nargs, **kwargs)
    File “C:\Users\joema.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py”, line 62:
    env.ProcessProjectDeps()
    File “C:\Users\joema.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py”, line 219:
    return self.method(*nargs, **kwargs)
    File “C:\Users\joema.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py”, line 140:
    project_lib_builder = env.ConfigureProjectLibBuilder()
    File “C:\Users\joema.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py”, line 219:
    return self.method(*nargs, **kwargs)
    File “C:\Users\joema.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py”, line 1062:
    project.install_dependencies()
    File “C:\Users\joema.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py”, line 898:
    lm.install(spec)
    File “c:\users\joema.platformio\penv\lib\site-packages\platformio\package\manager_install.py”, line 49:
    spec, silent=silent, skip_dependencies=skip_dependencies, force=force
    File “c:\users\joema.platformio\penv\lib\site-packages\platformio\package\manager\library.py”, line 86:
    force=force,
    File “c:\users\joema.platformio\penv\lib\site-packages\platformio\package\manager_install.py”, line 99:
    pkg = self.install_from_registry(spec, search_filters, silent=silent)
    File “c:\users\joema.platformio\penv\lib\site-packages\platformio\package\manager_registry.py”, line 86:
    version = self.pick_best_registry_version(package[“versions”], spec)
    ==================================================================================================== [FAILED]

I would like to uninstall PlatformIO and re-install it.

I don’t think it’s right. If you’re telling me the truth, then my experience is divergent from the normal case. There must be an explanation.
One of my programs works. I can’t do anything. Nothing. The Adafruit syntax change didn’t make it start working.

How can I remove PIO from my Win10 PC?

I don’t believe any of this:

@pfeerick

My thoughts exactly. Randomly pressing buttons or changing file contents, eithout knowing exactly what you are doing has three probable outcomes:

  • You will make it worse;
  • You will break it cmpletely;
  • You will fsck it! (Linux/Unix joke. :grin:)

@monsterthews

Probably a VSCode settings problem. To be honest, VSCode has far too many settings even before installing extensions.

Yes indeed. Uninstalling uninstalls settings. Too late now, but finding and saving the settings file(s) which I think is called settings.json might have helped. Not sure if extensions’ settings are included though.

`

The *.h file for a library, can be named anything! If the library is called Norman/Flintstone Library, that’s what you add to lib_deps. The #include could be anything,not necessarily Flintstone.h – although that’s what I consider nice and accebtable. Read the library docs to find out what header(s) are required.

This is not the Arduino IDE, you are writing code as it should be done. The IDE does way too much effing about in the background to make life “easy” for you, but it fscks you up when you move off into the real world I’m afraid. Hence, my book on the matter.

WTH? Did you actually read the prompt here? It’s telling you to pick 1 for COM1 or 2 for COM4, or to type in COM1 or COM4. You’ve typed/pasted pio lib install “adafruit/Adafruit BME280 VEML6070” – no wonder it barfed!

It even told you that you messed up – could not open port ‘pio lib install “adafruit/Adafruit BME280 VEML6070”’: OSError(22, ‘The filename, directory name, or volume label syntax is incorrect.’, None, 123)

Please don’t take this the wrong way, but did you read the prompts etc? All the information you needed was on screen.

I do. As mentioned earlier, the header files don’t necessarily match the library names. The library is adafruit/whatever library so that is what you add to lib_deps.

The header file us, for example, whatever.h, so that is what you #include. The adafruit/ part is not necessary. Unless the docs/examples say so.

You can’t PlatformIO is like herpes - once you have it, it’s for life!! :stuck_out_tongue_winking_eye:
Uninstalling will not help. Again, don’t take this the wrong way but I think you are running before you can walk – slow down, take a deep breath.

Look at the examples, read the code, understand what it is doing as much as you can. Read the docs.

Compile and upload the examples. Yippee, it works. Hopefully! :wink:

Try the other examples. Keep learning what is happening. Take your time.

Now, start simple. Try one sensor, or Oled, or LCD andd do simple stuff. Blink isn’t the first sketch people get told to try for no good reason – it’s easy and simple.

Ok, the Oled works, add in something else. Practice, practice, practice! Make jotes when something didn’t work 100% as you expected. What you did, what you expected, what actually happened, how you configured it. Next time you use that device, you are fore warned about potential foibles. In addition, you have evidence to supply when reporting faults. It shows you tried and understand the support process too.

Now you have the easy stuff off pat, add more complexity. Increase yourknowledge and understanding.

Learning a new system is a sloping process. I didn’t become a fully trained brain surgeon overnight! Sorry, Oracle DBA, I’m not a brain surgeon! :rofl:

Don’t try to learn too many new things at once either. A new IDE plus a microcontroller you’ve never used before, or infrequently, is too many. Tha’s true in any sphere of experience – ask me how I know!

Have fun.

Cheers,
Norm.

1 Like

But I’ve added the OLED, pasted in some widgets. And then nothing worked, still doesn’t. I added the OLED a few weeks ago using the script that won’t compile and upload anymore, and the WeMos. It’s still in the same half breadboard with the OLED and now a Uv Index chip I can’t want ti try. That’s the VEML in the pio lib install command.

Settings- I was at wits’ end with nothing, hence nothing to lose. And I knew i could uninstall.
The failure to find xxx.exe came after install 2, but before install 3. All my settings ,mischief was in install 1.

I don’t know what a port index or a full name is, so I did the last thing I did successfully. There’s no machine plugged in. There’s no COM port in use.

So back to lib_deps - is that ‘lib_deps = Adafruit/Adafruit GFX’ ?

And in the #includes, is that Adafruit/Adafruit_GFX.h?

It seems like everything should be ultra-literally exactly the same name for the same thing, so I can’t triangulate.

I know what a .h file is. I want to know the correct new syntax for using lib_deps. The word ‘library’, and the word ‘adafruit’. New rules in v5?

In the end, the libraries still aren’t being reliably found and remembered…

#include <Arduino.h>
#include <SPI.h>
#include "Adafruit/Adafruit_Sensor.h"
#include "Adafruit/Adafruit_BME680.h"
#include "Adafruit/Adafruit_GFX.h"
#include "Adafruit/Adafruit_SSD1306.h"
#include "Fonts/FreeSerif9pt7b.h"

Only Arduino and SPI are unsquiggled, and the others are all 12 of my problems… lib deps in the users/platformio folder only has WeMos in it, an empty folder.

Edited: to correct pio lib search command.

So, probably “pasting” broke something, or, you didn’t paste enough. Hence my suggestion, get the Oled, in this case, to display something. Work on that problem first. Create a separate Oled sketch and get it working.

Now, create a new sketch for one sensor, and get it ti work.

Now you have two working sketches, do what needs doing to merge them. Repeat ubtil you are familiar and confident with each part.

Port index = the index number given in the list of com ports displayed. 1 or 2.

Port name, COM1 or COM4.

If you are having difficulty there, how did you manage to pick a suitable port in the arduino IDE? :frowning_face:

Your “last successful thing” was to install a library, which has absolutely nothing to do with the prompts and questions displayed on the screen. It offered you a menu with 2 choices, and gave you 2 different ways to pick the monitor port. You typed/pasted some random :poop: :poop: :poop: and thought it would work? That was, I’m afraid, a serious reality disconnect. Sorry.

Maybe, maybe not!

Go here if you want a gui, PlatformIO Registry, or run pio lib search "adafruit gfx" --platform espressif32.

I used the gui and searched for GFX, platform espressif32. The first result was Adafruit GFX Library. Click to open the library page.

Now you see Examples, Installation, Headers.

Follow the installation instructions, then check out the required headers. What you see is what you type, for eg:

#include "Adafruit_GFX.h"
Etc

Easy or what?

How did I know where the gui was? Google “platformio libraries”, click the first result.

Nope. If the library name includes “library” you have to use it in the name. The “servo” library is just “servo”, the Adafruit GFX Library" is exactly those three words.

The addition, in 5.0.0, of the vendor/supplier/packager name as the library name prefix, is simply to properly identify a single library when more than one vendor/supplier/packager have similar libraries with the same name. It also stops you having to choose from a list of alternatives, like in another post if yours where the Arduino library had multiple variations.

As I said in another post, you are adding the vendor/supplier/packager name where it is not needed. Remove “Adafruit/”. Library names do not necessarily have to be the same as header files.

Use the library search url above for ease of use.

Because the first 2 are correct names, the others are not.

It’s 01:24 AM in the UK. Good night! :yawning_face: :sleeping_bed:

Cheers,
Norm.

2 Likes

Thanks Norm. I really appreciate you coming in on a Saturday.

Sunday! :wink:

Stay safe amongst all that smoke in the Bay Area.

Cheers,
Norm.

1 Like