I'm making an attempt to use an 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
Rx to Tx
This is my code. It reads a "sensor" (variable resistor.) Distilled from this page:
Sensor Monitoring using Lora by Reyax- This is my second tutorial on the Reyax rylr890/rylr896 15km 915Mhz Transceiver module, Arduino code and circuit...
Est. reading time: 9 minutes
(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);
}
}
A schematic would be appreciated.
Can you see the transmitter messages on the serial monitor?
(And why Strings?)
That is the transmitter, the receiver is the same except without the pot.
(And why Strings?)
Because I was getting errors when I just tried concatenating the ints.
You don't need to concatenate anything.
The serial line will do that for you
"You don't need to concatenate anything.
The serial line will do that for you "
But doing it the way I did shouldn't make it not work, should it?
It shouldn't , I agree, but I like to keep things simple.
Anyway, good luck.
String mymessage = "AT+SEND=0," + datalength + "," + sensorvaluestr + "\r\n";
Serial.println(mymessage);
is not as simple as this?
Serial.print("AT+SEND=0,");
Serial.print(int);
Serial.print(",");
Serial.print(int);
Serial.println("\r\n");
Or is there another way of doing this of which I am unfamiliar?
IMO, the second is simpler.
And it has the huge (IMO) bonus that it doesn't use Strings.
Oh, I get it now. I assume Strings use a lot of processing/memory.
system
Closed
September 2, 2022, 5:25pm
11
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.