Open nravanelli opened 1 year ago
Hello @nravanelli
from the schematic I see there is an NPN transistor used for the PWR_KEY which means the levels are inverted.
So to turn on the modem GPIO4 should be driven LOW/HIGH/LOW which after the transistor is HIGH/LOW/HIGH.
And since, after sending the AT command to turn off, you set MODEM_PWKEY to HIGH this actually makes the modem turning on again. Which is what you see.
So when you use LOW/HIGH/LOW to turn the modem on, GPIO4 is already correctly set to LOW and the modem should turn off after sending the AT command.
BTW: this comment (from your post) actually tries to tell you that the PWR_KEY line is inverted. (opposite = inverted)
// Starting the machine requires at least 1 second of low level, and with a level conversion, the levels are opposite
Thanks Felix
@felmue Thanks Felix, I solved based on your comment. Is there a way to turn off the modem at the start, without having to turn it on first?
Hello @nravanelli
not sure I understand your question? If you do not turn it on via PWR_KEY it should stay turned off, even if you apply power to it.
Thanks Felix
just a heads-up: the reset pin also has inverted levels.
I have been attempting to power down the modem using the commands provided, and methods presented in various issues here, but have not had success.
my setup runs this function to start the modem:
and then I initially turn the modem on:
and then I turn off modem
But, after a couple seconds of running my modem off function, the modem turns back on (the network leds flash).
Is there a foolproof solution to turning the modem off and still run code on the ESP32?