Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTE] adds 1 retry for UDP/TCP socket send in case of error [ch18789] #1576

merged 1 commit into from Sep 28, 2018


Copy link

commented Sep 28, 2018


LTE socket send AT commands in Binary mode are being interrupted with data being received, which causes the send to error. This subsequently causes a handshake error immediately. This has been identified as an issue with the u-blox SARA-R410M-02B at this time only and does not seem to affect SARA-U260/U270/G350 modems.


  1545.444 AT send      36 "AT+USOST=0,\"86.75.309.42\",5684,91\r\n"
  1545.460 AT read  >    3 "\r\n@"
  1545.510 AT send      91 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x04\x00N\x10\x00\x00B\x00\x03\x00\x00\x00\x00\x00BA\x04\x03t\xe4\xe5?U\xce^.\x80M\xf5\x87\x05\xebI\x92\xafN3\a\xab^,\xe2\xd2\x80E\x18\xf5\xc3\xee\n\xb5{\xb4,Q\x01\xf9\xfd\xc2\x10\xcaZ\x91\xf0+2{\xba5\xcc,F}\x13#\xf0\xa54\ny\xa2"
  1545.550 AT read ERR   9 "\r\nERROR\r\n"
mbedtls/library/ssl_tls.c:2971: mbedtls_ssl_flush_output() returned -1 (-0x0001)
mbedtls/library/ssl_cli.c:3115: mbedtls_ssl_write_record() returned -1 (-0x0001)
0001545565 [comm.dtls] ERROR: handshake failed -1


The only work around currently is to detect socket send errors and retry the send 1 time.

Steps to Test

Invalidating the device key and allowing it to handshake over and over again allows for many opportunities to observe errors that are resolved by a retry.


135590.646 AT send      36 "AT+USOST=0,\"86.75.309.42\",5684,58\r\n"
135590.662 AT read  >    3 "\r\n@"
135590.662 AT send      58 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x02\x00-\x00\x01\x00\x00\x00\x00\x00\x02O \xbcq\x9a\x82\"\xee\xe3\xd4{\xee3\xcdtw\x8e\xb1YP\b\b\xde\xa0\xee\xae\xd1\xcb\x19\x82\x13\xa9\xbc\xaf\xd7\xcdO"
135590.689 AT read ERR   9 "\r\nERROR\r\n"
135590.689 AT send      36 "AT+USOST=0,\"86.75.309.42\",5684,58\r\n"
135590.693 AT read  +   17 "\r\n+UUSORF: 0,14\r\n"
Socket 0: handle 0 has 14 bytes pending
135590.711 AT read  >    3 "\r\n@"
135590.711 AT send      58 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x02\x00-\x00\x01\x00\x00\x00\x00\x00\x02O \xbcq\x9a\x82\"\xee\xe3\xd4{\xee3\xcdtw\x8e\xb1YP\b\b\xde\xa0\xee\xae\xd1\xcb\x19\x82\x13\xa9\xbc\xaf\xd7\xcdO"
135590.748 AT read  +   16 "\r\n+USOST: 0,58\r\n"
135590.758 AT read OK    6 "\r\nOK\r\n"


  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • [N/A] Added documentation
  • Added to after merging (add links to docs and issues)

@technobly technobly added the bug label Sep 28, 2018

@technobly technobly added this to the 0.8.0-rc.11 milestone Sep 28, 2018

@technobly technobly requested a review from sergeuz Sep 28, 2018

@technobly technobly merged commit b01c35e into develop Sep 28, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@technobly technobly deleted the fix/lte-socket-send-error branch Sep 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.