0
\$\begingroup\$

I want to use ThinkerAI A9G module via it AT commands, but i cannot make my ESP32 communicate with it. I have connected them but all i get is some strange random symbols. As i understand i could be caused by not matching baud rates, but i have tried all most popular baud rates and tried sending "AT" command to A9G so that it changes its baud rate to match mine, but i always get the same result. Also tried SoftwareSerial, but with it i was not getting anything in my terminal at all.

So heres my setup:

So my ESP32 is connected to A9G like this (left side is esp32):

  1. VBUS <-> VUSB
  2. GND <-> GND
  3. PIN2 <-> TX
  4. PIN4 <-> RX

And heres my Arduino sketch:

#include <Arduino.h>

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

  Serial1.begin(115200, 2, 4); //Here, as i understand i set pin2 to RX and pin4 to TX
}
void loop() {
  while (Serial.available() > 0) {
    Serial1.write(Serial.read());
  }
  while (Serial1.available() > 0) {
    Serial.write(Serial1.read());
  }
}

And when i power everything up, open serial monitor and click "Reset on A9G" i get this: The output i get when i click reset on A9G

And when i send any AT commands it doesn't respond. So i suppose i got something wrong and it is not working properly. So i would like to know how to fix this issue and to communicate with A9G.

Upd: was able to get an output to terminal using SoftwareSerial, by setting inverse to true (TX pin on A9G in high when nothing is transmitted, checked with oscilloscope, so not sure if that was the right decision just experimenting to try to make it work), but still i get random junk in the terminal. Sketch:

#include <SoftwareSerial.h> 
SoftwareSerial softSerial(2, 4, 1);

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

  softSerial.begin(115200);
}
void loop() {  
    while (Serial.available() > 0) {
      softSerial.write(Serial.read());
    }
    while (softSerial.available() > 0) {
      Serial.write(softSerial.read());
    }
}

Result:

enter image description here

Also heres the images of the components that i am using (if its any help):

  1. ESP32-S2-MINI Image of my ESP32

  2. ThinkerAI A9G development board Image of my A9G development board

\$\endgroup\$
6
  • \$\begingroup\$ why are you setting the baud rate so high? \$\endgroup\$
    – jsotola
    Sep 15, 2023 at 23:31
  • \$\begingroup\$ As i understand this is the default rate that A9G uses. (also tried bunch of other different baud rated down to 9600, same result for all of em) \$\endgroup\$ Sep 15, 2023 at 23:40
  • \$\begingroup\$ try 2400 baud ... also, please do not post pictures of text ... copy and paste the text into your post instead \$\endgroup\$
    – jsotola
    Sep 16, 2023 at 16:21
  • \$\begingroup\$ examine all of the parameters in SoftwareSerial softSerial(2, 4, 1); \$\endgroup\$
    – jsotola
    Sep 16, 2023 at 16:23
  • \$\begingroup\$ @jsotola I looked at SoftwareSerial softSerial(2, 4, 1) and it seems to me that i understood all the parameters right. 1: RX pin (should support interrupts, and from what i could find 2nd pin of esp32 supports it), 2: TX pin, 3: inverse_logic: used to invert the sense of incoming bits. I set inverse_logic to true, because i had tried without setting this parameter and i dont get anything in the console at all, so i just experimented. Please let me know if i understand something wrong. Thanks. \$\endgroup\$ Sep 16, 2023 at 20:45

1 Answer 1

0
\$\begingroup\$

Looks like it was a hardware problem, more precisely with a wires, that i have used to connect A9G with Esp32 which made connection unreliable and because of this i couldn't get an output. After soldering everything, i was able to get an output with this sketch:

#include <SoftwareSerial.h> 
SoftwareSerial softSerial(2, 4);

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

  softSerial.begin(115200);
}
void loop() {  
    while (Serial.available() > 0) {
      softSerial.write(Serial.read());
    }
    while (softSerial.available() > 0) {
      Serial.write(softSerial.read());
    }
}

And this is what i got after clicking Reset button on A9G:

Init...
00:25:36.737 -> 
00:25:38.296 -> NO SIM CARD
00:25:38.296 -> +CIEV: "Charging)⸮*
00:25:38.296 -> 
00:25:43.674 -> 
00:25:43.674 -> +CREG: 3
00:25:43.674 -> 
00:27:01.000 -> 
00:27:01.000 -> +CREG: 3
00:27:01.000 -> 

As you can see some characters are still corrupted (+CIEV: "Charging)⸮* should be +CIEV: "Charging",90%), but now it is at least usable. Thank you.

Heres the photo of bad connectors:

problematic wires

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.