Coder Social home page Coder Social logo

xreef / ebyte_lora_e22_series_library Goto Github PK

View Code? Open in Web Editor NEW
95.0 15.0 21.0 2.64 MB

Arduino LoRa EBYTE E22 device library complete and tested with Arduino, esp8266, esp32, STM32 and Raspberry Pi Pico (rp2040 boards).. sx1262/sx1268

License: Other

C++ 79.29% C 20.71%
arduino esp8266 esp32 lora ebyte e22 stm32 10km arduino-samd-boards arduino-library

ebyte_lora_e22_series_library's Introduction

 

Renzo Mischianti

www.mischianti.org

 
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
 

 
 

ebyte_lora_e22_series_library's People

Contributors

xreef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ebyte_lora_e22_series_library's Issues

Wrong interpretation of returned string on WRITE_CFG_PWR_DWN_LOSE

When saving configuration on E22 UART module, C2 is the command that saves settings only temporary (not on persistent memory).
Unfortunately, code does not understand that the response command is still C1 as per eByte datasheet, but expects it to be the same as the command sent (C2).

Configuration saves fine anyways.

if (RETURNED_COMMAND != ((Configuration *)&configuration)->COMMAND || REG_ADDRESS_CFG!= ((Configuration *)&configuration)->STARTING_ADDRESS || PL_CONFIGURATION!= ((Configuration *)&configuration)->LENGHT){

Build error on

I am receiving a build error on the EByte library. It is related to the following conflict.
termios.h:
#define B110 3

binary.h:
#define B011 3
#define B110 6

Building this LoRa library generates the following error when the VFS framework for ESP32 is included.
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h: In function 'String getUARTBaudRateDescriptionByParams(byte)':
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h:157:4: error: duplicate case value
case UART_BPS_57600:
^
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h:148:4: error: previously used here
case UART_BPS_9600:
^
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h: In function 'String getAirDataRateDescriptionByParams(byte)':
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h:203:4: error: duplicate case value
case AIR_DATA_RATE_110_384:
^
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h:194:4: error: previously used here
case AIR_DATA_RATE_011_48:
^
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h: In function 'String getWORPeriodByParams(byte)':
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h:294:4: error: duplicate case value
case WOR_3500_000:
^
C:\Users\blue_\Documents\Arduino\libraries\EByte_LoRa_E22_Series_Library-master/includes/statesNaming.h:285:4: error: previously used here
case WOR_2000_011:
^

I have detailed the source of the problem in the following ticket. But I don't anticipate it being fixed any time soon.

espressif/esp-idf#7678 (comment)

The best workaround for this is to avoid using the BXXX macros for your enumerations in statesNaming.h. This will resolve the problem.

Support E32868T30D based on SEMTECH's SX1276 RF

Hi there
i try setup E32868T30D Lora Module using this library with no success
is there any guide about how i can setup and get it work?
when i setup wiring and run arduinoGetConfiguration
i get now response from module check wiring
best regards

Need your help with transporting audio over Lora

I have been using your great library for testing range of Ebyte E22 modules and it works perfectly.

I have following sketch which send sine wave data over ESPNow wireless link and playing it on other side via headphone connected to ESP32's internal DAC. It works fine.

Now I want to send same sine wave data using E22 modules (broadcast mode) instead of ESPNow for longer range.

Is it possible ? If so can please show me example ?

My sketch is below:

#include <WiFi.h>
#include <esp_now.h>

#define lineIn ADC1_CHANNEL_0          // ADC 1 channel 0 GPIO36 for analog microphone connecttion
#define lineOut 25                     // DAC pin for headphone or amplified speaker connection
#define touchThreshold 50              // TTT (Touch To Transmit) threshold
#define audioBytes  240                // ESPNow allow upto 250 bytes packets

uint8_t audioData[audioBytes] = 
   
   // Sin wave
    {
    0x80, 0x83, 0x87, 0x8A, 0x8E, 0x91, 0x95, 0x98, 0x9B, 0x9E, 0xA2, 0xA5, 0xA7, 0xAA, 0xAD, 0xAF,
    0xB2, 0xB4, 0xB6, 0xB8, 0xB9, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xBF, 0xBF, 0xC0, 0xBF, 0xBF, 0xBF,
    0xBE, 0xBD, 0xBC, 0xBB, 0xB9, 0xB8, 0xB6, 0xB4, 0xB2, 0xAF, 0xAD, 0xAA, 0xA7, 0xA5, 0xA2, 0x9E,
    0x9B, 0x98, 0x95, 0x91, 0x8E, 0x8A, 0x87, 0x83, 0x80, 0x7C, 0x78, 0x75, 0x71, 0x6E, 0x6A, 0x67,
    0x64, 0x61, 0x5D, 0x5A, 0x58, 0x55, 0x52, 0x50, 0x4D, 0x4B, 0x49, 0x47, 0x46, 0x44, 0x43, 0x42,
    0x41, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x41, 0x42, 0x43, 0x44, 0x46, 0x47, 0x49, 0x4B,
    0x4D, 0x50, 0x52, 0x55, 0x58, 0x5A, 0x5D, 0x61, 0x64, 0x67, 0x6A, 0x6E, 0x71, 0x75, 0x78, 0x7C
   };
  
// REPLACE WITH YOUR RECEIVER MAC Address
uint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};

void OnDataRecv(const uint8_t * mac, const uint8_t *data, int len) {
  uint8_t audioIn;
  for (int i=0;i<len;i++) {
    audioIn += (uint8_t)data[i];
   dacWrite(lineOut, audioIn);
  }
}

void setup() {
  Serial.begin(115200);
  while(!Serial){};
  delay(500);
  Serial.println();

  // Set device as a Wi-Fi Station
  WiFi.mode(WIFI_STA);

  // Init ESP-NOW
  if (esp_now_init() != ESP_OK) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  esp_now_register_recv_cb(OnDataRecv);
 
  // Register peer
  esp_now_peer_info_t peerInfo;
  memcpy(peerInfo.peer_addr, broadcastAddress, 6);
  peerInfo.channel = 0;  
  peerInfo.encrypt = false;
  
  // Add peer        
  if (esp_now_add_peer(&peerInfo) != ESP_OK){
    Serial.println("Failed to add peer");
    return;
  }

  Serial.println("Setup complete, move over to the Loop");
}
 
void loop() {
  
  if (touchRead(12) < touchThreshold )
  {     
       // Send audio packet via ESP-NOW
       esp_err_t result = esp_now_send(broadcastAddress, (const uint8_t *) audioData, audioBytes); 
   }
} //End of Loop

Thanks.

ESP32-E22 No response from device

Hello,
First of all thank you for your work in this library, looks good!
I am having E22 Connected to ESP 32 I loaded couple examples, I have the following definition for ESP32 pins:
// ---------- esp32 pins --------------
LoRa_E22 e22ttl100(&Serial2, 15, 21, 19); // RX AUX M0 M1
I Always gets "No response from device! (Check wiring)"
wiring is ok.
Module actually transmits, I am able to see when transmitting using SDR sharp.
I just get the error at initialization.
I also tried the example Arduino_e22_getConfiguration, and I got this:

No response from device! (Check wiring)
12
No response from device! (Check wiring)
12

Model no.: 112
Version : 111
Features : 1101110

these are my connections with ESP32

  • E22 ----- esp32
  • M0 ----- 21
  • M1 ----- 19
  • RX ----- TX2 (PullUP, 4.7k)
  • TX ----- RX2 (PullUP, 4.7k )
  • AUX ----- 15 (PullUP 4.7k)
  • VCC ----- 3.3v
  • GND ----- GND

Compile Error for STM32 Core for Arduino

Hello I know this libary is not supposed to work with STM32 but it does with a little fix.
Right now there is a conflict in naming:
statesNaming.h:20:13: error: 'SUCCESS' conflicts with a previous declaration 20 | SUCCESS = 1,
with
stm32f1xx.h:166:3: note: previous declaration 'ErrorStatus SUCCESS' 166 | SUCCESS = 0U,

The compile error can be avoided if SUCCESS gets renamed.

Guru meditation error triggered within receiveStruct routine(s)

Hello,

I am using your library in a project that has an ESP32 in the master device and a Raspberry Pi PICO in the slave device.

The modules I am using are the E22-900T30S.

I am using the platformIO environment and have enabled the exception decoder to help diagnose the dump provided by the ESP32 when the Guru Meditation error occurs.

The the system operates for some time (say 5 minutes or more) where the master is sending packets to the slave and the slave responds. This is occuring at about 3 times per second.

When the crash occurs, this is the exception decode captured:

Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400db8af PS : 0x00060b30 A0 : 0x80112d00 A1 : 0x3ffca3f0
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000074 A5 : 0x3ffc1fc0
A6 : 0x00060120 A7 : 0x00000001 A8 : 0x800db8ac A9 : 0x3ffca3d0
A10 : 0x00000000 A11 : 0x00001800 A12 : 0x3f40bb9e A13 : 0x00000003
A14 : 0x00000008 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000 LBEG : 0x4008626c LEND : 0x40086276 LCOUNT : 0x00000000

Backtrace:0x400db8ac:0x3ffca3f00x40112cfd:0x3ffca410 0x400da07d:0x3ffca430 0x400da4f0:0x3ffca450 0x400da59c:0x3ffca490 0
x400d6533:0x3ffca4c0

#0 0x400db8ac:0x3ffca3f0 in Stream::readBytes(char*, unsigned int) at C:/Users/T520/.platformio/packages/framework-ar
duinoespressif32/cores/esp32/Stream.cpp:286
#1 0x40112cfd:0x3ffca410 in Stream::readBytes(unsigned char*, unsigned int) at C:/Users/T520/.platformio/packages/fra
mework-arduinoespressif32/cores/esp32/Stream.h:103
#2 0x400da07d:0x3ffca430 in LoRa_E22::receiveStruct(void*, unsigned short) at lib/EByte_LoRa_E22_Series_Library/LoRa_
E22.cpp:463
#3 0x400da4f0:0x3ffca450 in LoRa_E22::receiveMessageComplete(unsigned char, bool) at lib/EByte_LoRa_E22_Series_Librar
y/LoRa_E22.cpp:781
#4 0x400da59c:0x3ffca490 in LoRa_E22::receiveMessageRSSI(unsigned char) at lib/EByte_LoRa_E22_Series_Library/LoRa_E22
.cpp:774
#5 0x400d6533:0x3ffca4c0 in Task_RadioLink(void*) at src/main.cpp:558

As you can see, the top level call is to receiveMessageRSSI()

I have a struct that I am passing and this is 116 bytes long.

I was using the following in my call;

rsc = e22ttl.receiveMessageRSSI(sizeof(padControllerData));

but due to this problem occuring I thought I should try a dedicated variable set to this size

rsc = e22ttl.receiveMessageRSSI(padControllerDataSize); where padControllerDataSize is defined as an unsigned char

This has had no effect.

I then looked into your library and found the call I believe is causing this fault: (I added some debug prints to help isolate the issue)

`Status LoRa_E22::receiveStruct(void *structureManaged, uint16_t size_) {
Status result = E22_SUCCESS;

DEBUG_PRINT(" structure size: ");		// added CS 9/11
DEBUG_PRINTLN(size_);					// added CS 9/11
DEBUG_PRINT("calling readBytes ");      // added CS 9/11

uint8_t len = this->serialDef.stream->readBytes((uint8_t *) structureManaged, size_);

DEBUG_PRINT("Available buffer: ");
DEBUG_PRINT(len);

/* DEBUG_PRINT(" structure size: ");
DEBUG_PRINTLN(size_);
*/
if (len!=size_){
if (len==0){
result = ERR_E22_NO_RESPONSE_FROM_DEVICE;
}else{
result = ERR_E22_DATA_SIZE_NOT_MATCH;
}
}
if (result != E22_SUCCESS) return result;

result = this->waitCompleteResponse(1000);
if (result != E22_SUCCESS) return result;

return result;

}
`

The last debug just prior to the Guru Meditation error is:

structure size: 116
calling readBytes Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

So this shows the error is occuring on the call;

uint8_t len = this->serialDef.stream->readBytes((uint8_t *) structureManaged, size_);

Is there something that can be done to ensure the pointer 'structureManaged' is valid before making this call to readBytes?

Super keen to get assistance on this as my project is not stable or usable with this error.

NodeMCU wiring

Hi,

Thank you for your great work.

I'm using E22-900T30S with NodeMCU V3, so I guess I should use the wiring and code for esp8266.
Here is my wiring:

E22	esp8266
------------------
M0	D7
M1	D6
TX	PIN D2 (PullUP 4,7KΩ)
RX	PIN D3 (PullUP 4,7KΩ)
AUX     PIN D5 (PullUP 4,7KΩ)
VCC	3.3v
GND	GND

To get started I use the esp8266_e22_getConfiguration code.
But got error:

No response from device! (Check wiring)
12
----------------------------------------
HEAD : 0 0 0
 
AddH : 0
AddL : 0
NetID : 0
 
Chan : 0 -> 410MHz
 
SpeedParityBit     : 0 -> 8N1 (Default)
SpeedUARTDatte     : 0 -> 1200bps
SpeedAirDataRate   : 0 -> 0.3kbps
 
OptionSubPacketSett: 0 -> 240bytes (default)
OptionTranPower    : 0 -> 22dBm (Default)
OptionRSSIAmbientNo: 0 -> Disabled (default)
 
TransModeWORPeriod : 0 -> 500ms
TransModeTransContr: 0 -> WOR Receiver (default)
TransModeEnableLBT : 0 -> Disabled (default)
TransModeEnableRSSI: 0 -> Disabled (default)
TransModeEnabRepeat: 0 -> Disabled (default)
TransModeFixedTrans: 0 -> Transparent transmission (default)
----------------------------------------
No response from device! (Check wiring)
12
----------------------------------------
HEAD: 0 0 0
Model no.: 61
Version  : 72
Features : 65
----------------------------------------

Did I do something wrong? Or NodeMCU if supported use different wiring?

Thanks

FREQUENCY_915 is incorrect

Thank you in advance!

'OPERATING_FREQUENCY' is set to 850
I set it to 902 in my copy of statesNaming.h
But I am not sure if that is correct.
Is it supposed to be bottom of the band?

#elif defined(FREQUENCY_868)
#define OPERATING_FREQUENCY 850
#elif defined(FREQUENCY_915)

// This is incorrect? #define OPERATING_FREQUENCY 850. <<<<<
#define OPERATING_FREQUENCY 902 // LORA_HBO 2022-12-27
#else
#define OPERATING_FREQUENCY 410
#endif

setConfiguration reports
Chan : 0 -> 902MHz

https://www.baranidesign.com/faq-articles/2019/4/23/lorawan-usa-frequencies-channels-and-sub-bands-for-iot-devices

Use the module to send data to TTN

Hello, is there any information available regarding the usage with ttn? Can't find anything about that in the repo like AppKey, EUI etc..

questions about E22-900M22S

Hello,
I am looking into the E22-900M22S chip. Can i use it with your library?
Also, in your examples you use the E22-900T22S U chip which has the pins M0, M1 and AUX but the E22-900M22S has DI01 and DIO2 and BUSY. Can i assume that DIO1 is M0, DIO2 is M1 and BUSY is AUX?

thanks

How to add key for e22 lora modules

Well i can cahnge all parameters with your library thanks 🙏. But i cant change the password which is key labelled as at the Rf setting software.

Screenshot_20230110_044234_Chrome

This code only works 72 times with arduino

`#include "LoRa_E22.h"
#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11);

/*
   Pinler     Arduino Nano    Lora E32 433T20d
                  11                3
                  10                4
*/

LoRa_E22 E22(&mySerial);

struct Signal {
  char type[4] = "Urfa";
  byte role[4];
} data;


#define M0 7
#define M1 6
#define BTN 2
#define LED 9


byte i = 0;

void setup() {
  pinMode(M0, OUTPUT);
  pinMode(M1, OUTPUT);
  digitalWrite(M0, LOW);
  digitalWrite(M1, LOW);

  Serial.begin(9600);
  E22.begin();

}

void loop() {

  struct Signal {
    char type[4] = "Urfa";
    byte role[4];
  } data;

  i = i + 1;

  *(int*)( data.role) = i;

  ResponseStatus rs = E22.sendFixedMessage(0, 1, 25, &data, sizeof(Signal));
//  Serial.println(rs.getResponseDescription());
  Serial.print ("data: "); Serial.println(i);

  delay(1000);
}`

this works until i = 72 after that struct is loosing itselfs

Output:

20:58:09.000 -> data: 1 20:58:10.118 -> data: 2 20:58:11.282 -> data: 3 20:58:12.404 -> data: 4 20:58:13.529 -> data: 5 20:58:14.649 -> data: 6 20:58:15.813 -> data: 7 20:58:16.933 -> data: 8 20:58:18.051 -> data: 9 20:58:19.215 -> data: 10 20:58:20.331 -> data: 11 20:58:21.453 -> data: 12 20:58:22.571 -> data: 13 20:58:23.740 -> data: 14 20:58:24.860 -> data: 15 20:58:25.976 -> data: 16 20:58:27.140 -> data: 17 20:58:28.258 -> data: 18 20:58:29.375 -> data: 19 20:58:30.510 -> data: 20 20:58:31.673 -> data: 21 20:58:32.791 -> data: 22 20:58:33.913 -> data: 23 20:58:35.031 -> data: 24 20:58:36.190 -> data: 25 20:58:37.308 -> data: 26 20:58:38.427 -> data: 27 20:58:39.589 -> data: 28 20:58:40.705 -> data: 29 20:58:41.824 -> data: 30 20:58:42.941 -> data: 31 20:58:44.106 -> data: 32 20:58:45.226 -> data: 33 20:58:46.344 -> data: 34 20:58:47.506 -> data: 35 20:58:48.623 -> data: 36 20:58:49.741 -> data: 37 20:58:50.906 -> data: 38 20:58:52.020 -> data: 39 20:58:53.140 -> data: 40 20:58:54.306 -> data: 41 20:58:55.424 -> data: 42 20:58:56.540 -> data: 43 20:58:57.704 -> data: 44 20:58:58.821 -> data: 45 20:58:59.935 -> data: 46 20:59:01.099 -> data: 47 20:59:02.217 -> data: 48 20:59:03.370 -> data: 49 20:59:04.492 -> data: 50 20:59:05.608 -> data: 51 20:59:06.727 -> data: 52 20:59:07.890 -> data: 53 20:59:09.009 -> data: 54 20:59:10.126 -> data: 55 20:59:11.291 -> data: 56 20:59:12.408 -> data: 57 20:59:13.529 -> data: 58 20:59:14.692 -> data: 59 20:59:15.811 -> data: 60 20:59:16.925 -> data: 61 20:59:18.090 -> data: 62 20:59:19.210 -> data: 63 20:59:20.328 -> data: 64 20:59:21.447 -> data: 65 20:59:22.609 -> data: 66 20:59:23.729 -> data: 67 20:59:24.846 -> data: 68 20:59:26.012 -> data: 69 20:59:27.129 -> data: 70 20:59:28.243 -> data: 71 20:59:29.406 -> data: 72 20:59:30.523 -> data: y�UrfaI 20:59:31.639 -> da6 20:59:31.639 -> tz�UrfaJ

How many device can send data a center Simultaneously?

When I look at the information sheet of the e22 modules, it says that the buffer length is 1000 bytes and the subpackages of the Lora module can be reduced to 32 bytes. This is how I understand it 1 lora center can receive data from 1000/32 = 31 devices simultaneously. Please correct me if I'm wrong.

image

So, how can I retrieve data from these 30-odd points at the same time without losing data? I saw the following code "e32ttl.receiveMessageUntil();" on your website but I couldn't see the usage example. Can you make an example? In addition, what is the reading speed of Lora modules, that is, how long should the waiting time be between messages from 30 points, ideally.

esp32-idf

Do you intend to support the library esp32-idf?

Warning : Save mode returned not recognized!

Hello, I set up esp32 and e22 400t 20d model as described and I open setConfiguration example I upload code. I see "save mode returned not recognized" warning on the serial monitor. What can i do to fix it ?

E22-900M30S support

Hi,
I have E22-900M30S. It says it has SPI connection. I think serial should also be possible. What sketch should I use?

Help

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);
}

configuration.TRANSMISSION_MODE.WORTransceiverControl = WOR_RECEIVER;

configuration.TRANSMISSION_MODE.WORTransceiverControl = WOR_RECEIVER;

this commend not effect lora module parameters setting for E22 only transmitter works

actualy it work reverse, if I set receiver it goes transmitter mode and if I set transmitter it goes receiver mode

//configuration.TRANSMISSION_MODE.WORTransceiverControl = WOR_TRANSMITTER;
configuration.TRANSMISSION_MODE.WORTransceiverControl = WOR_RECEIVER;

No support for 0.3k and 1k2 modes in E22 modules V2.1 (and V2.0)

Hello, this is not a bug in library itself, just a warning and maybe suggestion for enhancement (adding the check or documentation). The new V2.1 modules (PCB versions 10498-V1.1 and 10497-V1.0) - and after confirming from EBYTE also the V2.0 modules - do not correctly set up speeds 0.3k and 1k2 and silently ignore the setting (they probably stay at the 2k4 speed like E220s). It seems the SX127x has been replaced in them by LLCC68 inside, which does not support spreading factors needed by these modes.

They can be identified by querying register 0x82 (C1 82 01), which returns 0x40 instead of 0x10 or 0x11 seen in previous versions. Older modules set to these speeds cannot communicate with the V2.1 ones on these speeds and vice versa.

I had this just confirmed from EBYTE, my guess is that they are in fact re-labeled E220-400T30D/E220-900T30D modules with modified interface to observe E22 communication protocol and register map

So my suggestion is adding a warning to README.md concerning those speeds.

Potential memory leak

In LoRa_E22.cpp a buffer is allocated in each call

...
ResponseStructContainer LoRa_E22::receiveMessageComplete(const uint8_t size, bool rssiEnabled){
ResponseStructContainer rc;

rc.data = malloc(size);
   ...

However, in all of the samples, you appear not to release the memory, for example esp32_e22_04_SendFixedTransmission.ino:

...
if (e22ttl.available()>1) {
// read the String message
#ifdef ENABLE_RSSI
ResponseContainer rc = e22ttl.receiveMessageRSSI();
#else
ResponseContainer rc = e22ttl.receiveMessage();
#endif
...

Isn't rc.close() required to release the memory? Also, is there a way to avoid malloc() every time you receive a message to avoid fragmentation?

configuration.getChannelDescription() reports wrong E22 frequency

I'm using some E22-900T30D modules. When I run your example at

https://github.com/xreef/EByte_LoRa_E22_Series_Library/tree/master/examples/esp32_e22_setConfiguration)
/esp32_e22_setConfiguration.ino

it returns Chan : 23 -> 433MHz, when I expect it to return 850 + 23 -> 873MHz.

Does this matter? In other words, is it just informational, or does it result in wrong commands to the module?

A related problem is it returns an error "POWER_30 was not declared" when attempting to set the configuration to POWER_30. I can't find "#define E22_22" or "#define E22_30" in the repository so I guess TRANSMISSION_POWER gets enumerated as though for E22-400 in line 467 of statesNaming.h. Adding "#define FREQUENCY_915" and "#define E22_30" in the example code seems to fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.