0

FONA SMS_Send Failure
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

FONA SMS_Send Failure

by silverstar on Fri Oct 04, 2019 5:23 pm

I asked for help with this before but I thought I would try again with a different approach. I wrote a test sketch that attempts to send 5 messages to a given cell phone. I am enclosing the code and an edited serial output. In each test, the first message went out with a reported error, the following 4 messages never got out. An hour later, the messages still have not arrived so I do not believe its a network issue. I should add that during the previous conversation, I was offered a replacement FONA. I am already on my second and the problem seems to be consistent.
I really need a reliable SMS_Send. Without it, my project is dead in the water. I really need help with this.

Code: Select all | TOGGLE FULL SIZE
#include "Adafruit_FONA.h"
#define FONA_RX 18
#define FONA_TX 19
#define FONA_RST 5
#define FONA_RTS 6


HardwareSerial *fonaSerial = &Serial1;
Adafruit_FONA fona = Adafruit_FONA(FONA_RST);
char replybuffer[255];
uint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);
uint8_t type;


void setup() {
//............................................... initialization and determination if FONA is ready.
Serial.begin(115200);
fonaSerial->begin(4800);
if (!fona.begin(*fonaSerial)) {
    Serial.println(F("No FONA"));
    while (1);
}

}//..............................................  End of Setup

                                             
void loop() {
  String m;
  String number = "+19999999999";   // insert a cell phone number here
  boolean worked;
for (int i = 0; i < 5; i++){
    m = "Message #" + String(i);
    worked = Send_SMS (number, m);
    if(worked == true){
   Serial.println ("Message #" + String(i)+ " worked");
} else  {
   Serial.println ("Message #" + String(i)+ " failed.");
}
}
while(1);
}//.........................................................   End of main loop


boolean Send_SMS (String Number, String Message){
char sendto[13];
String m = "";
long sendtimer = 0;
boolean worked = false;
Serial.println ("Attempting to send >" + Message + " to " + Number);
m = Message + " ";
Number.toCharArray (sendto,13);
m.toCharArray (replybuffer,m.length());
while (Serial.available()) Serial.read();
worked = fona.sendSMS(sendto, replybuffer);
return (worked);
}//.......................................  End of text send




The edited serial output follows:
[img]
sms_send_failure_Serial.png
[/img]
Attachments
sms_send_failure_Serial.png
sms_send_failure_Serial.png (38.87 KiB) Viewed 108 times

silverstar
 
Posts: 245
Joined: Tue Feb 04, 2014 10:46 pm

Re: FONA SMS_Send Failure

by siddacious on Tue Oct 08, 2019 2:29 pm

If you look at the code, there are a few reasons that it may return false:
https://github.com/adafruit/Adafruit_FO ... A.cpp#L572

I would suggest narrowing down the problem space by using print statements to determine which condition is returning false, and then investigate the behavior of the code that lead you there.

However, that said it may well not be possible to get a guarantee that a message was delivered or not due to the underlying tech. It just isn't a feature built into sms.

siddacious
 
Posts: 150
Joined: Fri Apr 21, 2017 3:09 pm

Re: FONA SMS_Send Failure

by silverstar on Tue Oct 08, 2019 4:44 pm

How do I test for the condition that caused the failure? I am assuming that whatever it is that is causing that failure is beyond my reach.

I recently changed FONA boards because I was getting false positives on checking for incoming text messages. Two SIM cards and two new FONA boards later, I still have false positives in SMS receiving but I can program around that problem. Previously, if a send SMS was good (return was true), I could relay on the SMS actually getting out. Now the SMS send generates an error and other messages do not go out.

I would greatly appreciate learning what other tests I might make to clear this problem up.

silverstar
 
Posts: 245
Joined: Tue Feb 04, 2014 10:46 pm

Re: FONA SMS_Send Failure

by adafruit2 on Tue Oct 08, 2019 11:25 pm

hiya- only recomendation we have is maybe try another library (we dont know of any off hand, could google around?) and/or connect directly to the module as a pass-thru or with a serial console cable, see if you can type in the commands to send an SMS to find where the failure is

adafruit2
Site Admin
 
Posts: 18707
Joined: Fri Mar 11, 2005 7:36 pm

Re: FONA SMS_Send Failure

by silverstar on Wed Oct 09, 2019 5:56 pm

I believe that there is a problem with either the FONA hardware or the FONA test example distributed with the FONA library.

I have: (1). Loaded the most current stable version of the IDE
(2) Loaded the most current version of the Adafruit FONA library
(3) Loaded and executed the FONA test sketch (modified to work on my Mega)
(4) All tests attempting to send an SMS failed (no reason given).


I would like to contact someone in Adafruit that can address this matter. Who should I contact?

silverstar
 
Posts: 245
Joined: Tue Feb 04, 2014 10:46 pm

Re: FONA SMS_Send Failure

by adafruit2 on Wed Oct 09, 2019 5:59 pm

hiya you're talking to us right now. the code and hardware we have is all that is available right now. if it wont work for you, we can offer you a refund, we don't have any other hardware or code.

adafruit2
Site Admin
 
Posts: 18707
Joined: Fri Mar 11, 2005 7:36 pm

Re: FONA SMS_Send Failure

by silverstar on Wed Oct 09, 2019 6:53 pm

I must admit to being amazed. I can not believe that I am the only person to experience this problem. Adafruit offers a board and testing software that does not work and apparently is not concerned about it. How many people will want to buy a FONA when it does not do what its supposed to do?

I will reluctantly accept your offer of a refund.

silverstar
 
Posts: 245
Joined: Tue Feb 04, 2014 10:46 pm

Re: FONA SMS_Send Failure

by adafruit2 on Wed Oct 09, 2019 7:52 pm

correct, we have not heard anyone else with this issue - and it works for us. so we're not sure why it isnt working for you- electronics is like that sometimes!

please email support@adafruit for a refund - best of luck with your project!

adafruit2
Site Admin
 
Posts: 18707
Joined: Fri Mar 11, 2005 7:36 pm

Please be positive and constructive with your questions and comments.