Go Down

Topic: A6_mini GSM/GPRS Ai-Thinker - problems (Read 7039 times) previous topic - next topic

ovest

Jan 21, 2017, 02:47 pm Last Edit: Jan 21, 2017, 07:08 pm by ovest
Hello!

I'm an arduino-newbie - only played with raspberry and sensors until now.

Wanted to use an arduino-nano with an A6_mini GSM/GPRS-module to send SMS to the arduino-module to switch a relay on/off.



Hardware is connected as follows:


Arduino Nano <-> A6_mini-GSM
5V <-> VCC
GND <->  G
D9 <-> PWR (not used in this sketch!)
D10 <-> UTX
D11 <-> URX



As a first starting-point i'm using the following sketch found at https://www.arduino.cc/en/Tutorial/SoftwareSerialExample :

Code: [Select]

/*
  Software serial multple serial test

 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.

 The circuit:
 * RX is digital pin 10 (connect to TX of other device)
 * TX is digital pin 11 (connect to RX of other device)

 Note:
 Not all pins on the Mega and Mega 2560 support change interrupts,
 so only the following can be used for RX:
 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

 Not all pins on the Leonardo and Micro support change interrupts,
 so only the following can be used for RX:
 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

 created back in the mists of time
 modified 25 May 2012
 by Tom Igoe
 based on Mikal Hart's example

 This example code is in the public domain.

 */
#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(115200);
  mySerial.println("Hello, world?");
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}


upload to arduino went without problems!

When starting the "serial monitor" i'm immediately getting the info: "Goodnight moon!" Then - after approx. 60-90 seconds the following data is shown in the monitor:
Code: [Select]

Goodnight moon!

^CINIT: 0\ 0, 0

^A™NIT: 2, 31, 41891

^STN: 37

^CINIT: 4, 8192, 33

^CINIT9 8, 2048, LCá
+CREG9 3

^CINH¤: 16, 0, 0f38420

^CINIT= 32, 0, 0


+CREG: 0
 
+A¤ZV:17/01/20\13:27:32,+01

+A™EV: servicY Šj
+CIEV9 roam, 0

 +CREG: 1



i can type "AT" and receive "OK" but when typing other AT-commands i'm seeing crippled answers with mistyped characters.

Examples:
Code: [Select]
ATI

Ai Thinkfâ Co.LTD
A3
V03.03.20160830011H01

OK

ATI
 
Ai Thinker Co.LTF
A6
V03.03.2016083000aH03

OK

So the received data is not stable!

When calling the module the following is shown:
Code: [Select]

RING

RING

RIOG

RING

RING
 
RINTHø
RING

QING

YING

RHžG

RING

RING


Any chance to get "RING" everytime and not any crippled versions of that?

Question2:
When is the sketch-code executed ? After powering on the arduino or everytime i'm opening "serial monitor" ?

Ove

jn1057

Hi!

how odd, just today ive received two of these modules also to be used for the very same purpose!

As an arduino newbie myself ive learnt some basics.

Whenever there is a mismatch between baud settings in sketches and the serial monitor window, garbled messages can result. looking at the sketch you posted, baud rate is set to 115200. my guess is that your serial monitor window is set to 9600.

Effectively, your window is "listening" at a slower rate than the arduino is "speaking" at, so data is being missed!

adneto

Hello guys.

I'd strongly suggest you to use the TinyGSM library, it cuts lots of work with the AT commands.
Besides, @ovest, your problem seems to be related to modem serial baud rate. Install the TineGSM library on Arduino IDE and then upload the sketch "AT_debugger" to you arduino. It'll check which speed is set to your modem.

Additionally, it seams to have some problem regarding the usage of SoftwareSerial lib with the lowest (9600) or the highest (115200) baud rates, try something like 19200. Also the datasheet for A6 says to supply it with no less than 2A so make sure to use an external power supply.

arthursmaal

@ovest

Has anyone been able to use this A6 mini. If so, can you post the connections and a sketch?

Thanks

Go Up