xreef / EByte_LoRa_E22_Series_Library

Arduino LoRa EBYTE E22 device library complete and tested with Arduino, esp8266, esp32, STM32 and Raspberry Pi Pico (rp2040 boards).. sx1262/sx1268
Other
104 stars 22 forks source link

Help #28

Closed JayZeeM closed 1 month ago

JayZeeM commented 6 months ago

416027946_1106567173810547_8344353452171204456_n

Hello im trying to use this code for the receiver with the connections above

define E22_30

define FREQUENCY_868

include "Arduino.h"

include "LoRa_E22.h"

LoRa_E22 e22ttl(3, 1, &Serial2, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e22 TX, esp32 TX --> e22 RX AUX M0 M1

void setup() { Serial.begin(9600); delay(500);

Serial.println("Hi, I'm going to send message!");

// Startup all pins and UART e22ttl.begin();

ResponseStructContainer c;
c = e22ttl.getConfiguration();
// It's important get configuration pointer before all other operation
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);

configuration.ADDL = 0x18; // First part of address configuration.ADDH = 0x00; // Second part configuration.NETID = 0x00; // NETID used for repeater function configuration.CHAN = 18; configuration.OPTION.transmissionPower = POWER_24; }

void loop() { // If something available if (e22ttl.available()>1) { // read the String message ResponseContainer rc = e22ttl.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(); e22ttl.sendMessage(input); } delay(5000); }

JayZeeM commented 6 months ago

and this for the sender

define E22_30

define FREQUENCY_868

include "Arduino.h"

include "LoRa_E22.h"

LoRa_E22 e22ttl(3, 1, &Serial2, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e22 TX, esp32 TX --> e22 RX AUX M0 M1

void setup() { Serial.begin(9600); delay(500);

Serial.println("Hi, I'm going to send message!");

// Startup all pins and UART e22ttl.begin();

ResponseStructContainer c;
c = e22ttl.getConfiguration();
// It's important get configuration pointer before all other operation
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);

configuration.ADDL = 0x18; // First part of address configuration.ADDH = 0x00; // Second part configuration.NETID = 0x00; // NETID used for repeater function configuration.CHAN = 18; configuration.OPTION.transmissionPower = POWER_24;

}

void loop() {

// Send message ResponseStatus rs = e22ttl.sendMessage("Hello, world?"); // Check If there is some problem of successfully send Serial.println(rs.getResponseDescription());

delay(10000);

}

but the receiver isn't showing anything only this image

xreef commented 6 months ago

Hi Jay, check that all the values of the configuration are correct. Bye Renzo