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
AdrianPW
 
Posts: 21
Joined: Sat Jul 20, 2019 9:38 am

Re: fona not accepting AT commands

Post by AdrianPW »

Update on my previous post.
Thought all was working - wrong !
I set up the FONA 3G with 11 AT commands with no problem (see list below). All responses are as expected.
ATE0
AT
AT+CPWRONCHK=0
AT+CSPN?
AT+CICCID
AT+IPR?
AT+CRSL=6
AT+CFGRI=1,1
AT+CRIRS
AT+CSQ
AT+CREG?
Then into an infinite loop which sends the AT command (and gets the response, but no echoed command, correctly) once round each loop.
This is OK for between 6 and 14 loops and then the FONA stops responding.
After approximately 40 seconds it appears to reset and then starts responding to the AT loop again but it now echos the AT command before adding its OK response.
The 11 initial commands are not repeated after this "reset". The FONA appears to jump straight back into the infinite loop.
I've scanned the AT command list but can't find any reference to this behaviour. The FONA does not appear to like repeats of the same command.
Sending AT before the loop and then A/ (repeat command) in the loop does not help.
Any ideas gratefully received !

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

Re: fona not accepting AT commands

Post by rskup »

Hi, is this all happening while connected to an Uno or something similar, or is this happening in direct USB mode with nothing at all connected to the FONA's pinouts?

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

Re: fona not accepting AT commands

Post by AdrianPW »

Hi. Sorry about the delay in responding.

Given up on the Adafruit FONA3G (European).
Couldn't get communications working using direct AT commands or Adafruit's library routines via the FONA's serial RX and TX pins
(not the USB). Managed to borrow a SIMCOM 5320E based unit (originally obtained from HobbyKing in the USA). Had this wired up
and working using direct AT commands via its serial RX and TX pins. Returned the FONA 3G to the vendor and am awaiting their response.
The new 5320E works perfectly, all the time. The unit only has 6 pins (5V, GND, VMCU, RST, RX and TX - VMCU is the equivalent
of the FONA's Vio pin) so dead easy to wire up.

Things to be aware of:
1. Commands sent via the serial link are sent as <command><cr> i.e. AT+IPR?<cr> which requests the baud rate.
2. If command echo is enabled, the echo is in exactly the same format as the command itself i.e <command><cr>.
The command echo is returned before any response data is sent.
Command echo can be turned off with the ATE0 command. Funnily this command to stop commands being echoed
actually echoes itself before switching off further command echoes.
3. Responses to commands are framed by <cr><lf> characters as in <cr><lf><response><cr><lf>. So the response to the
above command AT+IPR?<cr> would be <cr><lf>+IPR: 4800<cr><lf><cr><lf>OK<cr><lf>. Note that the info and OK are
sent as separately framed entities (assumes the baud rate is set to 4800 baud).
4. URCs (Unsolicited Result Codes) can be mixed with responses and are framed in the same way - it's up to the user to
deal with them as they see fit. URCs can be switched off with the AT+CFBDURC=1 command.
5. In the main loop of a program there should be code which flushes the serial buffer just in case any info which is not
either a response or a URC sneaks through. Adafruit's flush routine is an attempt to do this but it is not rigorous enough.
The code should check for entire frames i.e <cr><lf><whatever><cr><lf>. If this is not done it is possible to catch a frame
midway through and then the MCU and the 5320E will be out of comms sync.
6. Finally, when taking the response for a command which may contain an indeterminate number of frames, the only way I
have found of doing this is to wait for frames in a timed loop (1 second seems to work). Carry on listening for frames (and
dealing with the entire frame) until the loop times out. Any other suggestions are welcome !

Hope all this helps !

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

Return to “FONA”