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:33] – [3. Set up the SDK script on the router] 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 330: Line 334:
  
 ---- ----
 +
 +In the last step, we activate the SDK script on the router. 
 +
 +{{:app-hotes:volum_job.png?950|}}
 +
 +Again, enter the name for the SDK process first. If you want to activate the first SDK script on the router, the two fields “Trigger” and “Script” are already filled with the options you set up earlier. If you already have multiple scripts, you must select the correct option (Trigger and Script) from the pull-down menu. As before, click “Apply” to apply the setting to the router. In this case, the SDK script is also activated.
 +
 +----
 +
 +{{:app-hotes:volum_status.png?950|}}
 +
 +Using the Administration option under point 1, you can view information under the Status tab, point 2, to see whether the SDK script has started correctly and is running without errors. 
 +
 +----
 +
 +
  
 ===== - Important settings in the SDK script ===== ===== - Important settings in the SDK script =====
 +
 +**
 +<WRAP center round important 60%>
 +Please only make changes in this section of the block.
 +</WRAP>
 +**
 +
 +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 378: 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 535: 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){