Skip to content

Bug in library tinyGSM for sim7020e #1

@roysG

Description

@roysG

Hi,
I tried your library:
https://github.com/OloloevReal/TinyGSM

I got error when try to deploy it:

Arduino: 1.8.14 Hourly Build 2020/09/23 10:35 (Mac OS X), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h: In member function 'int16_t TinyGsmSim7020E::CoAPClient::modemSend(const void*, size_t, uint8_t)':
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:276:40: error: cannot bind non-const lvalue reference of type 'String&' to an rvalue of type 'String'
if (at->waitResponse(2000, GSM_OK) != 1){
^
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:232:0,
from sketch/HttpClient.ino.cpp:1:
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: after user-defined conversion: String::String(const char*)
String(const char cstr = "");
^~~~~~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: initializing argument 2 of 'uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)'
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h: In member function 'bool TinyGsmSim7020E::GsmClientSecure::modemConnect(const char
, uint16_t, uint8_t, bool, int)':
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:353:43: error: cannot bind non-const lvalue reference of type 'String&' to an rvalue of type 'String'
if(at->waitResponse(timeout_ms, GSM_OK) != 1){
^
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:232:0,
from sketch/HttpClient.ino.cpp:1:
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: after user-defined conversion: String::String(const char*)
String(const char cstr = "");
^~~~~~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: initializing argument 2 of 'uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)'
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:359:43: error: cannot bind non-const lvalue reference of type 'String&' to an rvalue of type 'String'
if(at->waitResponse(timeout_ms, GSM_OK) != 1){
^
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:232:0,
from sketch/HttpClient.ino.cpp:1:
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: after user-defined conversion: String::String(const char
)
String(const char cstr = "");
^~~~~~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: initializing argument 2 of 'uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)'
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28:0,
from sketch/HttpClient.ino.cpp:1:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h: In member function 'int16_t TinyGsmSim7020E::GsmClientSecure::modemSend(const void
, size_t, uint8_t)':
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:38:74: error: initializer fails to determine size of '__c'
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper >(PSTR(string_literal)))
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmCommon.h:48:18: note: in expansion of macro 'F'
#define GF(x) F(x)
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:385:41: note: in expansion of macro 'GF'
at->sendAT(GF("+CTLSSEND="), mux, GF(','), s.length(), GF(",""), s, GF("",802"));
^~
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:38:74: error: array must be initialized with a brace-enclosed initializer
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper >(PSTR(string_literal)))
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmCommon.h:48:18: note: in expansion of macro 'F'
#define GF(x) F(x)
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:385:41: note: in expansion of macro 'GF'
at->sendAT(GF("+CTLSSEND="), mux, GF(','), s.length(), GF(",""), s, GF("",802"));
^~
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:38:74: error: initializer fails to determine size of '__c'
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper >(PSTR(string_literal)))
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmCommon.h:48:18: note: in expansion of macro 'F'
#define GF(x) F(x)
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:387:41: note: in expansion of macro 'GF'
at->sendAT(GF("+CTLSSEND="), mux, GF(','), len, GF(",""), (char
)buff, GF("",801"));
^~
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:38:74: error: array must be initialized with a brace-enclosed initializer
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper >(PSTR(string_literal)))
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmCommon.h:48:18: note: in expansion of macro 'F'
#define GF(x) F(x)
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:387:41: note: in expansion of macro 'GF'
at->sendAT(GF("+CTLSSEND="), mux, GF(','), len, GF(",""), (char
)buff, GF("",801"));
^~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:389:38: error: cannot bind non-const lvalue reference of type 'String&' to an rvalue of type 'String'
if (at->waitResponse(2000, GSM_OK) != 1){
^
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:232:0,
from sketch/HttpClient.ino.cpp:1:
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: after user-defined conversion: String::String(const char
)
String(const char cstr = "");
^~~~~~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: initializing argument 2 of 'uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)'
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:400:49: error: no matching function for call to 'TinyGsmSim7020E::waitResponse(int, const char [5], const char [8])'
if (at->waitResponse(2000, GSM_OK, GSM_ERROR) != 1){
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: candidate: uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: no known conversion for argument 3 from 'const char [8]' to 'GsmConstStr {aka const __FlashStringHelper
}'
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1248:11: note: candidate: uint8_t TinyGsmSim7020E::waitResponse(uint32_t, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)
uint8_t waitResponse(uint32_t timeout_ms,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1248:11: note: no known conversion for argument 2 from 'const char [5]' to 'GsmConstStr {aka const __FlashStringHelper
}'
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1256:11: note: candidate: uint8_t TinyGsmSim7020E::waitResponse(GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)
uint8_t waitResponse(GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1256:11: note: no known conversion for argument 2 from 'const char [5]' to 'GsmConstStr {aka const __FlashStringHelper*}'
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h: In member function 'String TinyGsmSim7020E::queryDNS(const char*)':
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:519:38: error: cannot bind non-const lvalue reference of type 'String&' to an rvalue of type 'String'
if(waitResponse(GSM_OK, GSM_ERROR) != 1){
^
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:232:0,
from sketch/HttpClient.ino.cpp:1:
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: after user-defined conversion: String::String(const char*)
String(const char cstr = "");
^~~~~~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: initializing argument 2 of 'uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)'
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h: In member function 'bool TinyGsmSim7020E::modemConnect(const char
, uint16_t, TinyGSMProto, uint8_t*, bool, int)':
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:939:42: error: no matching function for call to 'TinyGsmSim7020E::waitResponse(long int, const char [5], const char [8])'
waitResponse(2000L, GSM_OK, GSM_ERROR);
^
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: candidate: uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: no known conversion for argument 3 from 'const char [8]' to 'GsmConstStr {aka const __FlashStringHelper*}'
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1248:11: note: candidate: uint8_t TinyGsmSim7020E::waitResponse(uint32_t, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)
uint8_t waitResponse(uint32_t timeout_ms,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1248:11: note: no known conversion for argument 2 from 'const char [5]' to 'GsmConstStr {aka const __FlashStringHelper*}'
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1256:11: note: candidate: uint8_t TinyGsmSim7020E::waitResponse(GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)
uint8_t waitResponse(GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1256:11: note: no known conversion for argument 2 from 'const char [5]' to 'GsmConstStr {aka const __FlashStringHelper*}'
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:948:36: error: cannot bind non-const lvalue reference of type 'String&' to an rvalue of type 'String'
if (waitResponse(60000L, GSM_OK) != 1){
^
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:232:0,
from sketch/HttpClient.ino.cpp:1:
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: after user-defined conversion: String::String(const char*)
String(const char cstr = "");
^~~~~~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: initializing argument 2 of 'uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)'
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h: In member function 'int16_t TinyGsmSim7020E::modemSend(const void
, size_t, uint8_t)':
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:982:34: error: cannot bind non-const lvalue reference of type 'String&' to an rvalue of type 'String'
if (waitResponse(2000, GSM_OK) != 1){
^
In file included from /private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:232:0,
from sketch/HttpClient.ino.cpp:1:
/private/var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/AppTranslocation/2D8405D8-BB54-4D2C-B882-5555075C4DF6/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: after user-defined conversion: String::String(const char*)
String(const char *cstr = "");
^~~~~~
In file included from /Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClient.h:46:0,
from /var/folders/zc/3434x75518v51tdnqdhgt6s00000gn/T/arduino_modified_sketch_230884/HttpClient.ino:95:
/Users/roysabah/Documents/Arduino/libraries/TinyGSM-SIM7020E/src/TinyGsmClientSIM7020E.h:1063:11: note: initializing argument 2 of 'uint8_t TinyGsmSim7020E::waitResponse(uint32_t, String&, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr, GsmConstStr)'
uint8_t waitResponse(uint32_t timeout_ms, String& data,
^~~~~~~~~~~~
exit status 1
Error compiling for board Arduino Nano.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I also did not understood where to find the file: "platformio.ini"

Thanks for your help!

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