diff --git a/src/TinyGsmClientSequansMonarch.h b/src/TinyGsmClientSequansMonarch.h index 01eb966..ae05bf1 100644 --- a/src/TinyGsmClientSequansMonarch.h +++ b/src/TinyGsmClientSequansMonarch.h @@ -467,8 +467,8 @@ class TinyGsmSequansMonarch // = Receive data mode = 0 - data as text (1 for hex) // = unused = 0 // = Listen auto-response mode = 0 - deactivated - // = Send data mode = 0 - data as text (1 for hex) - sendAT(GF("+SQNSCFGEXT="), mux, GF(",1,0,0,0,0")); + // = Send data mode = 1 - data as hex (0 for text) + sendAT(GF("+SQNSCFGEXT="), mux, GF(",1,0,0,0,1")); waitResponse(5000L); // Socket dial @@ -508,7 +508,13 @@ class TinyGsmSequansMonarch sendAT(GF("+SQNSSENDEXT="), mux, ',', (uint16_t)len); waitResponse(10000L, GF(GSM_NL "> ")); - stream.write(reinterpret_cast(buff), len); + // Translate bytes into char to be able to send them as an hex string + char char_command[2]; + for (int i=0; i(buff)[i]); + stream.write(char_command, sizeof(char_command)); + } stream.flush(); if (waitResponse() != 1) { DBG("### no OK after send"); @@ -720,7 +726,8 @@ class TinyGsmSequansMonarch protected: GsmClientSequansMonarch* sockets[TINY_GSM_MUX_COUNT]; - const char* gsmNL = GSM_NL; + // GSM_NL (\r\n) is not accepted with SQNSSENDEXT in data mode so use \n + const char* gsmNL = "\n"; }; #endif // SRC_TINYGSMCLIENTSEQUANSMONARCH_H_