user57331: I’m try to get data from rs485 is not work please advise to me.
1.  Try to connect PC usb485 to DY-MD02 is work.
    Send command “AUTO” or “READ”

2.  Try to Arduino rs485 shield to DY-MD02 is not work.
    Send command “AUTO”

my code
''''
char command[4] = {'A', 'U', 'T', 'O'};

int n = sizeof(command)/sizeof(command[0]);   // Number of elements in an array

String incoming = "";   // for incoming serial string data

void setup()

{

      // initialize serial ports
      Serial.begin(9600);
      pinMode(EN,OUTPUT);
      digitalWrite(EN,HIGH); //Enable high, RS485 shield waiting to transmit data
      Serial.write(command,n); //Test send command Auto,Read to RS485
      delay(500);
}

void loop()

{

      String temp;
      digitalWrite(EN,LOW); //Enable low, RS485 shield waiting to receive data

      while(Serial.available() > 0 )
      {
          temp=Serial.read();
          Serial.println(temp);
          delay(1000); //Delay for some time, waiting for data transmitted
      }

}

''''

if change code to = Serial.readString() not show anything.
please help me
Thank 




to Juraj
Maker tell me can connect with Arduino uno and send manual to me.
see in attach file.






user57331: i'm tray change this code to readStringUntil, is OK
if(Serial.available() > 0)
  {
    temp = Serial.readStringUntil('\n');
    Serial.println(temp);
    delay(1000); //Delay for some time, waiting for data transmitted
  } 

Thank all for help me
^^

57331: <p>I’m try to get data from rs485 is not work please advise to me.</p>

<pre><code>1.  Try to connect PC usb485 to DY-MD02 is work.
    Send command “AUTO” or “READ”

2.  Try to Arduino rs485 shield to DY-MD02 is not work.
    Send command “AUTO”
</code></pre>

<p>my code</p>

<p>''''</p>

<pre><code>char command[4] = {'A', 'U', 'T', 'O'};

int n = sizeof(command)/sizeof(command[0]);   // Number of elements in an array

String incoming = "";   // for incoming serial string data

void setup()

{

      // initialize serial ports
      Serial.begin(9600);
      pinMode(EN,OUTPUT);
      digitalWrite(EN,HIGH); //Enable high, RS485 shield waiting to transmit data
      Serial.write(command,n); //Test send command Auto,Read to RS485
      delay(500);
}

void loop()

{

      String temp;
      digitalWrite(EN,LOW); //Enable low, RS485 shield waiting to receive data

      while(Serial.available() &gt; 0 )
      {
          temp=Serial.read();
          Serial.println(temp);
          delay(1000); //Delay for some time, waiting for data transmitted
      }

}
</code></pre>

<p>''''</p>

<hr>

<p>if change code to = <strong><em>Serial.readString()</em></strong> not show anything.</p>

<p>please help me
Thank </p>

<p><a href="https://i.stack.imgur.com/0eNHG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0eNHG.jpg" alt="XY-MD02"></a></p>

<p><a href="https://i.stack.imgur.com/qVQhy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qVQhy.jpg" alt="PC USB485 is OK"></a></p>

<p><a href="https://i.stack.imgur.com/QkixI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QkixI.jpg" alt="Data"></a></p>

<hr>

<p>to Juraj</p>

<p>Maker tell me can connect with Arduino uno and send manual to me.</p>

<p>see in attach file.</p>

<p><a href="https://i.stack.imgur.com/0eNHG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0eNHG.jpg" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/qVQhy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qVQhy.jpg" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/QkixI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QkixI.jpg" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/36RbV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/36RbV.jpg" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/LhCWp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LhCWp.jpg" alt="enter image description here"></a></p>
 57331: <p>i'm tray change this code to readStringUntil, is OK</p>

<pre><code>if(Serial.available() &gt; 0)
  {
    temp = Serial.readStringUntil('\n');
    Serial.println(temp);
    delay(1000); //Delay for some time, waiting for data transmitted
  } 
</code></pre>

<p>Thank all for help me
^^</p>
