Go Down

Topic: A6 gprs/gsm (Read 6821 times) previous topic - next topic

Kaydow

Sep 05, 2016, 06:55 pm Last Edit: Sep 05, 2016, 07:00 pm by Kaydow
Hi , I bought : A6 gprs / gps.


Can you help me to properly connect to a Arduino ? I tried but nothing works /

thank you in advance

acitta

What have you tried?

henryd

I have just started using this device & here are my findings so far
1. PWR_KEY should be connected to VCC - this can be regarded as chip select
2. RESET must pulled low for a few millisecs. You can't do this via an Arduino GPIO as it takes too much current. I use a 2222A transistor to do the job.
3. Initial baud rate is 115200 which means that talking via SoftwareSerial is very flaky.
4. I tried changing baud rate to 9600 but found that in fact nothing happens. The modem reports OK to the change but carries on using 115200.


Nonetheless, do the following to get some sign of life.
1. Connect PWR_KEY to 5V of Arduino
2. Connect UART_RXD to pin 3 of Arduino
3. Connect UART_TXD to pin 2 of Arduino
4. Connect any GND from modem to Arduino GND
5. Power up modem from a USB charger that supplies at least 2 amps
6. Run the attached sketch. At first you will not see anything happening.
7. Take a wire and momentarily connect RESET to any GND (on modem or Arduino)
8. After a few seconds data will start appearing in the terminal window

/------------------ simple sketch
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);

void setup()
{
  Serial.begin(115200);
  mySerial.begin(115200);
};

void loop() {
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}

henryd

I was searching for other people who had the same problem as I have i.e. not changing baud rate and came upon this link

http://www.elecrow.com/wiki/index.php?title=A6_GPRS/GSM_Shield

Interestingly they definitely state that only 115200 baud rate is supported. The instructions for wiring up the board tell you to use SoftwareSerial whereas the sample sketch code comments out all reference to SoftwareSerial and use Serial1 instead!
i.e. you cant use this on an Arduino Uno but you can use a Mega.

I've wasted hours on this. Hopefully others will not.

jambugeamilaprabath

doesn't solve the problem

Crismarre

Hello the guys
I have an even more basic problem with my A6:
In the switched on; the red LED flashes during approximately 6 seconds then remains lit.
I see nothing on the compiler monitor (Serial COM3 in my case).
Does it mean a problem with te SIM ?
I had take off the PIN protection.
Thank you for help me.
Cris

Crismarre

Here is my A6 shield.

Mecanowi

#7
Mar 05, 2017, 01:40 pm Last Edit: Mar 05, 2017, 01:45 pm by Mecanowi
When starting to use the A6, it required to send several AT commands until it synchronizes with the used baud rate.
Here is an example of my code. I use a serial connection at 9600 bps. The function "startAT" send "AT" until the A6 answers with "OK". While doing this, it prints "AT.........." in the console.

Don't forget to include a real phone number instead of "+"

Code: [Select]

// SoftwareSerial lib allows to use digital pins for serial connection
#include <SoftwareSerial.h>

// Tx of A6 linked to pin 4
const int pinRxNano = 4;
// Rx of A6 linked to pin 2
const int pinTxNano = 2;

//Enter here the phone number
const String phoneNumber= "+";
const String messageInit = "A6 ready";

//Create serial connection on the pin
SoftwareSerial A6GSM(pinRxNano, pinTxNano);

//Function waiting for "OK", used for various purposes
void Response(){
  int a = 0;
  Serial.println();
  while(1){
    if(A6GSM.available()){
      String dataFromA6 =A6GSM.readString();
      dataFromA6.trim();
      Serial.println(dataFromA6);
      a++;
      if(dataFromA6.indexOf("OK")>0){break;}
    }
    if(a>500){a=0;break;}
    delay(200);
  }
}

//Function used to send "AT" to A6 until it answers with "OK"
void startAT(){
  int nbAT = 0;
  while(1){
    if (nbAT==0){A6GSM.println("AT");Serial.print(".");}
    if(A6GSM.available()){
      String dataFromA6 =A6GSM.readString();
      dataFromA6.trim();
      Serial.println(dataFromA6);
      if(dataFromA6.indexOf("OK")>0){break;}
    }
    delay(200);
    nbAT++;
    if(nbAT++>10){nbAT=0;}
  } 
}

//Function used to send a sms
void envoieSMS(String numeroEnvoi, String messageEnvoi) {
  delay(200);
  Serial.println("Selection format message SMS");
  A6GSM.println("AT+CMGF=1");
  Response();
  delay(200);
  Serial.println("Envoi message SMS");
  A6GSM.print("AT+CMGS=\"");
  A6GSM.print(numeroEnvoi);
  A6GSM.println("\"");
  delay(200);
  A6GSM.print(messageEnvoi);
  delay(200);
  A6GSM.println (char(26));
  Response();
}

void setup() {
  //GSM serial connection
  A6GSM.begin(9600);
  //Usual serial connection to display on console
  Serial.begin(9600);
  delay(200);
  Serial.println("Init");
  //AT
  startAT();
  envoieSMS(phoneNumber,messageInit);
}

void loop() {
}

zstergios

This Library changes the baudrate https://github.com/skorokithakis/A6lib

tinkerbear

#9
Apr 23, 2017, 07:00 am Last Edit: Apr 23, 2017, 01:29 pm by tinkerbear
I've been having a terrible time trying to get my A6 "mini" module (not the same as the older larger modules) to respond reliably - and I'm just trying to talk to it via a terminal and a USB FTDI TTL serial widget.  I ended up buying a second A6 mini thinking the first was faulty, and had the same troubles.

After some tedious multi-day experimenting, here's what's been working for me lately:

A) Attach FTDI adapter (set to 3V3) to serial pins

B) Apply power to the module (not sure why 2A adapter is required - mine pulls 0.2A max - maybe it will need a fat capacitor on there later)

C) (Sometimes not needed:) Pull the RESET line HIGH (*not* LOW) for 3-4 seconds with a 1K resistor to 5V - NOT DIRECTLY TO 5V.  (A reset direct to 5V makes the unit unstable/unresponsive after the restart, though it doesn't seem to do any lasting damage.)

D) Immediately start pinging the unit with "AT\r" until it responds "OK", and keep pinging it (like once a second) until after initialization is completed - if you don't, it will ignore all further input.

If you can't get a response, go back to C.

I'm starting to think my A6 isn't getting a clean reset on power-up due to the serial input still being connected/powered, but a reset with a 1K resistor seems to overcome that.

I've tried resets with a 10K and a 1N4004 diode (to drop to ~4.2V), but they aren't reliable.

I've got a SIM800L module on a board here also, and it's a lot easier to get talking - though they've screwed up the pin spacing for insertion into a 0.1" breadboard - the left/right rows of pins are 0.85" apart, rather than 0.9" - which is just stupid.

jdrodriguezmo

Hi, this is my first time here; I have been trying to set my A6 and it has been horribly frustrating too... Tinkerbear: Can you help me with a scheme or code, please: its not very clear to me. Thank you !!

tinkerbear

Hi, this is my first time here; I have been trying to set my A6 and it has been horribly frustrating too... Tinkerbear: Can you help me with a scheme or code, please: its not very clear to me. Thank you !!
What have you tried, and what happened?  I haven't worked on any software yet, just managed to chat with it via a terminal session.  Should be possible with the Serial Monitor in Arduino as well.

Go Up