carrascoacd / ArduinoSIM800L

Arduino HTTP & FTP client for SIM800L/SIM800 boards to perform GET and POST requests to a JSON API as well as FTP uploads.
159 stars 58 forks source link

readBuffer & readSignalStrength #50

Open pixelfriese opened 3 years ago

pixelfriese commented 3 years ago

Hi,

can someone verify the following two things:

In the readBuffer function, >= should be used instead of > in the following two places. Without this change I get an error message and the ESP32 reboots: "Stack smashing protect failure!"

https://github.com/carrascoacd/ArduinoSIM800L/blob/f4f40b97b193c57cf27d05aef13677f6e99ce18c/src/Sim800.cpp#L70 https://github.com/carrascoacd/ArduinoSIM800L/blob/f4f40b97b193c57cf27d05aef13677f6e99ce18c/src/Sim800.cpp#L73

Another thing is the readSignalStrength function. Returning AT+CSQ is much shorter. The length of the buffer should be 24 instead of 32. Without this change, the readBuffer function runs into timeout:

https://github.com/carrascoacd/ArduinoSIM800L/blob/f4f40b97b193c57cf27d05aef13677f6e99ce18c/src/Http.cpp#L163

carrascoacd commented 3 years ago

Thanks for your issue @pixelfriese. Do you mind creating a PR with the changes that you suggest so I can check them?