Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sendSMS function #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

WolfRorDev
Copy link

Fixes an error in the sendSMS function that made it impossible to send SMS.

Fixes an error in the sendSMS function that made it impossible to send SMS.
Copy link

github-actions bot commented May 9, 2024

Memory usage change @ 740c109

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 🔺 0 - +40 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/HTTPClient
flash
% examples/HTTPClient
RAM for global variables
% examples/HTTPSClient
flash
% examples/HTTPSClient
RAM for global variables
% examples/GetTime
flash
% examples/GetTime
RAM for global variables
% examples/GetLocation
flash
% examples/GetLocation
RAM for global variables
% examples/DeleteSMS
flash
% examples/DeleteSMS
RAM for global variables
% examples/ReceiveSMS
flash
% examples/ReceiveSMS
RAM for global variables
% examples/SendSMS
flash
% examples/SendSMS
RAM for global variables
% examples/ModemTerminal
flash
% examples/ModemTerminal
RAM for global variables
%
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 40 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/HTTPClient<br>flash,%,examples/HTTPClient<br>RAM for global variables,%,examples/HTTPSClient<br>flash,%,examples/HTTPSClient<br>RAM for global variables,%,examples/GetTime<br>flash,%,examples/GetTime<br>RAM for global variables,%,examples/GetLocation<br>flash,%,examples/GetLocation<br>RAM for global variables,%,examples/DeleteSMS<br>flash,%,examples/DeleteSMS<br>RAM for global variables,%,examples/ReceiveSMS<br>flash,%,examples/ReceiveSMS<br>RAM for global variables,%,examples/SendSMS<br>flash,%,examples/SendSMS<br>RAM for global variables,%,examples/ModemTerminal<br>flash,%,examples/ModemTerminal<br>RAM for global variables,%
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
arduino:renesas_portenta:portenta_c33,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,40,0.0,0,0.0,0,0.0,0,0.0

Copy link
Contributor

@cristidragomir97 cristidragomir97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @WolfRorDev, thanks for your contribution. In the begin method there's already a line that sets the SMS module into GSM mode, by sending "+CMGF=1", and this worked for me on both (EMEA and Global) modems. Could you please tell me which one you are using ? I'll investigate if the +CMGF=1 from the initialization is overridden by something, and then merge your request based on the result.

Comment on lines +130 to +131
modem.sendAT("+CMGF=1");
modem.waitResponse(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module is already set to text mode in the .begin() function.

// Set GSM module to text mode
modem.sendAT("+CMGF=1");
modem.waitResponse();

@cristidragomir97 would setting the text format again here increase the stability of the library?

@WolfRorDev
Copy link
Author

WolfRorDev commented May 21, 2024

Hey, I'm using the Global modem together with Arduino Portenta C33. I conducted many tests and found that I need to send the +CMGF=1 command before sending an SMS. I did many tests using the "SendSMS" example. After entering the PIN, my phone number, and enabling setDebugStream, I received the following response:

Unlocking SIM...
Connecting to network...
Connected!
Sending SMS...
Response: 0
Done.

The modem was tested in Poland 🇵🇱 using a SIM card from Orange Flex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants