# I cannot read this message

**URL:** <https://bbs.aprbrother.com/t/i-cannot-read-this-message/654>\
**Category:** Arduino\
**Created:** [July 21, 2016, 7:55am UTC](https://bbs.aprbrother.com/t/i-cannot-read-this-message/654 "2016-07-21T07:55:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shockingjmh](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@shockingjmh](https://bbs.aprbrother.com/u/shockingjmh)\
**Post date:** [July 21, 2016, 7:55am UTC](https://bbs.aprbrother.com/t/i-cannot-read-this-message/654/1 "2016-07-21T07:55:56Z")

</div>

Hello, again!

I am making Soket Program to send and receive byte data

I am setting a wifi module but I cannot read the message

How can I resolve this problem?

Here is my source code and following the result

```auto
#include <avr/pgmspace.h>

#define WIFI_ENABLE_PIN 13
#define DEBUG true

#define SSID "Project11x" //your wifi ssid here
#define PASS "abcd1234" //your wifi wep key here

void setup()
{
  Serial1.begin(9600);
  Serial1.setTimeout(10000);
  Serial.begin(9600); //can't be faster than 19200 for softserial

  if(DEBUG) {  
    while(!Serial);
  }

  pinMode(WIFI_ENABLE_PIN, OUTPUT);
  digitalWrite(WIFI_ENABLE_PIN, HIGH);

  sendData("AT\r\n", 5000);//Test AT startup
  sendData("AT+GMR\r\n", 5000);//View version info
  sendData("AT+CWMODE=1\r\n",5000);//WiFi mode
  sendData("AT+CWLAP\r\n", 5000);//List available APs
  sendData("AT+CWJAP=\"Project11x\",\"abcd1234\"\r\n",5000);
  sendData("AT+CIPMUX=0\r\n",5000);//get ip address
  sendData("AT+CIFSR\r\n",5000);
    
  Serial.println( "Start Socket server 1" );
}

void loop() {
  delay(5000);
  clearRx();
  sendData("AT+CIPSEND=0,4",6000);
  delay(1000);
  sendData("iopd",6000);
  delay(1000);
}

void clearRx() {
  while(Serial1.available() > 0) {
    Serial1.read();
  } 
}

String sendData(String command, const int timeout)
{
  String response = "";
  Serial1.println(command); // send the read character to the esp8266
  long int time = millis();
  while( (time+timeout) > millis()) {
    while(Serial1.available()) {
      // The esp has data so display its output to the serial window 
      char c = Serial1.read(); // read the next character.
      response+=c;
    }  
  }
  if(DEBUG) {
    Serial.print(response);
  }
  return response;
}

```

result:

L �  
;�a�+�’껩V|���TxxpA�뢹Χ��

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [July 21, 2016, 11:11am UTC](https://bbs.aprbrother.com/t/i-cannot-read-this-message/654/2 "2016-07-21T11:11:54Z")

</div>

What’s the baud rate of the serial monitor?

---

<div class="post-metadata">

**Author:** ![shockingjmh](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@shockingjmh](https://bbs.aprbrother.com/u/shockingjmh)\
**Post date:** [July 21, 2016, 11:40am UTC](https://bbs.aprbrother.com/t/i-cannot-read-this-message/654/3 "2016-07-21T11:40:37Z")

</div>

the baud rate of the serial monitor is 9600!

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [July 22, 2016, 3:28am UTC](https://bbs.aprbrother.com/t/i-cannot-read-this-message/654/4 "2016-07-22T03:28:31Z")

</div>

Have you re-flash the firmware for esp8266 to AT firmware? Please upload the sketch [hardwareSerialMonitor](https://github.com/AprilBrother/cactus-micro-r2/tree/master/libraries/CactusMicro/examples/hardwareSerialMonitor) to test AT command directly.

You can type AT command directly in serial monitor after sketch is uploaded. For example:

```auto
AT+GMR

```
