This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
sdk:connection-statistics [2015/03/17 16:43] – external edit 127.0.0.1 | sdk:connection-statistics [2019/06/18 07:52] – juraschek | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Connection Statistics ====== | ====== Connection Statistics ====== | ||
+ | {{ : | ||
+ | {{ : | ||
In many mobile use cases customers want to have additional information on network coverage, signal and connections quality, roaming and so on. | In many mobile use cases customers want to have additional information on network coverage, signal and connections quality, roaming and so on. | ||
- | Data gain be generated using a SDK script such as this one here. It queries '' | + | This data can be generated using a SDK script such as '' |
- | A second script will upload the log files in the given directory from time to time to a FTP server. | + | A second script will upload the log files in the working |
- | Once having the data on the server, it can be evaluated, e.g. by drawing it onto a map or analyse it with Excel. | + | Once having the data on the server, it can be evaluated, e.g. by drawing it onto a map or analyse it with Excel or NI DIAdem. |
+ | |||
+ | |||
+ | ===== Logging Skript ===== | ||
<code c logger.are> | <code c logger.are> | ||
/* DESC: A script that can be used for a longtime logging of a NetModule Router. | /* DESC: A script that can be used for a longtime logging of a NetModule Router. | ||
Line 129: | Line 135: | ||
int logNow() | int logNow() | ||
//get current status output | //get current status output | ||
- | sections=mkarray(" | + | sections=mkarray(" |
status=mkstruct(); | status=mkstruct(); | ||
for (i=0; | for (i=0; | ||
Line 180: | Line 186: | ||
nb_syslog(" | nb_syslog(" | ||
//if we don't have enough space delete enough old ones to have enough space | //if we don't have enough space delete enough old ones to have enough space | ||
- | for(i=0; | ||
- | if (this.currentLogSize < (this.maxLogSize-this.freespace)) break; | ||
- | if(remove(sprintf(" | ||
- | this.currentLogSize=this.currentLogSize-size[i]; | ||
- | nb_syslog(" | ||
- | } else { | ||
- | nb_syslog(" | ||
- | } | ||
- | } | ||
- | | ||
return 0; | return 0; | ||
} | } | ||
} | } | ||
+ | // ###################################################### | ||
+ | // ###################################################### | ||
+ | // ###################################################### | ||
l = new logger("/ | l = new logger("/ | ||
+ | // Timestamp of the Logentry | ||
l.addField(" | l.addField(" | ||
+ | |||
+ | |||
+ | // GPS Fields | ||
l.addField(" | l.addField(" | ||
l.addField(" | l.addField(" | ||
l.addField(" | l.addField(" | ||
- | l.addField(" | + | |
+ | |||
+ | // LTE Connection Fields | ||
+ | // Can be cloneed with MOBILE2 in case more LTE Connections are used | ||
+ | // Arbitrary Strength Unit (ASU) https:// | ||
+ | l.addField(" | ||
+ | // received signal code power https:// | ||
+ | l.addField(" | ||
+ | // Received signal strength indication https:// | ||
+ | l.addField(" | ||
+ | // Service Type: LTE/ | ||
l.addField(" | l.addField(" | ||
+ | // NETWORK ID of the LTE Network we are connected to | ||
l.addField(" | l.addField(" | ||
+ | // Area Code in LTE Network | ||
l.addField(" | l.addField(" | ||
+ | // Cell ID we are connected to | ||
l.addField(" | l.addField(" | ||
+ | // Is the SIM registered in Home or Roaming | ||
+ | l.addField(" | ||
+ | |||
+ | |||
+ | // WAN Data Connection field | ||
+ | // Connection that is current default Gateway | ||
l.addField(" | l.addField(" | ||
+ | // Per WANLINK/LTE Connection: | ||
+ | // Current State: up/ | ||
l.addField(" | l.addField(" | ||
+ | // Current upload and download rates | ||
l.addField(" | l.addField(" | ||
l.addField(" | l.addField(" | ||
+ | // Bytes that are already down- or uploaded. | ||
l.addField(" | l.addField(" | ||
l.addField(" | l.addField(" | ||
+ | |||
+ | // WLAN Fields | ||
+ | // WLAN Clients Attached to the Accesspoint | ||
l.addField(" | l.addField(" | ||
Line 215: | Line 244: | ||
l.intervall=5; | l.intervall=5; | ||
l.logfileIntervall=3600; | l.logfileIntervall=3600; | ||
+ | |||
+ | // ###################################################### | ||
+ | // ###################################################### | ||
+ | // ###################################################### | ||
+ | // ###################################################### | ||
Line 253: | Line 287: | ||
+ | ===== Skript to periodcly upload the csv Files ===== | ||
<code c uploader.are> | <code c uploader.are> | ||
Line 331: | Line 366: | ||
</ | </ | ||
- | <code python | + | |
+ | |||
+ | Example Python script to visualize the Data: | ||
+ | |||
+ | |||
+ | |||
+ | <code python | ||
from mpl_toolkits.basemap import Basemap | from mpl_toolkits.basemap import Basemap | ||
import matplotlib.pyplot as plt | import matplotlib.pyplot as plt | ||
Line 371: | Line 412: | ||
minlat=85.0 | minlat=85.0 | ||
- | fi=open(r' | + | fi=open(r' |
csvlog=csv.DictReader(fi, | csvlog=csv.DictReader(fi, | ||
for row in csvlog: | for row in csvlog: | ||
Line 483: | Line 524: | ||
plt.legend() | plt.legend() | ||
- | plt.title(" | + | plt.title(" |
plt.savefig(dt.now().strftime(" | plt.savefig(dt.now().strftime(" | ||
plt.show() | plt.show() | ||
</ | </ | ||
+ |