I tried to add this GitHub Library (LilyGO-T-A76XX) to my PlatformIO using the HTTPS link.
This is my .ini file:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX.git
And then I tried to copy one of the example code of the Library which is (DeepSleep). This is my main.cpp code:
#include <Arduino.h>
#include "utilities.h"
#include <driver/gpio.h>
#define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb
// See all AT commands, if wanted
#define DUMP_AT_COMMANDS
#include <TinyGsmClient.h>
#define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP 30 /* Time ESP32 will go to sleep (in seconds) */
#ifdef DUMP_AT_COMMANDS // if enabled it requires the streamDebugger lib
#include <StreamDebugger.h>
StreamDebugger debugger(SerialAT, Serial);
TinyGsm modem(debugger);
#else
TinyGsm modem(SerialAT);
#endif
void setup()
{
Serial.begin(115200); // Set console baud rate
SerialAT.begin(115200, SERIAL_8N1, MODEM_RX_PIN, MODEM_TX_PIN);
if (esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_TIMER) {
Serial.println("Wakeup timer");
int i = 30;
while (i > 0) {
Serial.printf("Modem will start in %d seconds\n", i);
Serial.flush();
delay(1000);
i--;
}
Serial.println("TurnON Modem!");
}
// Turn on DC boost to power on the modem
#ifdef BOARD_POWERON_PIN
pinMode(BOARD_POWERON_PIN, OUTPUT);
digitalWrite(BOARD_POWERON_PIN, HIGH);
#endif
delay(2000);
#ifdef MODEM_RESET_PIN
// Release reset GPIO hold
gpio_hold_dis((gpio_num_t)MODEM_RESET_PIN);
// Set modem reset pin ,reset modem
// The module will also be started during reset.
Serial.println("Set Reset Pin.");
pinMode(MODEM_RESET_PIN, OUTPUT);
digitalWrite(MODEM_RESET_PIN, !MODEM_RESET_LEVEL); delay(100);
digitalWrite(MODEM_RESET_PIN, MODEM_RESET_LEVEL); delay(2600);
digitalWrite(MODEM_RESET_PIN, !MODEM_RESET_LEVEL);
#endif
pinMode(MODEM_DTR_PIN, OUTPUT);
digitalWrite(MODEM_DTR_PIN, LOW);
Serial.println("Power on the modem PWRKEY.");
pinMode(BOARD_PWRKEY_PIN, OUTPUT);
digitalWrite(BOARD_PWRKEY_PIN, LOW);
delay(100);
digitalWrite(BOARD_PWRKEY_PIN, HIGH);
//Ton >= 100 <= 500
delay(300);
digitalWrite(BOARD_PWRKEY_PIN, LOW);
// Pull up DTR to put the modem into sleep
pinMode(MODEM_DTR_PIN, OUTPUT);
digitalWrite(MODEM_DTR_PIN, HIGH);
// Delay sometime ...
delay(10000);
Serial.println("Check modem online .");
while (!modem.testAT()) {
Serial.print("."); delay(500);
}
Serial.println("Modem is online !");
delay(5000);
Serial.println("Enter modem power off!");
if (modem.poweroff()) {
Serial.println("Modem enter power off modem!");
} else {
Serial.println("modem power off failed!");
}
delay(5000);
Serial.println("Check modem response .");
while (modem.testAT()) {
Serial.print("."); delay(500);
}
Serial.println("Modem is not respone ,modem has power off !");
delay(5000);
#ifdef BOARD_POWERON_PIN
// Turn on DC boost to power off the modem
digitalWrite(BOARD_POWERON_PIN, LOW);
#endif
#ifdef MODEM_RESET_PIN
// Keep it low during the sleep period. If the module uses GPIO5 as reset,
// there will be a pulse when waking up from sleep that will cause the module to start directly.
// https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX/issues/85
digitalWrite(MODEM_RESET_PIN, !MODEM_RESET_LEVEL);
gpio_hold_en((gpio_num_t)MODEM_RESET_PIN);
gpio_deep_sleep_hold_en();
#endif
Serial.println("Enter esp32 goto deepsleep!");
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
delay(200);
esp_deep_sleep_start();
Serial.println("This will never be printed");
}
void loop()
{
}
However, I am getting this error:
src/main.cpp:2:10: fatal error: utilities.h: No such file or directory
*******************************************************************
* Looking for utilities.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:utilities.h"
* Web > https://registry.platformio.org/search?q=header:utilities.h
*
*******************************************************************
#include "utilities.h"
^~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
How do I make the build/compile successful? Thank you.