Ebyte E32 LoRa problem with an E32-based development board

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.

couple of thoughts

  1. if the microcontroller is ESP32 based why are you using Software serial - the ESP32 has three hardware serial ports
  2. both the ESP32 and the E32 use 3.3V logic - why the voltage divider on the ESP32 Tx to E32 Rx?

I don't have an Ebyte E32 modules but using E220 modules in transparent mode
on a ESP32 I use the following pins

// E220 pin 1 M0  to ESP32 GND
// E220 pin 2 M1  to ESP32 GND
// E220 pin 3 RXD to ESP32 GPIO16 pullup to 3.3V
// E220 pin 4 TXD to ESP32 GPIO17 pullup to 3.3V
// E220 pin 5 AUX no connection
// E220 pin 6 VCC to ESP32 3.3V
// E220 pin 7 GND to ESP32 GND

have a look at lora-e32-device-for-arduino-esp32-or-esp8266-specs-and-basic-usage-part-1

Thanks for the reply,

So as you've mentioned, I did some fixes and removed the voltage dividers. I also added some pull-up resistors. Nothing was changed. Also, I checked the Deneyap Kart pinout and I couldn't see the extra hardware serial ports. I found another forum and saw a line like this:

Serial2.begin(9600, SERIAL_8N1, rx, tx);

I immediately tried this line but it didn't work. Additionally, Deneyap Kart went into a strange loop where it constantly prints out this error code:

rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13924
ho 0 tail 12 room 4
load:0x40080400,len:3600
entry 0x400805f0

I removed everything from the circuit and uploaded a blank code and it stopped spamming that error code. The problem seems to be in the circuit. I tried to change the pins from D0 and D1 to D8 and D9 but still, the same error persists.

Code for my last trial:

void setup() {
  Serial.begin(9600);
  delay(500);
 
  Serial.println("Hi, I'm going to send message!");
 
  Serial2.begin(9600, SERIAL_8N1, D8, D9);
  Serial2.println("Hello, world?");
}
 
void loop() {
  if (Serial2.available()) {
    Serial.write(Serial2.read());
  }
  if (Serial.available()) {
    Serial2.write(Serial.read());
  }
}

what happens if you disconnect the E32 from D8 and D9 and link D8 and D9 together to form a loopback test
characters entered on the keyboard should echo beck to the serial monitor display
if it fails try D14 and D15
if the loopback works it shows the program is communicating with the Serial2 OK and you can now connect the E32
do you have a pinout of the "Deneyap Kart" showing what ESP32 GPIO pins are connected to D0, D1, etc etc

Ok so this is strange, but I did a loopback test just like you described it and I received output from the serial monitor. However, when I tried D8 and D9 in particular, the messages were continuous for example if I press the letter 'a' on my keyboard, it repeatedly prints 'a'. I tried with other pins (D0 and D1, D14 and D15, etc.) but they just returned a single copy of what was inputted. So if I press the letter 'a' on my keyboard, the serial monitor just shows a single letter of a.

What is the speciality of the pins D8 and D9?

Also, here is a detailed pinout of the Deneyap Kart I found on the internet: Deneyap Kart Pinout

It's in a different language but I think it's still understandable. Let me know if you have a question about the documentation or the pinout

the echo of what is inputted shows the loopback is working and you can connect the E32 to D14 and D15

D8 is labeled on the pinout as "D8 - BOOT - GPKEY"
if I run the following code to print the GPIO values on an ESP32 with Tools>Board set to "Deneyap Kart"

void setup() {
Serial.begin(115200);
delay(3000);
Serial.println();
Serial.println(D8);
Serial.println(D9);
Serial.println(D14);
Serial.println(D15);
}

void loop() {}

serial monitor displays

0
2
14
27

D8 appears to be GPIO0 which on the esp32-pinout-reference-gpios is
outputs PWM signal at boot, must be LOW to enter flashing mode
also on the "Deneyap Kart" pinout it is connected to "GPKEY"
both indicate it is only usable as a general GPIO pin with care and should be avoided if possible

this shows the problems the "Deneyap Kart" pinout not displaying the ESP32 GPIO values, e.g. "D8 - BOOT - GPKEY" is vague - also showing the GPIO would be useful

hopefully using D14 and D15 should get the E32 operational

Unfortunately, that didn't help either.

E32 pin 1 M0 to Deneyap Kart D7
E32 pin 2 M1 to Deneyap Kart D6
E32 pin 3 RXD to Deneyap Kart D15 (PULLUP 3.3V)
E32 pin 4 TXD to Deneyap Kart D14 (PULLUP 3.3V)
E32 pin 5 AUX no connection
E32 pin 6 VCC to Deneyap Kart 5V
E32 pin 7 GND to Deneyap Kart GND

I tried different codes, mainly from the LoRa_E32.h Library. I have no idea what could be wrong

I connected E32 modules to a USB-TTL converter and I can see their configurations are the same except for addresses from the RF_Setting program.

I will be off for a week, so I might not be able to test everything but I will return in 5 days or so

Thanks for your help through here so far

Okay so I tried various solutions, but none of them worked clearly.

I changed the parts, Deneyap karts, E32 LoRa modules, and code, but nothing.

Then accidentally, when I was trying to disassemble the circuit, I realized that when I removed the antenna, Deneyap Kart stopped resetting itself. Thus, I tried the actual code with another antenna, and it worked flawlessly. A small antenna caused all of this mess. I suspect there is a short circuit in the broken antenna and it somehow causes Deneyap kart to reset itself.

I really appreciate the effort given to me. Thanks for everything.