Git Product home page Git Product logo

Comments (1)

vil-nakul avatar vil-nakul commented on May 30, 2024

This issue seems to be specific to the lilygo board since it needs to power up the modem using a sequence of button press, I have implemented that and now it works. Here is the function for your reference:

#include "driver/gpio.h"
// TTGO T-Call pin definitions
#define MODEM_RST            GPIO_NUM_5
#define MODEM_PWKEY          GPIO_NUM_4
#define MODEM_POWER_ON       GPIO_NUM_23
#define MODEM_TX             GPIO_NUM_27
#define MODEM_RX             GPIO_NUM_26
#define I2C_SDA              GPIO_NUM_21
#define I2C_SCL              GPIO_NUM_22


void enable_pwrkey(void) {
    ESP_LOGI(TAG, "Enabling PWRKEY");
    ESP_ERROR_CHECK(gpio_set_direction(MODEM_RST, GPIO_MODE_OUTPUT));
    ESP_ERROR_CHECK(gpio_set_direction(MODEM_PWKEY, GPIO_MODE_OUTPUT));
    ESP_ERROR_CHECK(gpio_set_direction(MODEM_POWER_ON, GPIO_MODE_OUTPUT));

    ESP_ERROR_CHECK(gpio_set_level(MODEM_RST, 1)); // RESET high

    ESP_ERROR_CHECK(gpio_set_level(MODEM_POWER_ON, 1)); // PWKEY high


    ESP_ERROR_CHECK(gpio_set_level(MODEM_PWKEY, 1)); // PWRKEY high
    vTaskDelay(100 / portTICK_PERIOD_MS);
    ESP_ERROR_CHECK(gpio_set_level(MODEM_PWKEY, 0)); // PWRKEY low
    vTaskDelay(1000 / portTICK_PERIOD_MS);
    ESP_ERROR_CHECK(gpio_set_level(MODEM_PWKEY, 1)); // PWRKEY high
    
    


    vTaskDelay(6000 / portTICK_PERIOD_MS);
//
//
//    ESP_ERROR_CHECK(gpio_set_pull_mode(GPIO_NUM_27, GPIO_PULLUP_ONLY));

    ESP_LOGI(TAG, "Enabling PWRKEY ... done");
}

from esp-protocols.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.