GrumpyOldPizza / ArduinoCore-stm32l0

Arduino Core for STM32L0
125 stars 67 forks source link

Mixing LoRaRadio and LoRaWan #187

Open hpssjellis opened 3 years ago

hpssjellis commented 3 years ago

Hi @GrumpyOldPizza. Once again thank you for making this repo. I am having a lot of fun working with the Arduino Portenta LoRa Vision Shield.

Presently making a redundant system where if my p2p LoRaRadio connection is not confirmed I switch to a LoRaWan network, however

    LoRaWAN.begin(US915);

compiles but kills the entire program, even after a call like LoRaRadio.end(); Looks like the 2 libraries can't co-exist. Any suggestions for what part in LoRaWAN.begin(US915); is causing the problem?

GrumpyOldPizza commented 3 years ago

Good question. No idea. You cannot interleave them, meaning while LoRaWAN is active you cannot access the radio and the other way around.

hpssjellis commented 3 years ago

@GrumpyOldPizza thanks for the reply:

I just want to dump LoRa when it fails and then load LoRaWan permanently until reboot. I see that the root of your LoRa library is from Semtech . Also that you wrote the LoRaWan library is it based on some other Repo?

I will mess around with it. I should be able to fully dump the LoRa settings before loading LoRaWan. Doesn't really matter as I am having much more success with your code than anything I have been able to do with the Arduino MKRWAN library.

I wonder if Arduino has a method to load a separate program from a running program. Probably not.

hpssjellis commented 3 years ago

@GrumpyOldPizza I think I have found the issue, The Portenta only gives a certain amount of memory and I am at 94% upload when memory runs out. Can you think of anything in the LoRa or LoRaWan libraries that could easily be reduced? My examples are fairly basic so not really expecting anything to reduce the memory dramatically. I will bug Arduino and see if they can give your library more space. Also will ask if they can support your library for all the new MBED boards.

hmmmm.

The LoRaWanBands seem to take up a fair bit of memory see map file I think I will just get rid of a few regions and see if that helps.