Feather FONA: Sending SMS to predefined phone #


hi there,

i using adafruit feather fona 32u4 diy alarm notification system. have verified board works , can send sms's without problem test sketch in serial monitor (when enter destination phone number , text message).

i brand new coding i've been able cobble sketch reads state of alarm in both armed , alarming states. cannot find example sketch shows me how automatically send sms pre-defined phone number when sketch detects alarming state occurring.

when run sketch detects whether alarm sounding or not when tries send sms notify me of alarm seem error displayed in serial monitor @ " at+cmgs="" "

here error copied serial monitor , portion of sketch seems problem (particularly line send sms). numbers sensor voltages (627 armed state , 195 alarming state). have defined destination phone number in standard 12223334444 format under title 'notifyphonea'...does phone number need definedin ascii maybe?

any suggestions appreciated! thanks!


[error]

627
195
alarm detected!
sending first notification...
   ---> at+cmgf=1
   <--- ok
   ---> at+cmgs=""
   <--- error
failed
195
alarm detected!
sending first notification...
   ---> at+cmgf=1
   <--- ok
   ---> at+cmgs=""
   <--- error
failed
195


[/error]
-----------------------------------------




code: [select]


void loop() {
  // read sensor , store in variable sensorreading:
  int sensorreading = analogread(a4);
  int var = 0;
 
 
  if (sensorreading < 250) {   // if sensor reading less threshold
   var = 1;
  } else {
   var = 2;
  }
 
switch (var) {
    case 1:
       serial.println(sensorreading); // displays sensor reading during alarming status
       serial.println("alarm detected!"); // displays alarm detected
       serial.println("sending first notification...");
       
       if (!fona.sendsms(notifyphonea, "alarm sounding! test"))  {
          serial.println(f("failed"));
       } else {
          serial.println(f("sent!"));
       }
       delay(3000); // delay redisplay sensor reading during alarming status
     
      break;
     
    case 2:
         serial.println("system armed - not alarming"); // displays armed status
         serial.println(sensorreading); // displays sensor reading during armed status
         delay(3000); // delay rerun program if alarm not sounding
      break;
  }

quote
i have defined destination phone number in standard 12223334444 format under title 'notifyphonea'...does phone number need definedin ascii maybe?
you need show code. can redact part of phone number, don't call chat (not that likely). but, need see how notifyphonea declared , initialized.

it possible send sms hardcoded phone number, long variable type correct, , proper value hardcoded.


Arduino Forum > Using Arduino > Programming Questions > Feather FONA: Sending SMS to predefined phone #


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino DUE ADC to DAC Piezo 30 Khz-100Khz

Indesign and MathType fonts