Little problem with sending AT command to Quectel UG95


hello,

i have problem code not know, communicate module 3g click quectel ug95 , module arduino uno send @ commands, not receive anything, while module ftdi (usb - uart) have reply module quactel ug95, made small program on arduino , tested module ftdi (usb - uart) , works normally. can not problem can me. thank much.

quote
int octetin=0;
char charin = 0;
int compt = 0;
string chainein="";
boolean chainecomplete = false;

void setup() {
  // put setup code here, run once:
  pinmode(12, output);
  serial.begin(9600);
  serial.println("starting...\n");
  delay(800);              // wait second
  digitalwrite(12, low);    // turn led off making voltage low
  delay(800);              // wait second  
  digitalwrite(12, high);   // turn led on (high voltage level)
  delay(5000);              // wait second
  digitalwrite(12, low);    // turn led off making voltage low
  delay(800);              // wait second
  serial.begin(9600);
  serial.println("send at\n");
}

void writestring(string stringdata) {
  (int = 0; < stringdata.length(); i++)
  {
    serial.write(stringdata);
  }
}

void loop(){
  serial.print("at\r\n");
  delay(1000);
  if (chainecomplete)
  {
    serial.println("chaine recu :" + chainein);
    writestring(chainein);
    chainein = "";
    compt = 0;
    chainecomplete = false;
  }
}

void serialevent(){
  while(serial.available()>0)
  {
    charin = (char) serial.read();
    chainein += charin;
   
    if(charin == '\n')
    {
      chainecomplete = true;
    }
  }
}



Arduino Forum > Using Arduino > Programming Questions > Little problem with sending AT command to Quectel UG95


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor