6v6gt:
You have to add something like this to the loop() to transfer the command string from the serial console to the device om mySerial:if (Serial.available() > 0) {
mySerial.write(Serial.read());
}
The carriage return and line feed are delivered automatically when the appropriate setting is chosen in the serial console.
Or, you could have the Arduino send the command directly.
mySerial.println("a");
and then read any response EXACTLY the same way you read from the sensor now.
Of course, you clearly don't have a mySerial connected to the Arduino, so mySerial is a dumb name. But that's a different issue.