When i sent a single character like '1', the speed is painfully slow (both sender and receiver are in the same room). It takes 2 seconds to show up on the serial monitor of the receiving end. What causes this? Would a 2.4GHz lora make it faster?! since it claims less latency. Could it be the IDE, or would using a different microcontroller on the receiving end like an ST help?
/*
* LoRa E32-TTL-100
* Write on serial to transfer a message to other device
* https://www.mischianti.org
*
* E32-TTL-100----- Arduino UNO
* M0 ----- GND
* M1 ----- GND
* TX ----- PIN 2 (PullUP)
* RX ----- PIN 3 (PullUP & Voltage divider)
* AUX ----- Not connected
* VCC ----- 3.3v/5v
* GND ----- GND
*
*/
#include "Arduino.h"
#include "LoRa_E32.h"
LoRa_E32 e32ttl100(2, 3); // e32 TX e32 RX
void setup() {
Serial.begin(9600);
delay(500);
Serial.println("Hi, I'm going to send message!");
// Startup all pins and UART
e32ttl100.begin();
// Send message
ResponseStatus rs = e32ttl100.sendMessage("Hello, world?");
// Check If there is some problem of successfully send
Serial.println(rs.getResponseDescription());
}
void loop() {
// If something available
if (e32ttl100.available()>0) {
// read the String message
ResponseContainer rc = e32ttl100.receiveMessage();
// Is something goes wrong print error
if (rc.status.code!=1){
rc.status.getResponseDescription();
}else{
// Print the data received
Serial.println(rc.data);
}
}
if (Serial.available()) {
String input = Serial.readString();
e32ttl100.sendMessage(input);
}
}
This is the current code being tested, if i remove string code i wouldnt know what to place it with. If i remove string completely it will give an error
The e32 modules are a LoRa module with microcontroller and UART in front of it.
The issue your having is not to do with the LoRa device itself but the specific firmware used by the microcontroller and UART in the e32.
These UART based modules will have a degree of latency since the UART front end has to have a timout of sorts, it waits a period after serial input has stopped before deciding when to send a packet. Details in the devices datasheet.
I read the documentation and used Serial.setTimeout(1); IT DOES make it a second faster yay ....what do you mean by dropping the string? because i tried using readStringUntil but that doesnt change anything..... what does dropping the string entail?
LoRa modules are SPI based and there are several libraries that make it easy to send data or variables or structures.
Its possible that someone might come up with a solution you want for these E32 modules, but the majority of LoRa stuff is done using the SPI modules and for good reasons.