Hello, I hope it is okay to post a question like this on this forum, as this is not regarding a Seeed product. I’m still getting familiar.
I’m making an attempt to use a Reyax RYLR896 module, however it is not working. Any input would be much appreciated.
I have looked at a number of tutorials, both video and text, and have tried to boil it down to a simple proof-of-concept design.
The connections seem quite simple:
Arduino - RYLR896:
3.3v to Vdd
gnd to gnd
Tx to Rx (through 5v to 3.3v voltage divider)
Rx to Tx
Here is the wiring diagram I followed: (Note: I used a 5K5 instead of 4K7 so the voltage wouldn’t be over 3.3V.)
This is my code. It reads a “sensor” (translate: variable resistor.) Distilled from this page:
(Note however, I could not get the code as written in the article to work either. I also tried another example which used SoftwareSerial, but couldn’t get it to work either.)
Transmitter:
int vresistor = A0;
void setup() {
Serial.begin(115200);
pinMode(vresistor,INPUT);
}
void loop() {
int sensorvalue = analogRead(vresistor);
String sensorvaluestr = String(sensorvalue);
String datalength = String(sensorvaluestr.length());
String mymessage = "AT+SEND=0," + datalength + "," + sensorvaluestr + "\r\n";
Serial.println(mymessage);
delay(100);
}
Receiver:
void setup() {
Serial.begin(115200);
Serial.print("AT\r\n");
delay(100);
}
void loop() {
if (Serial.available()) {
String rcvdData = Serial.readString();
Serial.println(rcvdData);
}
}
Note: I have since realized the use of Strings is not recommended and not needed here, but this should give an idea of what I have done.
I have also attempted to communicate with the RYLR896 using AT commands per this video tutorial:
Per instruction on the tutorial, I reversed the Tx/Rx connections on the Arduino (now Tx on Arduino to Tx on transceiver; Rx on Arduino to Rx on transceiver, through voltage divider,) have baud of the serial monitor set at 115200, and line endings set to “Both NL & CR”. I send the command “AT” expecting “+OK” in return, I get no responses, not even an error. Sending “AT+ADDRESS?” gives no response either.
I purchased 2 modules when I started this, and have the same results with both.
I’m beginning to wonder if I have bad modules or bad luck.
The aforementioned video instructed to remove the Tx/Rx connections on the Arduino before uploading a program which I did not do when following the first tutorial (it wasn’t mentioned there.) I don’t know if that can damage the transceiver modules, but it doesn’t seem like it would.