Im confused on how to get a specific library to platformIO

So im trying to use this DHT11 libary: GitHub - dhrubasaha08/DHT11: DHT11 Arduino Library: A simple and efficient library for reading temperature and humidity data from the DHT11 sensor without dependencies.

That worked well and that I found in the arduino IDE. I cannot find this when searching in platformIO.

I would greatly appreciate the help, I dont want to rewrite this with a different library.

1 Like

Looks like this library is not registered to PlatformIO’s registry.

But you can use the library by adding it to lib_deps in your platformio.ini:

lib_deps = 
  https://github.com/dhrubasaha08/DHT11

Fortunately, the repository has valid semantic versioning tags

This allows you to specify the exact version you want to use:

lib_deps = 
  https://github.com/dhrubasaha08/DHT11 @ ^2.1.0

1 Like

oh, thats way easier than I thought haha. I dont need to do anything else?

1 Like

Except from including and using the library? :wink:
No

1 Like

@sivar2311 How do I register it?

To create and register a library in the registry please see here Creating Library — PlatformIO latest documentation

1 Like

But my other two libraries are on platformio , however I never add them manually ! I think they automatically imports library from arduino ide library however DHT11 is missing on platformio!

Which libraries are you referring to?

Without knowing anything about your project and configuration, your question is hard to answer. Please show your platformio.ini

This does not actually happen automatically.

Either it is a setting in your platformio.ini which refers to an existing Arduino library folder or the library is located in the lib folder of your project.

Do you mean the library is missing in your project?

There are a lot of DHT11 libraries available in the registry - See PlatformIO Registry

1 Like

I’m referring to these libraries!

DHT11 library didn’t automatically added to the registry idk why …but other two were added automatically!

I think you have a misunderstanding of “registry” vs. adding libraries to your project.

I’m still missing the content of your platformio.ini (and the content of your lib folder)

1 Like

I never used PlatformIO, I tried once…

?

But your question is about a PlatformIO project, isn’t it?

1 Like

No, I’m search google for anything issue related to DHT11 library…I found this post!..

However I had known this issue since last year as someone raised a issue in the github repo regarding this, as he unable to find this library on PlatformIO.

Look I really want everyone one PlatformIO to use my library! That’s why I asked how to add it to the registry. Thanks btw

Please stop writing “platform.io”. This generates a link which is not related to PlatformIO.

So please write “PlatformIO” instead, otherwise the forum software blocks your posts.

1 Like

Two of my other libraries added automatically to the registry of PlatformIO, but for some reason DHT11 didn’t get automatically added !

Libraries are not automatically registered in the PlatformIO registry. You will certainly have done something in the past to make this happen.

Maybe it’s just a misunderstanding, but if I’ve understood you correctly:

You’re the author of the DHT11 library mentioned in post #1 and want to register it in the PlatformIO registry?
See post #6

By the way: The libraries you mentioned are missing the file library.json manifest. You should add this to your libraries - please also see the link from post #6 and library.json — PlatformIO latest documentation

The “library.json” manifest is PlatformIO’s equivalent to Arduino’s “library.properties” manifest.

1 Like

My libraries do not contain any library.json file. Both of them has same file structure as DHT11. No idea how they endup on PlatformIO! As they don’t even contains the required json file !

Anyway I will add a library.json for DHT11 and will add manually by following the link you provided, thanks!

1 Like