This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

LTE TCP socket stability testing

I am trying to design some test cases to check the LTE stability and performance. 

I avoid to use the existing Nordic samples to do this as they are too complicate for the testing purposes. 
Here is a test case I've made to test the LTE TCP communication stability. It borrows the idea from the samples of asset_tracker, at_client and tcp. TCP is the prime feature on which TLS, MQTT are based. The test case does the following things:
  1) start the LTE modem
  2) establish a simple TCP connection to a cloud server
  3) periodically (10s) monitor the modem status
  4) periodically (10s) send 2 bytes of payload to the server
I want to see how long the connection can last. 
To build the code, please replace nrf\samples\nrf9160\asset_tracker\src\main.c with the attached main.c. Then rebuild asset_tracker. 
You can see the log in fail1.log attached.
I've run this testing code in a Nordic board (v.07.0) and our own board. Both of them show similar result.
The testing result is inconsistent. Sometime it ran only a few loops (the attached fail1.log is of such kind). Sometime it ran longer. Usually it wouldn't exceed 100 loops. 
When it started to fail, it was usually stuck at recv() which is used to receive AT commands. recv() has been configured with the non-block mode so supposedly it should always return.
Occasionally, it was stuck at connect() when creating TCP connection at boot up.
My questions:
1) is this a proper test case for testing LTE/network stability?
2) is anything missed in the coding for correctly configuring the modem?
3) does the test result meet your expectation?
4) has Nordic done similar testing?
Best,
Kai