B4R Question A6 GPRS Pro Série GPRS GSM Module

Cableguy

Expert
Licensed User
Longtime User
Hi Guys

I just received my A6 GPRS Pro Série GPRS GSM Module.
a6-gsmgprs-dev-board-module-with-antenna.jpg.png

I tested with an Arduino nano and It works ok.

I tested it with this code:
B4X:
char phone_no[]="+33614687128";

void setup() {
Serial.begin(9600);
delay(300);

Serial.println("AT+CMGF=1");   
delay(2000);
Serial.print("AT+CMGS=\"");
Serial.print(phone_no);
Serial.write(0x22);
Serial.write(0x0D);  // hex equivalent of Carraige return   
Serial.write(0x0A);  // hex equivalent of newline
delay(2000);
Serial.print("GSM A6 test message!");
delay(500);
Serial.println (char(26));//the ASCII code of the ctrl+z is 26

}

void loop()
{

}
of course changing the necessary phone number.

SO, the sample codes seem to use only AT commands... @Erel used a similar approach with his gsm code module, but I am having trouble getting it to work, using the provided example.
Has any of you the same module? have you got any code to share?
Thanks in advance
 

rbghongade

Active Member
Licensed User
Longtime User
Dear Cableguy,
I used a similar module A7 with ESP8266. Here is a working code (partial though)!
B4X:
Sub chkreg(unused As Byte)
    Dim CMD0,CMD3 As String
    CMD0="AT"
    astream.Write2(CMD0,0,2).Write(EOL)
    Delay(2000)
    CMD3="AT+CREG?"
    astream.Write2(CMD3,0,8).Write(EOL)
    Delay(2000)
End Sub

Sub init(unused As Byte)
    Dim CMD0,CMD1,CMD2 As String
    CMD0="AT"
    CMD1="AT+CMGF=1"
    CMD2="AT+GPS=1"
   
    astream.Write2(CMD0,0,2).Write(EOL)
    Delay(2000)
    astream.Write2(CMD0,0,2).Write(EOL)
    Delay(2000)
    astream.Write2(CMD0,0,2).Write(EOL)
    Delay(2000)
    astream.Write2(CMD1,0,9).Write(EOL)
    Delay(2000)
   
    astream.Write2(CMD2,0,8).Write(EOL)
    Delay(2000)
       
End Sub

B4X:
astream.Write("AT+CMGS=""").Write("xxxxxxxxxx").Write(C1).Write(CR).Write(NL)
These two subs are for checking whether the SIM card is registered on the network and then initialize the module, the last line for sending sms.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Thanks, So I should take a similar approach as @Erel did, and use the AT commands.
Your code sample is much appreciated, but could you elaborate on the AT commands used and what they do?
 
Upvote 0

Emmanuel.sheshi

New Member
Thanks sir for you prompt reply... i did that and it comes on, but i cant call the sim card, and i noticed a blue light flashes weakly for 2 seconds or so and then goes off. I red on some sites that you have to connect Vcc to the PWR pin for about 4secons or so, but that still doesnt work, please what should i do?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I remember having those issues as well… yes, there a "CS"pin (chip select or chip enable) that need to be set hi (5v) during boot sequence of the board.
Be sure to use a pin code disabled sim card, it will make your life much easier!
Also, search and doawnload the A6 AT commands Reference guide… it will help you a lot about the way to communicate with it.
The further I got was to receive SMS, but I didn't get to parsing them… a lot of string manipulation is due so either a Mega or an ESP is recommended!
 
Upvote 0

Emmanuel.sheshi

New Member
Thanks alot sir, i can't seem to find the "cs" pin on the board... i observed a blue light blink a couple of time and stopsafter i power the. please sir what do i do?
 

Attachments

  • rsz_20180928_190407-1.jpg
    rsz_20180928_190407-1.jpg
    41.7 KB · Views: 373
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Thanks alot sir, i can't seem to find the "cs" pin on the board... i observed a blue light blink a couple of time and stopsafter i power the. please sir what do i do?
You Don't have a CS (Chip Select) but you do have a EN (Enable). You need to connect it to VCC.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
The A6, like several other comm boards, use tx/tx lines. These are limited in number for each controller board. Setting this pin high or low will tell the board if the data passing through the lines are destined to this board or not
 
Upvote 0

Hypnos

Active Member
Licensed User
Longtime User
I'm using the same board but I found it's very unreliable! sometime it can work but sometime not... I already use separate power supply (iPad power adapter) for both A6 module and arduino, really don't know what's wrong....

Any Trick anyone?
 
Upvote 0
Top