I recently bought two of these lora modules (AS32 TTL-100) and have tried several ways to transmit a "hello" message from one node to the other, but I am really unable to do so.
I have tried the following methods to accomplish the transmission.
Method-1
Connections :
AS32-TTL-100 - Arduino UNO
M0 ----- 7
M1 ----- 8
TX ----- RX (0)
RX ----- TX (1)
AUX ----- Not connected
VCC ----- 5v
GND ----- GND
Transmitter Code:
#define M0 7
#define M1 8
void setup()
{
Serial.begin(9600);
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
digitalWrite(M0,LOW);
digitalWrite(M1,LOW);
}
void loop()
{
Serial.println("Hello");
delay(500);
}
Receiver Code:
#define M0 7
#define M1 8
void setup()
{
Serial.begin(9600);
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
digitalWrite(M0,LOW);
digitalWrite(M1,LOW);
}
void loop()
{
if(Serial.available()>0)
{
String input = Serial.readString();
Serial.println(input);
}
}
Method -1 did not work, so I tried method-2 which is shown below.
Method-2
Connections :
AS32-TTL-100 - Arduino UNO
M0 ----- 7
M1 ----- 8
TX ----- 2
RX ----- 3
AUX ----- Not connected
VCC ----- 5v
GND ----- GND
Transmitter Code:
#include<SoftwareSerial.h>
SoftwareSerial mySerial (2,3);
#define M0 7
#define M1 8
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
digitalWrite(M0,LOW);
digitalWrite(M1,LOW);
}
void loop()
{
mySerial.println("Hello");
}
Receiver Code:
#include<SoftwareSerial.h>
SoftwareSerial mySerial (2,3);
#define M0 7
#define M1 8
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
digitalWrite(M0,LOW);
digitalWrite(M1,LOW);
}
void loop()
{
if(mySerial.available()>0)
{
String input = mySerial.readString();
Serial.println(input);
}
}
I tried all the above mentioned methods but I didn't get the desired output/result, infact the serial monitor in the receiver side just shows a blank screen.
I haven't done any configurations to the lora modules, all the configurations are default.
I am very new to these modules, I would be really thankful if somebody could help me out.
Thank You.
