JFF-Bohdan / sim-module

Python 3 classes for SIM 900 GSM module
MIT License
54 stars 26 forks source link

Timeout issues with slow mobile subscription #4

Open skippey opened 8 years ago

skippey commented 8 years ago

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.

JFF-Bohdan commented 8 years ago

Hello. Can you send me your code? Thank you.

skippey commented 8 years ago

There you go. Can't remember how messy I left it though =)

On 31 October 2015 at 17:06, Bohdan Danishevsky notifications@github.com wrote:

Hello. Can you send me your code? Thank you.

— Reply to this email directly or view it on GitHub https://github.com/JFF-Bohdan/sim-module/issues/4#issuecomment-152741544 .