0

Just trying to understand and use the SoftwareSerial

I want to connect a WiFi Module (ESP8266) If I send an AT command to the module I would like to print a response on my pc screen in the serial monitor

Some example code it tried

   SoftwareSerial dbgSerial(10, 11); // RX, TX
   void setup()
   {
     // Open serial communications and wait for port to open:
     Serial.begin(57600);
     Serial.setTimeout(5000);
     dbgSerial.begin(9600); //can't be faster than 19200 for softserial
     dbgSerial.println("ESP8266 Demo");
     //test if the module is ready
     Serial.println("AT+RST");
     delay(1000);
     if(Serial.find("ready"))
     {
       dbgSerial.println("Module is ready");

I would like to receive ready in the serial

1

Looks like you are swapping the use of Serial and dbgSerial. I think you mean to use Serial to print to the computer and dbgSerial to communicate with your module. Serial.println should display the message in the terminal on your computer.

-2

while (dbgSerial.available()>0 ) { Serial.write(dbgSerial.read()); }

  • 2
    Welcome to Arduino SE! Can you please edit your post to include how this solves the OP's issue? This line of code doesn't seem helpful alone, so can you expand your answer to show how the OP would implement this? Thanks! – Anonymous Penguin Apr 30 '15 at 0:29
  • Actually it does, it will show response of AT commands in the serial monitor as the OP requested – Brian Moreau Jun 7 '18 at 11:28

Your Answer

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

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