Skip to content

NBSocketBuffer.h tries to read data out of the socket when there is none #81

Closed
@CptHolzschnauz

Description

@CptHolzschnauz

If there is data in the socket to read, the modem sends
+UUSORD: 0,310
Then the lib reads out the socket with
AT+USORD=0,512 (The size is not correct? Shouldn't it be AT+USORD=0,310 ??)
The modem sends the data
+USORD: 0,310,"{PAYLOAD DATA}"

So far, so good.

The issue is that the lib is sending a lot of
AT+USORD=0,512
without a signal from the modem saying there is data in a socket to get.

So there are a lot of:
08:45:36.624 -> AT+USORD=0,512
08:45:36.624 -> +USORD: 0,""
08:45:36.624 ->
08:45:36.624 -> OK

This is triggered by the call to update the socket in NBClient.cpp, 351:

  if (NBSocketBuffer.available(_socket) < 0 || (_ssl && !_connected)) {
    stop();
    return 0;
  }

The problem is that the modem is occupied for no reason and this command can colide with another AT command which can lead to a flaky behaviour.

IMHO there is no reason to ask the modem active with AT+USORD=0,512, just read out the data when the modem sends
a +UUSORD is enough. So this call is unnecessary!?! I commented it out and enlarged the send buffer as requested in
#75 and have much more stabilty and less AT command traffic.
Maybe im totally wrong.
THX

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions