0

MO Adalogger and Hardware Serial doesnt work with FONA_SMS_R
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MO Adalogger and Hardware Serial doesnt work with FONA_SMS_R

by tkisner on Sat Jan 26, 2019 1:26 pm

I have a Feather MO Adalogger and a FONA 808 which I am trying to use to get an Auto SMS response from FONA_SMS_Response example in the FONA library. I know the MO cannot use Software serial so I enable hardware serial but the Auto Response on the SMS does not work. I have used software serial with a FONA Feather 32u4 and it works fine. I am thinking it is because my FONA_RI is not being recognized or I am not using the right pin but I am not sure.

This piece of code does not go true for some reason upon receiving a text.
if (1 == sscanf(fonaNotificationBuffer, "+CMTI: " FONA_PREF_SMS_STORAGE ",%d", &slot)) {

I can send and receive texts with the setup and everything with FONA_test appears to be working as intended.

Any help is appreciated.
Thank you,
Travis

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by adafruit_support_mike on Sun Jan 27, 2019 1:26 am

Let's step back and check the basic connections: does the 'fonatest' sketch work when you run that?

adafruit_support_mike
 
Posts: 55959
Joined: Thu Feb 11, 2010 2:51 pm

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Sun Jan 27, 2019 8:21 pm

yes it does. I can send a text and receive a text no problem.

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Sun Jan 27, 2019 8:25 pm

there is nothing that fails to function on FONA_Test therefore I was going a bit further. On the SMS_Auto_REsponse, I even get the text to show up as +CMTI: "SM",5 or whatever slot is next in the sequential order but I dont get anything past that. The serial monitor i posted below is from the FONA feather that works with Software Serial.

Thank you,
Travis

+CMTI: "SM",5
slot: 5
---> AT+CMGF=1
<--- OK
---> AT+CSDH=1
<--- OK
AT+CMGR=5
+CMGR: "REC UNREAD","+17132987400","","19/01/26,08:11:16-24",145,4,0,0,"+12063130055",145,5
FROM: +17132987400
---> AT+CMGF=1
<--- OK
---> AT+CSDH=1
<--- OK
AT+CMGR=5
+CMGR: "REC READ","+17132987400","","19/01/26,08:11:16-24",145,4,0,0,"+12063130055",145,5
Test4
Test4
Sending reponse...
---> AT+CMGF=1
<--- OK
---> AT+CMGS="+17132987400"
<--- >
> Hey, I got your text!
^Z
Sent!
---> AT+CMGF=1
<--- OK
---> AT+CMGD=005
<--- OK
OK!

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by adafruit_support_mike on Mon Jan 28, 2019 2:52 am

Okay, that lets us know the hardware and software work in general.

Switching from SoftwareSerial to hardware Serial is just a matter of making some small changes to the code and wiring. This chunk of the FONAtest sketch shows how to select the Serial connection:

Code: Select all | TOGGLE FULL SIZE
// We default to using software serial. If you want to use hardware serial
// (because softserial isnt supported) comment out the following three lines
// and uncomment the HardwareSerial line
#include <SoftwareSerial.h>
SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
SoftwareSerial *fonaSerial = &fonaSS;

// Hardware serial is also possible!
//  HardwareSerial *fonaSerial = &Serial1;
Just comment out the SoftwareSerial part and uncomment the line for hardware Serial. Then you can move the wired connections to the Feather's TX and RX pins.

adafruit_support_mike
 
Posts: 55959
Joined: Thu Feb 11, 2010 2:51 pm

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Mon Jan 28, 2019 12:47 pm

Thank you for the reply. I definitely did that and the Hardware serial works as intended. I commented out the Software lines and enabled the hardware lines.

My issue is only in that the FONA_SMS_Response sketch does not function as intended when use the MO Adalogger with the FONA 808. I hooked up the lines as shown in the instructions but I am thinking i need an interrupt (RI) in order for the following line of code to be true. The Serial.print never happens as the if never becomes true from what I can see.

if (1 == sscanf(fonaNotificationBuffer, "+CMTI: " FONA_PREF_SMS_STORAGE ",%d", &slot)) {
Serial.print("slot: "); Serial.println(slot);

I am trying to figure out if I need to have the RI line on the FONA 808 connected to my MO board and if so what would be the best way of doing that.

I have all of these lines connected and the FONA_Test works just fine as you asked me in a prior response.
Vio connects to 5V (or, with a 3V logic Arduino, 3V)
GND connects to GND
Key connects to GND (always on)
RX connects to TX
TX connects to RX
RST connects to digital 4 // I am also not sure where to hook this up as well

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Mon Jan 28, 2019 3:55 pm

Very simply, if someone could achieve getting an auto response and/or making SMS_Auto_Response work with an MO adalogger or MO board and a FONA 808 and let me know the hardware connections and any Software updates needed to the SMS_Auto_Response example, I would appreciate it greatly.

I really believe my issues are coming from the Hardware connections of the RI and RST lines and not knowing where they should be connected. I am willing to connect these in any way suggested as well and try it as I would believe the example would work without much modification in Software. I believe I would have to define the
#define FONA_RST 4
#define FONA_RI 7

I plan on buying a bunch more boards when I get this working but this is my main gating item.

Thank you so much,
Travis Kisner

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by adafruit_support_mike on Tue Jan 29, 2019 1:41 am

To help with signal connections, we'll need to see the ones that exist now.

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

Another point that's standard in all debugging is to isolate the point of failure. "it doesn't work" has almost no diagnostic value. The most useful starting point is, "what's the last thing that works correctly before the first thing that doesn't?"

adafruit_support_mike
 
Posts: 55959
Joined: Thu Feb 11, 2010 2:51 pm

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Tue Jan 29, 2019 12:50 pm

I will take a picture when I am in front of it later but my connections are as follows.

Adalogger MO----------FONA 808
3V3 -----------------------5V - suggested as I am using Arduino
3V3 -----------------------Vio
TX IDE1 ------------------- RX
RX IDE0 -------------------TX
GND------------------------GND
GND------------------------Key
IDE 5-----------------------RTS - I mentioned I was trying to hook to 4 but I dont believe that is the correct pin as it is used for other items like VREFA on the Adalogger MO.
? N/C-----------------------RI

Again thank you for your help. To restate, the FONA Test works well and I can do everything needed inside of the FONA_Test example. The only issue that does not work is the FONA_Auto_Response example. I am not trying to say it just doesn't work, I am trying to say the only thing that doesnt work is the auto response. I still receive the text in the FONA_Auto_Response as a

+CMTI: "SM",1,

I just don't get the auto response as I believe that a Ring Interrupt needs to occur. Is there a way for you to hook up this hardware to experience the same scenario that I am describing.

Picture to follow and you help is very much appreciated,
Travis

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Tue Feb 05, 2019 6:15 pm

IMG_4430.jpg
IMG_4430.jpg (237.68 KiB) Viewed 75 times

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Tue Feb 05, 2019 6:15 pm

IMG_4431.jpg
IMG_4431.jpg (231.87 KiB) Viewed 75 times

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Tue Feb 05, 2019 6:15 pm

IMG_4433.jpg
IMG_4433.jpg (260.84 KiB) Viewed 75 times

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by adafruit_support_mike on Wed Feb 06, 2019 1:54 am

Thank you.

The RST signal is the SIM808's hardware RESET pin, and can connect to any GPIO pin on the Feather. The Feather just pulls that line low to force the SIM808 to drop into a known state after it boots up.

The RI (Ring Indicator) signal is generated by the SIM808, and drops low for about 125ms when an incoming call or SMS message arrives. You can connect that to any microcontroller pin that can handle interrupts.

All of the Feather M0's digital GPIO pins can handle interrupts, but it looks like you have it connected to A1 right now. It's possible to make the analog pins accept interrupts, but you have to reconfigure the chip a little. Try moving that signal over to one of the digital pins on the other side of the board, then edit the code with the number of the pin you used.

adafruit_support_mike
 
Posts: 55959
Joined: Thu Feb 11, 2010 2:51 pm

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Wed Feb 06, 2019 11:19 am

Appreciate the help, couple of follow up questions

So would my pin definition look like the following

#include "Adafruit_FONA.h"

//I don't list the RX and TX as they are working and connected directly to the hardware pins that are appropriate
#define FONA_RST 5 //Assuming I connect to GPIO 5
#define FONA_RI 6 //Assuming I connect to GPIO 6

I did notice that there is an RST pin labeled on the MO board. Is that the pin I should use located in the top left of the pinout diagram of the MO or should I use a GPIO pin and #define it as I have as GPIO 5? I believe this is the MO' Reset pin itself and hooking the two together would not achieve what I am intending as I am looking to have the MO control the RST of the FONA 808.

It is also confusing to know the pinouts and how to number them in the definitions. I believe I want to use the IDE reference number for the GPIO pin, the numbers in purple, and not the physical pin numbers, the numbers in gray. In my #defines
above I am using the IDE purple number.
Thank you,
Travis
Am I also correct in my understanding in order for the SMS Auto Reponse sketch to work, RI needs to be connected and functioning in order to notify of the received SMS as an interrupt?

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Re: MO Adalogger and Hardware Serial doesnt work with FONA_S

by tkisner on Wed Feb 06, 2019 11:20 am

adafruit_products_Feather_M0_Adalogger_v2.2-1.png
adafruit_products_Feather_M0_Adalogger_v2.2-1.png (60.93 KiB) Viewed 55 times

tkisner
 
Posts: 23
Joined: Fri Feb 10, 2017 10:40 am

Please be positive and constructive with your questions and comments.