0

I am just sending the AT command to test if the serial communication works, the response I am getting is a flipped ? or a square or rectangle symbol. I have tested the communication using software provided by waveshare connected through on board usb to uart.

https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT

int PowerKey = 2;
char answer;
void setup() 
{
 Serial3.begin(9600);
 Serial.begin(9600);
 pinMode(PowerKey, OUTPUT);
 Serial.println("initializing");
 digitalWrite(PowerKey, HIGH);
 delay(1000);
 digitalWrite(PowerKey, LOW);
}

void loop() 
{
  answer = send_at_cmd("AT\r\n");
  Serial.println(answer);
}


uint8_t send_at_cmd(const char* ATcommand)
{
  char response;
  // send test command AT
  Serial3.print(ATcommand);
  Serial.println(ATcommand);
  delay(1000);
  //Check for response from the sim7600E-H
  while(Serial3.available() != 0)
  {
    response = Serial3.read();
  }
  return response;
}

enter image description here

enter image description here

  • Your code sets serial 3 to 9600, but the second image sets the serial port to 115K. I think that may be a problem, because at least one is wrong. – Code Gorilla Oct 17 at 14:48
  • I have set it to 115200 but I still have the same result – taha Ghauri Oct 18 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.