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

Add external library #5596

Closed
roysG opened this issue Aug 25, 2021 · 4 comments
Closed

Add external library #5596

roysG opened this issue Aug 25, 2021 · 4 comments

Comments

@roysG
Copy link

roysG commented Aug 25, 2021

Hi,
I want to work with the library: "https://github.com/vshymanskyy/TinyGSM"

I tried to put this package in the esp32-arduino-lib-builder/arduino/components/arduino/libraries.
But there is no any effected.

What do i miss?

@roysG roysG changed the title Add external library #38 Add external library Aug 25, 2021
@me-no-dev
Copy link
Member

you should look into the esp-idf build system. You need to add the lib as extra component and include CMakeLists.txt inside that has the proper lines to enable building that code.

@roysG
Copy link
Author

roysG commented Aug 26, 2021 via email

@1kc
Copy link

1kc commented Aug 30, 2021

@roysG
You could do something like this. For the Adafruit_BusIO library for example.

Clone it under your idf project's components.
Just add CMakeLists.txt

idf_component_register(
    SRC_DIRS "."
    INCLUDE_DIRS "."
    REQUIRES arduino
)

and component.mk

COMPONENT_ADD_INCLUDEDIRS = .

Running this library example

#include "Arduino.h"
#include "Adafruit_I2CDevice.h"

Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(0x10);

void setup() {
  while (!Serial) { delay(10); }
  Serial.begin(115200);
  Serial.println("I2C address detection test");

  if (!i2c_dev.begin()) {
    Serial.print("Did not find device at 0x");
    Serial.println(i2c_dev.address(), HEX);
    while (1);
  }
  Serial.print("Device found on address 0x");
  Serial.println(i2c_dev.address(), HEX);
}

void loop() {
  
}

extern "C" void app_main()
{
    initArduino();
    pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);
    // Do your own thing
}

You may need to run idf.py menuconfig again after adding a new component

@roysG
Copy link
Author

roysG commented Jan 2, 2022

The most library i succeeded to add successfully with the "CMakeLists.txt",
But there is a specific library that i still get errors in build.

This library is: https://github.com/OPEnSLab-OSU/SSLClient

Maybe someone know what are the required steps?

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

3 participants