Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Consider looking at this forum.arduino.cc/t/using-millis-for-timing-a-beginners-guide/… What you need to do is create a timer that every 60 seconds executes the code that you want and sets a flag if it was successful and based on that you can do whatever you need with the GSM.
try connecting the GPIO pin to the supply voltage of the ESP32 (3.3V) through a resistor and see if it becomes the maximum value. Maybe there is some flux left on the pin or something that affects it's response to voltage.