SlimLoRa library

Yes that is the LMIC library to go with. This is actively maintained and is the most LoRaWAN compliant of available open source LoRaWAN libraries for the Arduino framework.

You can also use it with 8-bit MCU like ATmega328 and ATmega32u4.
The problem with these ATmega32x MCUs however is that they have very limited memory resources compared to more modern 32-bit MCUs.
LoRaWAN has progressed and the newer versions have more requirements. The MCCI LMIC library has grown in size accordingly. It can still be used on ATmega32x but you will not be able to run very large sketches in combination with MCCI LMIC on these MCU’s.

Check the ttn-otaa.ino example included with the MCCI LMIC library. It will run on ATmega32x and it should also be possible to add support for BME280 in addition.
Be aware that when using MCCI LMIC with ATmega32x you will have to:

  • Disable PING and BEACONS to save memory (and they are not needed for LoRaWAN Class A devices anyway).

  • Adjust the LMIC ClockError (otherwise downlinks and joins will fail).

Search the forum for more information about these subjects. Check the BSF for the Pro Mini board in LMIC-node for how to set ClockError with an approriate value.
LMIC-node does not directly support the Uno but you can use the Pro Mini as example which will not be much different (except for some pin mappings maybe).

Be aware that LMIC-node uses the predecessor of MCCI LMIC which is called ‘Classic LMIC’. It uses Classic LMIC for ATmega32x because there is too little memory to use LMIC-node with the MCCI LMIC library on these boards. But Classic LMIC is now deprecated because it is not LoRaWAN compliant and can cause certain issues with TTN (TTS CE V3).

LMIC-node is a rather extensive example application that uses many text messages to make clear to the user what happens. It supports multiple MCU platforms and was to certain extent optimized for use on ATmega32x. However, over time the MCCI LMIC library has grown in size and modern LoRaWAN applications just require/prefer use of MCUs with more memory resources.

LMIC-node uses MCCI LMIC for all supported boards except for the ATmega32x based boards. For these boards LMIC-node uses the older Classic LMIC which is now deprecated (for valid reasons) but it still works and therefore LMIC-node uses it to make it possible to run on these ATmega32x MCUs so you can still have an example that ‘works out of the box’ experience.

When LMIC-node uses Classic LMIC for these MCUs it gives a warning that the Classic LMIC library is deprecated, but it will still run.

If you still want to use ATmega32x my advice is to start with the ttn-otaa.ino example and build from there. You can look at the code of LMIC-node for code examples of how certain things are implemented/solved that you don’t find in ttn-otaa.ino.
Another option is to start with LMIC-node and strip it from everything you don’t need to make it fit on ATmega32x while using MCCI LMIC but that requires (much) more knowledge.

Also see: How to connect Adafruit Feather 32u4 LoRa to TTN? - #14 by bluejedi

Power saving and LoRaWAN is a more complex topic and LMIC-node currently does not provide support for it (because different per MCU platform and the MCCI LMIC library currently still does not support save/restore LMIC-state features).

Look at Atmega328 / ATmega32u4 / Arduino Pro Mini and deep sleep elsewhere on the forum for more information.

1 Like