Hi All,
I am developing a system with LoRa (REYAX RYLR890) and Arduino pro mini.
So far, I've set and tested, and everything worked out. (A single transmitter to a single receiver)
But, when I tried to communicate two transmitters to one receiver, the receiver can only read one of them.
For example,
Transmitter Address : 0,2
Receiver Address: 1
Receiver Serial Monitor says
(turn on tx 0)
RCV + 0, ~~~
RCV + 0, ~~~
RCV + 0, ~~~
(turn on tx 2 as well)
RCV + 2, ~~~
RCV + 2, ~~~
RCV + 2, ~~~
(turn off tx 2)
RCV + 0, ~~~
RCV + 0, ~~~
RCV + 0, ~~~
....
What I expected
(turn on tx 0 and 2)
RCV + 0, ~~~
RCV + 2, ~~~
RCV + 0, ~~~
RCV + 2, ~~~
RCV + 0, ~~~
Lora can communicate only one to one?
or, what should I have to do for this system?
I will increase the number of transmitters in the future. (i.e., multiple transmitter to a single receiver)
Thank you!
FYI)
<<>>
#include "Adafruit_MCP9808.h"
#include <Wire.h>
Adafruit_MCP9808 tempsensor = Adafruit_MCP9808();
#define ledPin 2
unsigned long lastTransmission;
const int interval = 200;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
if (!tempsensor.begin()) {
Serial.println("Couldn't find MCP9808!");
while (1);
}
}
void loop() {
// put your main code here, to run repeatedly:
//delay(1000);
//float f = c * 9.0 / 5.0 + 32;
//Serial.print("Temp: "); Serial.print(c); Serial.print("*C\t");
//Serial.print(f); Serial.println("*F");
if (millis() > lastTransmission + interval) {
//Transmission Due!
float c = tempsensor.readTempC();
String msg = "AT+SEND=1,8,"+String(c)+"ºC";
Serial.println(msg);
//Serial.println("AT+SEND=1,8,",C);
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
lastTransmission = millis();
}
}
<<>>
#define ledPin 2
String incomingString;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
Serial.println("Ready");
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available()) {
incomingString = Serial.readString();
if (incomingString.indexOf("ºC") > 0) {
digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
Serial.println("received: " + incomingString);
}
}
}