diff --git a/src/Sodaq_nbIOT.cpp b/src/Sodaq_nbIOT.cpp index 100d155..c7c0c64 100644 --- a/src/Sodaq_nbIOT.cpp +++ b/src/Sodaq_nbIOT.cpp @@ -519,6 +519,8 @@ bool Sodaq_nbIOT::connectSocket() return false; } + powerSaveOff(); + println(R"(AT+COPS=1,2,"21630")"); readResponse(); @@ -530,6 +532,14 @@ bool Sodaq_nbIOT::connectSocket() return waitForSignalQuality(); } +bool Sodaq_nbIOT::powerSaveOff() { + println(R"(AT+CEDRXS=0,5,"0101")"); + readResponse(); + + println(R"(AT+CPSMS=0,,,"01000001","00000101")"); + return readResponse() == ResponseOK; +} + bool Sodaq_nbIOT::reconnectSocket() { println(R"(AT+COPS=1,2,"21630")"); readResponse(); diff --git a/src/Sodaq_nbIOT.h b/src/Sodaq_nbIOT.h index 6c77259..757983a 100644 --- a/src/Sodaq_nbIOT.h +++ b/src/Sodaq_nbIOT.h @@ -48,6 +48,7 @@ class Sodaq_nbIOT: public Sodaq_AT_Device bool isAlive(); // returns true if modem is registered on the network bool isRegistered(); + bool powerSaveOff(); bool reconnectSocket(); // Returns the default baud rate of the modem.