NetBurner 3.5.6
PDF Version
System Diagnostics

Introduction

System Diagnostics can be viewed from a device's Configuration Server web page (port 20034) by calling the EnableSystemDiagnostics() function in your application. Diagnostic information includes items such as system definitions, variables, TCP stack status, and RTOS state information.

Configuration Server Page with Diagnostics Enabled

When system diagnostics are enabled, an additional button will appear on the configuration server web page in the lower right corner:




System Configuration Web Page Display

Clicking on the Diagnostics button will display system information. An example of the raw data is shown below:

{
"Active":0 day 01:18:04,
"Buffers":401,
"Config":{"ConfigUsed":749,
"ConfigMaxSpaceAvailible":10240
}
,
"EXtraIO":120,
"FreeMem":7577316,
"My Int":4677,
"My String":"My String",
"NNDKVer":"3.3.8",
"System Macros":{
"_DEBUG":"not defined",
"TICKS_PER_SECOND":20,
"TICK_IRQ_LEVEL":5,
"SERIAL_IRQ_LEVEL":3,
"TCP_SOCKET_OFFSET":5,
"TCP_SOCKET_STRUCTS":128,
"OS_MAX_IRQ":"not defined",
"NBRTOS_STACKCHECK":"not defined",
"NBRTOS_STACKOVERFLOW":"not defined",
"NBRTOS_TASKLIST":"not defined",
"NBRTOS_TASK_LOG":"not defined",
"NBRTOS_TIME":"not defined",
"BUFFER_DIAG":"not defined",
"BUFFER_DIAG_LOG":"not defined",
"BUFFER_SANITY":"not defined",
"_DEBUG_PRINT":"not defined",
"ENABLE_SMARTTRAP":"defined",
"MULTIHOME":"not defined",
"IPV6":"defined",
"IPV6_COUNTERS":"defined",
"AUTOIP":"defined",
"ALLOW_CUSTOM_NET_DO_RX":"not defined",
"TCP_NOCOPY_TX":"defined",
"UDP_FRAGMENTS":"not defined",
"GATHER_RANDOM":"defined",
"NB_SSL_SUPPORTED":"defined",
"SSL_V3_DISABLED":"not defined",
"SSL_TLS_SUPPORT":"defined",
"WEB_CLIENT_SSL_SUPPORT":"defined",
"SSL_DEFAULT_MAX_SESSION_AGE_TICKS":"defined",
"TLS_CACHE_PEER_CERT_VALIDATIONS":"defined",
"NB_SSL_CLIENT_CERTIFICATE_CHECKING_ENABLED":"not defined",
"NB_SSH_SUPPORTED":"not defined",
"NB_ENABLE_USER_QSPI":"defined",
"SUPPORT_LEGACY_FIND":"defined",
"NO_SYMETRIC_ROUTING":"not defined",
"FEC_ISR_ERROR_COUNTERS":"not defined"
},
"TCP":{"FreeSockets":124,
"Sockets":{"Socket129":{"State":"ESTABLISED","Flags":"0x81","myIP":"192.168.1.140","theirIP":"192.168.1.26","myPort":20034,"theirPort":59027,"max_listen":0,"cur_listen":0,"NextTime":93685,"theirWindow":2136044278, "myWindow":871968320,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":93681},
"Socket130":{"State":"ESTABLISED","Flags":"0x80","myIP":"192.168.1.140","theirIP":"192.168.1.26","myPort":20034,"theirPort":59028,"max_listen":0,"cur_listen":0,"NextTime":95181,"theirWindow":2136044277, "myWindow":2744612803,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":93681},
"Socket131":{"State":"LISTEN","Flags":"0x00","myIP":"::","theirIP":"::","myPort":80,"theirPort":0,"max_listen":5,"cur_listen":0,"NextTime":0,"theirWindow":0, "myWindow":0,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":0},
"Socket132":{"State":"LISTEN","Flags":"0x00","myIP":"::","theirIP":"::","myPort":20034,"theirPort":0,"max_listen":5,"cur_listen":0,"NextTime":0,"theirWindow":0, "myWindow":0,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":93681}}},
"Tasks":{
"Task38":{"Name":"Enet", "Prio":38,"State":"Fifo","Time":40, "Stack":["70005b26","7002d6d4","70005f30","7000ed1c","000004a4"]},
"Task44":{"Name":"Config Server", "Prio":44,"State":"Running","Time":600, "Stack":["7002d54a","700061be","70023f82","700249ec","70020de4","7002178e","700218e8","7003143e","700213e6","000004a4"]},
"Task45":{"Name":"HTTP", "Prio":45,"State":"Semaphore","Time":19, "Stack":["70005b26","7002d6d4","70005e48","7000465a","70004694","700245e4","000004a4"]},
"Task50":{"Name":"Main", "Prio":50,"State":"Timer","Time":20, "Stack":["70005b26","7002d6d4","70005b96","7001e05a","000004a4"]},
"Task63":{"Name":"Idle", "Prio":63,"State":"Ready","Time":"FOREVER", "Stack":["7002c424","000004a4"]}
},
"Ticks":93681,
"UpTime":4684
}



If you are using Firefox or have the Pretty Print extension in Chrome, the JSON data will be formatted and much easier to read. If the output you see looks identical to the previous raw information, it means the browser you are using does not support JSON data formatting. The image below shows a snippet of a formatted file displayed in Firefox:




Adding Your Own Diagnostic Information

You can add your own diagnostic information using the MyVarMon() functions. Please refer to the System Diagnostics example for more details. In the example output in the previous section, the variables below were added to the standard system output:

"My Int":4677,
"My String":"My String",

The application code to implement the display from the example is:

// Variables to monitor
int myInt;
char myString[80];
// Declarations to add variables to Diagnostic Web page
static DiagVarMon MyIntMon("My Int", myInt);
static DiagVarMon MyStrMon("My String", myString);
Monitor and report the value of numeric variables.
Definition diagnostics.h:97