Skip to content

Timeout issues with slow mobile subscription #4

Description

@skippey

I have a mobile subscription with slow data rate (cheap and enough for the task at hand)
Otherwise worked well but I had to do a bit of tinkering with the library because of some timeout issues.

gsm.py
__sendRawBytes timed out. I had to increase the maxWaitTime in __sendRawBytes since write functions don't have time out parametes. Only read functions have time out parameters. Sorry I can't remember exactly why it timed out...
Also added a delay to while loop in __sendRawBytes every 500 bytes to keep send buffer from filling up.

I also made slower functions for data transfer related functions to increase timeout time and ease load on raspberry by not constantly checking read buffer.
readLnSlow()
readDataLineSlow()
These are with timout * 10 and a 0.5 sec delay before checking serial input

inetgsm.py
bug
def __parseHttpResult(self, httpResult, bearerChannel = None):
...
if response[0] != str(bearerChannel):

I don't think the first parameter after +HTTPACTION: is bearerChannel.
SIM900_AT commands manual_V1.11 page 225.
It works only if you happen to have the right bearerChannel.

httpPOST() had the worst timeout problems for me.
After sending data the OK takes a while to come back.

Worst was after sending POST data and AT+HTTPACTION=1. The HTTP request result takes an even longer while to come back.
I had to change

reading HTTP request result

dataLine = self.readDataLine(15000)

to 25000 timeout and also used my readDataLineSlow() with even more delay built in.

But like I said otherwise worked well. Good job and thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions