-
Notifications
You must be signed in to change notification settings - Fork 41
Minor reduction in memory footprint to make library more viable with adafruit_rfm9x on M0 processors #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll try that -- also , does the use of properties (getters/setters) add a lot to the code size. I'm still trying to figure out why this is so big. I took out the use of "warnings" that saved a few hundred bytes. edited to ad -- I am working on the rfm9x lib -- not the bme280 lib |
I also note the example code on https://learn.adafruit.com/multi-device-lora-temperature-network/using-with-adafruitio#feather-code-usage-3017649-1 has this at lines 78-83:
If things are desperate I would also try experimenting with the non-frozen library order in example code, e.g. swapping aroud the order of the two |
I think properties do add to the library size. I initially had I have wondered about libraries with some sort of conditional features for boards bigger than M0 where the M0 one would be trimmed back. As an analogy, a C programmmer might do this with preprocessor to generate different versions. This does create a whole set of separate library management issues with selection and documentation. |
Very crude summary of symbols in the current (from 19-May-2020 bundle) mpy.
|
FYI -- for the rfm9x lib I get
|
adafruit/circuitpython#145 is interesting. I wonder if that would help? Even if |
@jepler also mentioned that stack size is configurable in Origins of this from Discord:
|
@tannewt should we try something similar here..to the work done in the DPS310? willing to give it a try, let me know. Thanks |
Sure! |
Good Will next week . Thanks |
@jerryneedell could you try this PR #52 |
Sure -- I'll give it a try later today or tomorrow. |
Thanks :) ... is the only one that I could not test and the reason for that PR :) |
Tested and added comments to #52 |
Ah -- I did not complete the test to use the radio at the same time -- will do that now |
Ran the demo from https://learn.adafruit.com/multi-device-lora-temperature-network/using-with-adafruitio using basic:
|
Was perusing open issues, it looks like this one is complete, correct? :) |
Closing because it looks like the original issue was solved via #52, but please reopen if I'm mistaken! |
This library is used in the guide article, Adafruit Learn: Feather + Raspberry Pi Weather Monitoring Network with LoRa or LoRaWAN. It is being discussed in Adafruit Forums: Memory Error Lora_Device with BME280 as the CircuitPython code in the guide hits a
MemoryError
.If everything is working as expected here then shrinking
adafruit_rfm9x
oradafruit_bme280
are the only options to get this working.Some ideas:
raise ValueError
in all the setters currently have a specific message per property. This could be made generic and then six strings get condensed into one.mpy
. If desperation reaches this stage I'd verify this has some effect with agc.collect() ; print(mem_free())
.@brentru and @jerryneedell might have some other or better ideas on this.
The text was updated successfully, but these errors were encountered: