Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
app-hotes:wwan-statistics [2025/11/24 16:50] – [4. Important settings in the SDK script] grayapp-hotes:wwan-statistics [2025/11/25 11:40] (current) – [Goal] gray
Line 3: Line 3:
 ===== Goal ===== ===== Goal =====
  
-This SDK script queries the WWAN data volume from Download. It collects the value for one month and resets the value for the next month. This provides information on how much free data volume the SIM card still has for that month. The customer is informed after the data has been used up. When ''50 percent'' of the data has been used, an email is sent every day. When ''75 percent'' of the data has been used, an email is sent every 12 hours. When 90 percent of the data has been used, you receive an email every 6 hours. If ''100 percent'' of the data volume has already been used within the month, you receive an email every ''20 minutes'' and an additional text message informing you that ''only 64 kBits/s'' are now available in the mobile network. The subject line contains additional information such as the ''serial number'' and ''router name'', so you can better identify which router is affected.+This SDK script queries the WWAN data volume from Download. It collects the value for one month and resets the value for the next month. This provides information on how much free data volume the SIM card still has for that month. The customer is informed after the data has been used up. When ''50 percent'' of the data has been used, an email is sent every ''day''. When ''75 percent'' of the data has been used, an email is sent every ''12 hours''. When ''90 percent'' of the data has been used, you receive an email every ''6 hours''. If ''100 percent'' of the data volume has already been used within the month, you receive an email every ''20 minutes'' and an additional text message informing you that ''only 64 kBits/s'' are now available in the mobile network. The subject line contains additional information such as the ''serial number'' and ''router name'', so you can better identify which router is affected.
  
 ===== Prerequisites ===== ===== Prerequisites =====
Line 141: Line 141:
 ###################################################################################################### ######################################################################################################
  
 +current_date =strftime("%Y-%m-%d_%H:%M:%S",localtime(time()));
 printf("The SDK script is started\n"); printf("The SDK script is started\n");
 +printf("Current date: %s\n",current_date);
 while (true) { while (true) {
  year = strftime("%Y",localtime(time()));  year = strftime("%Y",localtime(time()));
Line 298: Line 300:
  sleep(interval);  # 20 minutes  sleep(interval);  # 20 minutes
  printf("\nNext run\n");  printf("\nNext run\n");
 + current_date =strftime("%Y-%m-%d_%H:%M:%S",localtime(time()));
 + printf("Current date: %s\n",current_date);
  release_point_alert_email = 1;  release_point_alert_email = 1;
  if (alert2_value >= alert2_value_time){  if (alert2_value >= alert2_value_time){
Line 356: Line 360:
  
 What options do you have for modifying the SDK script to suit your needs? What options do you have for modifying the SDK script to suit your needs?
 +
 +{{:app-hotes:volum_skrip_info.png?950|}}
 +
 +Under ''point 1'', the interval can be determined by the SDK script. Here, ''1200 seconds (20 minutes)'' have been stored.
 +
 +Under ''point 2'', the data volume of the SIM card for one month can be stored. A volume of ''30 GB'' has been stored as an example.
 +
 +An email address must be entered under ''point 3''. Alarm and information messages will be sent to this address.
 +
 +A phone number for the SMS service must be entered under ''point 4''. Alarm messages will then be sent to this number when the SIM card has used up its volume for that month.
 +
 +Under ''point 5'', you can enter the time for alarm messages when ''90 percent'' of the data volume has been used up.
 +
 +Under ''point 6'', you can enter the time for information messages when ''75 percent'' of the data volume has been used up.
 +
 +Under ''point 7'', you can enter the time for information messages when ''50 percent'' of the data volume has been used up.
  
 ---- ----
Line 402: Line 422:
 ###################################################################################################### ######################################################################################################
  
 +current_date =strftime("%Y-%m-%d_%H:%M:%S",localtime(time()));
 printf("The SDK script is started\n"); printf("The SDK script is started\n");
 +printf("Current date: %s\n",current_date);
 while (true) { while (true) {
  year = strftime("%Y",localtime(time()));  year = strftime("%Y",localtime(time()));
Line 559: Line 581:
  sleep(interval);  # 20 minutes  sleep(interval);  # 20 minutes
  printf("\nNext run\n");  printf("\nNext run\n");
 + current_date =strftime("%Y-%m-%d_%H:%M:%S",localtime(time()));
 + printf("Current date: %s\n",current_date);
  release_point_alert_email = 1;  release_point_alert_email = 1;
  if (alert2_value >= alert2_value_time){  if (alert2_value >= alert2_value_time){