fona not accepting AT commands

Adafruit cellular platform - SMS and IoT over celluar

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
fredless
 
Posts: 12
Joined: Tue Oct 16, 2012 2:07 pm

fona not accepting AT commands

Post by fredless »

Just bought a new fona 3g (ID 3147) directly from you, charged the battery (bought from AF, & displays a green light), attached the antenna, put in a TING card, wired it to an Arduino Uno, exactly matching your diagram, and it does not respond to AT commands from either the FONA3G_setbaud or FONAtest examples. I'm assuming, perhaps wrong, that AT commands should work regardless of the SIM card attaching to a network.

thanks.

-=fred=-

User avatar
rpiloverbd
 
Posts: 198
Joined: Mon Nov 29, 2021 8:13 am

Re: fona not accepting AT commands

Post by rpiloverbd »

Is the battery that you're using to power up the module, sufficient? I am asking because I worked at one of the adafruit's distributors in our country. I saw that most of the time GSM modules did not work because of insufficient power supply. If your power supply is sufficient, your connection is right, then probably the module has some other issues. Let's wait for team adafruit members.

User avatar
fredless
 
Posts: 12
Joined: Tue Oct 16, 2012 2:07 pm

Re: fona not accepting AT commands

Post by fredless »

Battery is new and bought from Adafruit.

I double checked that it was charged, and that the needed change was made in the Arduino code for 3g device.

It still does not accept AT commands.

One question, does it need an active SIM card to run? I'm testing it with the included Ting card. I'm assuming it need a card, but not necessarily a cellular network connection. And that I should be able to at lest access the GPS. Yes?

Bad module????

User avatar
fredless
 
Posts: 12
Joined: Tue Oct 16, 2012 2:07 pm

Re: fona not accepting AT commands

Post by fredless »

One other odd behavior - I tried charging another lipo battery (bought from Adafruit) with an external charger (Adafruit USB to lipo) and it charged just fine. I then plugged it into the Fona 3g module and the orange charging light came on and it's been on for over 2 hours - seems that should not be the case.

How do we resolve this? We are under a deadline for a gallery show and I'm trying to help one of my student's build her artwork.

User avatar
rskup
 
Posts: 230
Joined: Sat Aug 01, 2020 9:04 pm

Re: fona not accepting AT commands

Post by rskup »

Hi, just tossing out some thoughts...

I'm guessing the FONA's PWR led is lit...is the FONA's NET led lit? Blinking?

Are you seeing anything at all on the serial monitor window? If you're seeing odd characters have you tried changing the baud rate on the serial monitor window?

Besides the FONA 3G currently being wired to the Arduino, do you also by chance have a USB cable (say from your laptop) connected to the FONA? If so, remove it, people have noted odd behavior if both the TX and RX pins are wired up and a USB is plugged in.

Also, maybe post a pic of your current setup?

By the way, concerning the orange charging light being on all the time...I'm lately running my FONA 3G for about 8-10 hours a day (in the direct USB mode) and that charging light is always on, even if I'm not making calls or sending texts. However, right after I issue the shutdown command, AT+CPOF, it turns green.

User avatar
fredless
 
Posts: 12
Joined: Tue Oct 16, 2012 2:07 pm

Re: fona not accepting AT commands

Post by fredless »

Serial Monitor
Serial Monitor
Screen Shot 2022-02-17 at 5.43.01 AM.png (29.02 KiB) Viewed 800 times
arduino setup
arduino setup
IMG_6213.jpg (263.56 KiB) Viewed 800 times
thanks. yes,

LEDs power is green, network is red solid, battery is orange...

-- one of my questions is if the FONA 3G needs an active network SIM to accept AT commands. I'm using a Ting card right now to test this thing. I'm assuming it doesn't; I should be able to access the GPS in any case.

User avatar
rskup
 
Posts: 230
Joined: Sat Aug 01, 2020 9:04 pm

Re: fona not accepting AT commands

Post by rskup »

It's been awhile since I've run my FONA 3G with an Uno, but I think you have the RX/TX lines reversed. So, double-check that, not sure if you re-assigned the pins in the sketch, but I seem to recall it should be Uno TX to FONA RX and Uno RX to FONA TX.

I'll check if my FONA 3G will run without a sim card and get gps.

User avatar
fredless
 
Posts: 12
Joined: Tue Oct 16, 2012 2:07 pm

Re: fona not accepting AT commands

Post by fredless »

I should have pasted the code along with the image. I switched the pins in Arduino code so I didn't have crossing wires. this is from the set baud code:

#define FONA_RX 3
#define FONA_TX 2

SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
SoftwareSerial *fonaSerial = &fonaSS;

//Adafruit_FONA fona = Adafruit_FONA(FONA_RST);
Adafruit_FONA_3G fona = Adafruit_FONA_3G(FONA_RST);

uint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);
...

User avatar
rskup
 
Posts: 230
Joined: Sat Aug 01, 2020 9:04 pm

Re: fona not accepting AT commands

Post by rskup »

Ah, ok, pins reversed.

I did run my FONA 3G without a sim card, yep, I can issue AT commands, etc..., and got the GPS going and got a location.

I also do remember way back having to run that "setbaud" program before my FONA came to life, hmmm.

Longshot...do you have a second antenna to plug into the cell ant connector? Maybe there's built-in circuity to protect the chip if there's no antenna there??? In ye olden days (where I'm from) running RF stuff without an antenna could damage things, maybe the chip guards against that.

Wish I could think of something else, but the only other thing that comes to mind is to run the FONA 3G in the simplest mode possible (mentioned in the tutorial), "Direct USB Connection", and first see if the board works doing that, and then move on to the Uno. Going through the driver install is a bit of a pain, but once it's set up, it's a quick way to test things rather than to keep re-programming a sketch.

Note if you do try this method, you will not see the PWR or NET leds light up (explained under "Pinouts" / "Vio").

Also, if you do try this and get the gps going, your very first AT+CGPSINFO command will take a long time before you get a location, since you have a passive antenna. Expect to wait 10 mins (or more) before you get anything other than ".....".

User avatar
rskup
 
Posts: 230
Joined: Sat Aug 01, 2020 9:04 pm

Re: fona not accepting AT commands

Post by rskup »

Just noticed something...in that "setbaud" text above you have the line "Adafruit_FONA_3G fona = Adafruit_FONA_3G(FONA_RST);" that's normally in the FONAtest sketch...are you sure you need it in the setbaud sketch? I looked back over my setbaud sketch and don't have that line in there, it worked without it.

I also noticed near the top of my setbaud sketch is says "Designed specifically to work with the Adafruit FONA 3G", suggesting you don't need that "FONA_3G fona = ... " line.

User avatar
AdrianPW
 
Posts: 21
Joined: Sat Jul 20, 2019 9:38 am

Re: fona not accepting AT commands

Post by AdrianPW »

Hi
The FONA 3G (Simcom SIM5320) has a facility which monitors its activity after power on.
If the FONA is switched off or reset within 2 minutes of the last power up or last reset, a counter is incremented.
When the counter reaches 20 the FONA locks up. Won't accept commands and enters a reset loop.
This sounds a lot of on/off activity but it's easily reached when developing software.
Only way to unblock it (that I have found) is to direct connect to FONA USB and, via the AT command port,
issue a factory reset command (AT&F1).
Hope this helps !

User avatar
rskup
 
Posts: 230
Joined: Sat Aug 01, 2020 9:04 pm

Re: fona not accepting AT commands

Post by rskup »

My old brain just could not understand why Simcom would do this, and I like tinkering/testing things with my FONA, so I turned my FONA 3G on and off 25 times, only having it on long enough to issue an "AT" and "AT+CREG?" command, which maybe took 20 seconds tops, then turning it off with the AT+CPOF command.

Had no freeze up after all those very short on/off cycles, made calls and sent texts afterwards without any problems.

User avatar
AdrianPW
 
Posts: 21
Joined: Sat Jul 20, 2019 9:38 am

Re: fona not accepting AT commands

Post by AdrianPW »

That's interesting.
Maybe I'm misinterpreting the data in the SIMCOM SIM5320 AT command list section 19.8 (page 528) for command AT+CPWRONCHK.
I'm still having problems with the Adafruit FONA 3G module though.
It consistently accepts and then responds to the first four AT commands that it is sent (AT, AT+CPWRONCHK=0, AT+CSPN? and AT+CICCID) and
then refuses to accept any more commands. The commands are being sent (I've checked them with a logic analyser) but nothing is coming back.
Any ideas as to what's going on would be appreciated !

User avatar
rskup
 
Posts: 230
Joined: Sat Aug 01, 2020 9:04 pm

Re: fona not accepting AT commands

Post by rskup »

omg look at that, I was searching through the hardware design manual for the phrase "2 minutes", should have searched the AT manual!!

Ok, so powered up the FONA and tried:

AT+CPWRONCHK?

to see how mine was set, and got back:

+CPWRONCHK: 1,2,500,1

Odd, looks like mine is set to 500 times?! I see in the example it looks like the default is 20 times. Have no idea how the 500 got set, never knew about this command before you mentioned it.

Hmmm, the AT manual sez after the 20 (or 500) limit is reached it will "stop the LUA and EBDAT autorun feature"?? Digging around simcom.ee I found two Simcom application notes on LUA and EBDAT, looks like it's two ways one can create and store custom programs in the chip, how cool is that?! Ok, so it looks like that command only shuts down these internal "custom written" programs, not the chip itself.

Am curious, does this 4 command limit apply even in direct usb mode? Even if you just send four identical "AT"s in a row does it lock up on the fifth "AT" while in direct usb mode with nothing else connected to any of the FONA's pins?

Am asking the above because I'm wondering if your "lock up" could be "flow control" related? I've never used flow control but could something be toggling one of those three flow control pins on the FONA board pinouts and halting things?

Maybe also look at AT+IFC? in the manual (local data flow control). I get two zero's back, ie, "0,0".

And AT+CSCS? I get "IRA" back. Manual sez if "GSM" returned, can cause flow control issues.

User avatar
AdrianPW
 
Posts: 21
Joined: Sat Jul 20, 2019 9:38 am

Re: fona not accepting AT commands

Post by AdrianPW »

FONA went incommunicado again (via TX/RX) this morning - not accepting commands and sitting in a reset loop.
Got it communicating via the USB AT port, but only after disconnecting the LIPO battery.
It appears that my attempts to disable the power on check via the TX/RX lines was not successful - no idea why.
The number of tries was set to 20. Disabled it via the USB and it appears to have worked. AT+CPWRONCHK? now returns 0.
I'm not using flow control and AT+IFC? returns 0,0. AT+CSCS? returns IRA.
Thanks for the suggestions !

Locked
Please be positive and constructive with your questions and comments.

Return to “FONA”