B4R Question A6 GPRS Pro Série GPRS GSM Module

Discussion in 'B4R Questions' started by Cableguy, Apr 25, 2018.

Tags:
  1. Cableguy

    Cableguy Expert Licensed 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:
    Code:
    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
     
  2. rbghongade

    rbghongade Active Member Licensed User

    Dear Cableguy,
    I used a similar module A7 with ESP8266. Here is a working code (partial though)!
    Code:
    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
    Code:
    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.
     
  3. Cableguy

    Cableguy Expert Licensed 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?
     
  4. Emmanuel.sheshi

    Emmanuel.sheshi New Member

    Pls i just got this module, can figure out how to power it, i need some help
     
  5. Cableguy

    Cableguy Expert Licensed User

    you need to use a a micro-usb cable and feed it 5V
     
  6. Emmanuel.sheshi

    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?
     
  7. Cableguy

    Cableguy Expert Licensed 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!
     
  8. Emmanuel.sheshi

    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?
     

    Attached Files:

  9. Cableguy

    Cableguy Expert Licensed User

    You Don't have a CS (Chip Select) but you do have a EN (Enable). You need to connect it to VCC.
     
  10. tigrot

    tigrot Well-Known Member Licensed User

    I'm wondering the use for EN/CS pin for a serial I/O card. What is it for?
     
  11. Cableguy

    Cableguy Expert Licensed 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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice