Comments (7)
Hi sreekants,
I had this issue recently and yes you must call rc.close() every cycle to release the memory.
I have also suggested it be added to the example code.
Maybe a better approach is to allocate the maximum allowable per message ie 256 bytes and then leave it allocated for ever?
from ebyte_lora_e22_series_library.
Hi sreekants,
I had this issue recently and yes you must call rc.close() every cycle to release the memory.
I have also suggested it be added to the example code.
Maybe a better approach is to allocate the maximum allowable per message ie 256 bytes and then leave it allocated for ever?
I like the idea of a pre-allocated buffer managed by the library. That would be a good fix with backward compatibility if the close() function has an empty body.
from ebyte_lora_e22_series_library.
Hi all,
no, the ResponseContainer doesn't need a close function because there isn't a pointer but directly a complex variable.
Bye Renzo
from ebyte_lora_e22_series_library.
Hi Renzo,
Where is the corresponding free() to the buffer allocated on line 780? The pointer rc.data holds a pointer to this buffer, but the only call releasing this buffer is ResponseContainer::close(). However, I do not see it being called.
EByte_LoRa_E22_Series_Library/LoRa_E22.cpp
Line 780 in 510e04e
Can you explain how the heap is managed correctly with the library?
(We arrived at this problem because we were transmitting 220 byte frame over LoRa E22 in our software and when we monitored the heap it fell from 180Kb, steadily to 70kb as our stress tests ran through a few hours.)
from ebyte_lora_e22_series_library.
Hi @sreekants,
you select the ResponseStructContainer that needs close
EByte_LoRa_E22_Series_Library/LoRa_E22.cpp
Lines 777 to 795 in 510e04e
and It had It
EByte_LoRa_E22_Series_Library/LoRa_E22.h
Lines 228 to 235 in 510e04e
but the ResponseContainer doesn't have and doesn't need a close.
EByte_LoRa_E22_Series_Library/LoRa_E22.h
Lines 228 to 240 in 510e04e
Bye Renzo
from ebyte_lora_e22_series_library.
Yes, I understand now. I stand corrected. Your samples use ResponseContainer. So they do not need a close(). You are correct there.
In our usecase, however, we are sending binary data over LoRa. The ResponseContainer is suitable only for string data. This is why we end up calling receiveMesssageComplete(). As stated, each call allocates a buffer, fragmenting memory, even if the close() function is called. Is there a better way to allow the use of a preallocated buffer so we don't have to malloc() every loop?
from ebyte_lora_e22_series_library.
Ahhh ok, now I understand,
mmm... no I don't think about that, but It's an interesting feature and can be a good enhancement.
I think of a solution.
If you have some suggestions write here.
Bye Renzo
from ebyte_lora_e22_series_library.
Related Issues (20)
- How many device can send data a center Simultaneously? HOT 1
- configuration.TRANSMISSION_MODE.WORTransceiverControl = WOR_RECEIVER; HOT 9
- Wrong interpretation of returned string on WRITE_CFG_PWR_DWN_LOSE HOT 2
- Guru meditation error triggered within receiveStruct routine(s) HOT 2
- Can you please tell me how to change the frequency of transmission / reception? HOT 1
- FREQUENCY_915 is incorrect HOT 1
- How to add key for e22 lora modules HOT 3
- Arduino Nano gets/sends incorrect data. Looks like a bug in the library - Strings or memory manipulation. HOT 1
- No support for 0.3k and 1k2 modes in E22 modules V2.1 (and V2.0) HOT 3
- E22-900M30S support HOT 1
- Support E32868T30D based on SEMTECH's SX1276 RF HOT 1
- Não estou conseguindo colocar a frequência de comunicação em 915Mhz, so trabalha no padrão 433Mhz HOT 3
- Use the module to send data to TTN HOT 1
- esp32-idf HOT 1
- Need your help with transporting audio over Lora HOT 4
- Build error on HOT 1
- hope will be a esp32_e32_web_manager_gateway for e22. HOT 2
- This code only works 72 times with arduino HOT 4
- questions about E22-900M22S HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebyte_lora_e22_series_library.