Adding library from GitHub

I’m a beginner and trying to add a library from GitHub to my project.

I have added the following code in my platformio.ini file:

lib_deps = 
    ;   nrf24L01
    tmrh20/RF24@^1.3.11
    ;   E22
    https://github.com/wanfp97/EByte_LoRa_E22_Series_Library

the library for the nrf24L01 works well but after I add in the E22 library using the GitHub link and rebuild, the following error occurs:

If I’m not mistaken, the SoftwareSerial.h is an inbuilt library for the Arduino framework. Am I adding the GitHub library wrongly? If yes, please guide me on how to add the library correctly.

Ps: I can’t find the library by searching it within the Platformio and thus I’m adding it using the GitHub link.

Since the library inclusion is guarded by a macro

PlatformIO’s library dependency finder (LDF) needs to be set to a more aggressive mode to recognize the dependency. As per docs, try adding

lib_ldf_mode = chain+

to the platformio.ini and retry compilation.

Did you mean like this?
image

but the problem still remains

1 Like

I cannot reproduce the issue when using the source code

#include <Arduino.h>
#include <RF24.h>
#include <LoRa_E22.h>

void setup() {
}

void loop() {
}

and platformio.ini

[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps = 
    ;   nrf24L01
    tmrh20/RF24@^1.3.11
    ;   E22
    https://github.com/wanfp97/EByte_LoRa_E22_Series_Library
lib_ldf_mode = chain+

Make sure to at least include the library’s header in your code.

Dependency Graph
|-- <RF24> 1.3.11
|   |-- <SPI> 1.0
|-- <EByte LoRa E22 library> 0.9.0+sha.7b3aa2a
|   |-- <SoftwareSerial> 1.0
|-- <SPI> 1.0
|-- <SoftwareSerial> 1.0
[..]
Checking size .pio\build\uno\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.4% (used 9 bytes from 2048 bytes)
Flash: [          ]   1.4% (used 444 bytes from 32256 bytes)
==================== [SUCCESS] Took 2.39 seconds ====================
1 Like

It works, thanks a lot.