Example program for UART power saving configuration of cellular modem. This program can be used with UBLOX_C030_R412M board. It has nothing to do with 3GPP power saving mode.

Dependencies:   ublox-at-cellular-interface ublox-cellular-base ublox-cellular-base-n2xx ublox-at-cellular-interface-n2xx

Files at this revision

API Documentation at this revision

Comitter:
fahimalavi
Date:
Mon Jun 17 17:06:17 2019 +0500
Parent:
1:aa486dbe9ee8
Child:
3:8f43ffa0251e
Commit message:
Fix in power consumption

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Jun 17 16:39:19 2019 +0500
+++ b/main.cpp	Mon Jun 17 17:06:17 2019 +0500
@@ -135,7 +135,7 @@
     icellular_val = 0;
     for(int i = 0; i < c_number_of_analog_samples; i++) {
         ain = (ain + ain_icellular.read());
-        wait_ms(10);
+        wait_ms(20);
     }
     ain = ain/c_number_of_analog_samples;
     icellular_val = (ain*1.8*1000)/7.0f;
@@ -150,7 +150,6 @@
 void icell_thread_handler() {
 
     while(1) {
-        wait_ms(1500);
         calculate_icellular_samples();
     }
 }
@@ -331,7 +330,9 @@
                 printf("Socket closed.\n");
             }
 #endif
+            printf("Sleeping for 20 seconds \n");
             wait_ms(20000); //modem will enter sleep after 6 seconds. This can be observed from Icellular value.
+            printf("Waking up\n");
 #ifndef TARGET_UBLOX_C027
             printf("[Checking if user button has been pressed]\n");
 #endif