Hello everyone,
So I have two Ebyte E32-433T30D model LoRa modules. I also have two "Deneyap Kart"s, which are basically ESP32-based development boards. You can access the documentation from here. I want to transmit data wirelessly.
I made a prototype that worked perfectly. Henceforth, I ordered brand new Deneyap Karts and E32-433T30D modules. However, they just stopped working all of a sudden. I tried to replicate the prototype I made beforehand, but it stopped working even when I used the same modules. I really don't understand what I've been doing wrong.
Here is a schematic for the circuits:
I tried uploading the sample codes from the LoRa_E32.h
library. But still, no transmission. I can receive parameters from LoRa modules with the code named arduinoGetConfiguration
when I alter the code a bit.
Here are the old codefiles that used to work between the modules, if it does help any.
Transmitter Code:
#define E32_TTL_1W
#include "LoRa_E32.h"
#include <SoftwareSerial.h>
#include <deneyap.h>
SoftwareSerial mySerial(D1, D0);
LoRa_E32 E32_sensor(&mySerial);
#define M0 D7
#define M1 D6
#define Address 1
#define Channel 23
#define TargetAddress 2
void setup() {
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
Serial.begin(9600);
E32_sensor.begin();
LoraE32Ayarlar();
digitalWrite(M0, LOW);
digitalWrite(M1, LOW);
delay(500);
}
void loop() {
int data = 1;
Serial.println(".");
ResponseStatus rs = E32_sensor.sendFixedMessage(highByte(TargetAddress), lowByte(TargetAddress), Channel, &data, sizeof(int));
delay(1000);
}
void LoraE32Ayarlar() {
digitalWrite(M0, HIGH);
digitalWrite(M1, HIGH);
ResponseStructContainer c;
c = E32_sensor.getConfiguration();
Configuration configuration = *(Configuration*)c.data;
//DEĞİŞEBİLEN AYARLAR
configuration.ADDL = lowByte(Address);
configuration.ADDH = highByte(Address);
configuration.CHAN = Channel;
configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
configuration.OPTION.transmissionPower = POWER_30;
configuration.SPED.uartBaudRate = UART_BPS_9600;
configuration.SPED.uartParity = MODE_00_8N1;
configuration.OPTION.fec = FEC_0_OFF;
configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;
configuration.OPTION.wirelessWakeupTime = WAKE_UP_250;
configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS;
ResponseStatus rs = E32_sensor.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
Serial.print("Ayarlar Durum: "); Serial.println(rs.getResponseDescription());
c.close();
}
Receiver Code:
#define E32_TTL_1W
#include "LoRa_E32.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial(D1, D0);
LoRa_E32 E32_sensor(&mySerial);
#define M0 D7
#define M1 D6
#define Address 2
#define Channel 23
void setup() {
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
Serial.begin(9600);
E32_sensor.begin();
LoraE32Ayarlar();
digitalWrite(M0, LOW);
digitalWrite(M1, LOW);
delay(500);
}
void loop() {
while (E32_sensor.available() > 1) {
ResponseStructContainer rsc = E32_sensor.receiveMessage(sizeof(int));
int x = *(int*) rsc.data;
rsc.close();
Serial.println(x);
}
}
void LoraE32Ayarlar() {
digitalWrite(M0, HIGH);
digitalWrite(M1, HIGH);
ResponseStructContainer c;
c = E32_sensor.getConfiguration();
Configuration configuration = *(Configuration*)c.data;
configuration.ADDL = lowByte(Address);
configuration.ADDH = highByte(Address);
configuration.CHAN = Channel;
configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
configuration.OPTION.transmissionPower = POWER_30;
configuration.SPED.uartBaudRate = UART_BPS_9600;
configuration.SPED.uartParity = MODE_00_8N1;
configuration.OPTION.fec = FEC_0_OFF;
configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;
configuration.OPTION.wirelessWakeupTime = WAKE_UP_250;
configuration.OPTION.ioDriveMode = IO_D_MODE_PUSH_PULLS_PULL_UPS;
ResponseStatus rs = E32_sensor.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
c.close();
}
I would appreciate any help, I am stuck on this issue for a while now.