This is an old revision of the document!


View WWAN data volume statistics for a month

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.

Prerequisites

  • NetModule Wireless Router with wireless connection
  • NetModule wireless router with a WWAN module
  • NetModule Software 5.0.0.101 or newer
  • Not available for legacy products NB1600, NB2700, NB3700, NB3710

The wiki was tested with router software version 5.0.0.101.


1. Setting up an email client on the router

The configuration parameters for the mail server must be entered under the “E-mail” menu item in the “Configuration” tab. This function is then used by the SDK script.

Under point 1, an email address must be stored from the mail server.

Under point 2, the SMTP server is stored.

Under point 3, the server port is stored. Ports 25, 587, and 465 are normally available.

Under points 4 and 5, the user name and password of the email client are stored.


Once the client has been stored in the router, its functionality can be tested.

You can send an email under the “Testing” tab. If everything has been entered correctly, it will then be sent.


2. Setting up an SMS client on the router

The function must be activated under the “SMS” menu item in the “Administration” tab. This function is then used by the SDK script.

Admin status is activated under point 1.

The SMS dispatch reports are activated under point 2.

The confirmation parameters are read from the SIM card and stored. If this has been carried out successfully, the status is “ready” and the SIM card is “registered”.


Once the SMS client has been saved in the router, its functionality can be tested.

You can send an SMS under the “Testing” tab. If everything has been entered correctly, it will then be sent.


3. Set up the SDK script on the router

In the first step, the SDK function is activated and further options are specified.

The function is activated under point 1.

Under point 2, we free up memory for the execution of the script. For this SDK script, 100 MB is sufficient; only a few variables are stored temporarily for the execution of the program.

Under point 3, we activate monitoring to check whether the script is still being processed correctly. We use the router's core function in the program. Monitoring makes sense here.


In the second step, we store the SDK script in Job Management.

First, we store the SDK script under Job Management. Using the plus button under point 3, we add a script.


After pressing the plus button, a new window opens with settings.

First, assign a name to the SDK process. In the second step, you can insert the SDK script using the “upload” function. You can open the script by clicking on the “show code” button in the WIKI and then download the “check_data_volume.are” file. Once you have saved the file on your computer, you can search for it in step 3 using Browse and select it. The last step, “Apply“, saves everything to the router.


show code


4. Important settings in the SDK script


5. Additional information

show code