Skip to content

Commit 85c92e3

Browse files
author
Christoph Schultz
committed
2 parents 2494a86 + 65aa4ec commit 85c92e3

36 files changed

+962
-240
lines changed

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Arduino-LMIC library
1+
# Arduino-LMIC library ("MCCI LoRaWAN LMIC Library")
22

33
This repository contains the IBM LMIC (LoRaWAN-MAC-in-C) library, slightly
44
modified to run in the Arduino environment, allowing using the SX1272,
55
SX1276 transceivers and compatible modules (such as some HopeRF RFM9x
66
modules and the Murata LoRa modules).
77

8+
> Note on names: the library was originally ported to Arduino by Matthijs Kooijman and Thomas Telkamp, and was named Arduino LMIC. Subsequently, MCCI did a lot of work to support other regions, and ultimately took over maintenance. The Arduino IDE doesn't like two libraries with the same name, so we had to come up with a new name. So in the IDE, it will appear as MCCI LoRaWAN LMIC Library; but all us know it by the primary header file, which is `<arduino_lmic.h>`.
9+
810
Information about the LoRaWAN protocol is summarized in [LoRaWAN-at-a-glance](doc/LoRaWAN-at-a-glance.pdf). Full information is available from the [LoRa Alliance](https://lora-alliance.org).
911

1012
A support forum is available at [forum.mcci.io](https://forum.mcci.io/c/device-software/arduino-lmic/5).
@@ -16,10 +18,11 @@ see the PDF files in the doc subdirectory.
1618

1719
A separate library, [MCCI `arduino-lorawan`](https://github.com/mcci-catena/arduino-lorawan), provides a higher level, more Arduino-like wrapper which may be useful.
1820

19-
This library requires Arduino IDE version 1.6.6 or above, since it
20-
requires C99 mode to be enabled by default.
21+
The examples in this library (apart from the compliance sketch) are somewhat primitive. A very complete cross-platform Arduino application based on the LMIC has been published by Leonel Lopes Parente ([`@lnlp`](https://github.com/lnlp)) as [LMIC-node](https://github.com/lnlp/LMIC-node). That application specifically targets The Things Network.
22+
23+
Although the wrappers in this library are designed to make the LMIC useful in the Arduino environment, the maintainers have tried to be careful to keep the core LMIC code generally useful. For example, I use this library without modification (but with wrappers) on a RISC-V platform in a non-Arduino environment.
2124

22-
[![GitHub release](https://img.shields.io/github/release/mcci-catena/arduino-lmic.svg)](https://github.com/mcci-catena/arduino-lmic/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/mcci-catena/arduino-lmic/latest.svg)](https://github.com/mcci-catena/arduino-lmic/compare/v3.3.0...master) [![Arduino CI](https://img.shields.io/github/workflow/status/mcci-catena/arduino-lmic/Arduino%20CI)](https://github.com/mcci-catena/arduino-lmic/actions)
25+
[![GitHub release](https://img.shields.io/github/release/mcci-catena/arduino-lmic.svg)](https://github.com/mcci-catena/arduino-lmic/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/mcci-catena/arduino-lmic/latest.svg)](https://github.com/mcci-catena/arduino-lmic/compare/v4.0.0...master) [![Arduino CI](https://img.shields.io/github/workflow/status/mcci-catena/arduino-lmic/Arduino%20CI)](https://github.com/mcci-catena/arduino-lmic/actions)
2326

2427
**Contents:**
2528

@@ -288,7 +291,6 @@ If the library is configured for US915 operation, we make the following changes:
288291

289292
- Add the APIs `LMIC_enableChannel()`,
290293
`LMIC_enableSubBand()`, `LMIC_disableSubBand()`, and `LMIC_selectSubBand()`.
291-
- Add the constants `MAX_XCHANNELS`.
292294
- Add a number of additional `DR_...` symbols.
293295

294296
### Selecting the target radio transceiver
@@ -831,7 +833,7 @@ This library provides several examples.
831833
832834
- [`compliance-otaa-halconfig.ino`](examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino) is a test sketch that is used for LoRaWAN compliance testing.
833835
834-
- [`helium-us9115.ino`](examples\helium-us915\helium-us915.ino) is a complete example for using the LMIC on the Helium network. It's very similar to the OTAA examples, but sets up the prejoin parameters properly for the initial deployment of Helium LoRaWAN support.
836+
- [`helium-otaa.ino`](examples/helium-otaa/helium-otaa.ino) is a complete example for using the LMIC on the Helium network. It's very similar to the OTAA examples, but sets up the prejoin parameters properly for the initial deployment of Helium LoRaWAN support.
835837
836838
- [`ttn-otaa-network-time.ino`](examples/ttn-otaa-network-time/ttn-otaa-network-time.ino) demonstrates use of the network time request. Network time requests are not supported by The Things Network as of the time of writing.
837839
@@ -1238,9 +1240,24 @@ function uflt12f(rawUflt12)
12381240

12391241
## Release History
12401242

1241-
- HEAD has the following changes.
1243+
- HEAD contains the following changes
1244+
- Adapt ttn-otaa-network-time example to be compatible with [PaulStoffregen/Time](https://github.com/PaulStoffregen/Time) v1.6.1, which deletes `Time.h` in favor of `TimeLib.h` [#763](https://github.com/mcci-catena/arduino-lmic/issues/763). Version is v4.0.1-pre1.
1245+
1246+
- v4.0 is a major release; changes are significant enough to be "likely breaking". It includes the following changes.
12421247

1248+
- Fix some broken documentation references [#644](https://github.com/mcci-catena/arduino-lmic/issues/644), [#646](https://github.com/mcci-catena/arduino-lmic/pulls/646), [#673](https://github.com/mcci-catena/arduino-lmic/pulls/673).
12431249
- Re-added CI testing, since Travis CI no longer works for us [#647](https://github.com/mcci-catena/arduino-lmic/issues/647); fixed AVR compliance CI compile [#679](https://github.com/mcci-catena/arduino-lmic/issues/679).
1250+
- Don't use `defined()` in macro definitions [#606](https://github.com/mcci-catena/arduino-lmic/issues/606)
1251+
- Fix a warning on AVR32 [#709](https://github.com/mcci-catena/arduino-lmic/pulls/709).
1252+
- Fix Helium link in examples [#715](https://github.com/mcci-catena/arduino-lmic/issues/715), [#718](https://github.com/mcci-catena/arduino-lmic/pulls/718).
1253+
- Remove `XCHANNEL` support from US region [#404](https://github.com/mcci-catena/arduino-lmic/issues/404)
1254+
- Assign channels randomly without replacement [#515](https://github.com/mcci-catena/arduino-lmic/issues/515), [#619](https://github.com/mcci-catena/arduino-lmic/issues/619), [#730](https://github.com/mcci-catena/arduino-lmic/issues/730).
1255+
- Don't allow `LMIC_setupChannel()` to change default channels [#722](https://github.com/mcci-catena/arduino-lmic/issues/722). Add `LMIC_queryNumDefaultChannels()` [#700](https://github.com/mcci-catena/arduino-lmic/issues/700).
1256+
- Don't accept out-of-range DRs from MAC downlink messages [#723](https://github.com/mcci-catena/arduino-lmic/issues/723)
1257+
- Adopt semantic versions completely [#726](https://github.com/mcci-catena/arduino-lmic/issues/726).
1258+
- Implement JoinAccept CFList processing for US/AU [#739](https://github.com/mcci-catena/arduino-lmic/issues/739).
1259+
- Correct JoinAccept CFList processing for AS923 [#740](https://github.com/mcci-catena/arduino-lmic/issues/740).
1260+
- Don't compile board config objects when we know for sure they'll not be used; compilers can't always tell [#736](https://github.com/mcci-catena/arduino-lmic/issues/736).
12441261

12451262
- v3.3.0 is primarily a maintenance and roll-up release.
12461263

@@ -1328,7 +1345,7 @@ This library started from the IBM V1.5 open-source code.
13281345

13291346
- [`@ngraziano`](https://github.com/ngraziano) did extensive testing and contributed numerous ADR-related patches.
13301347

1331-
There are many others, who have contributed code and also participated in discussions, performed testing, reported problems and results. Thanks to all who have participated.
1348+
There are many others, who have contributed code and also participated in discussions, performed testing, reported problems and results. Thanks to all who have participated. We hope to use something like [All Contributors](https://https://allcontributors.org/) to help keep this up to date, but so far the automation isn't working.
13321349

13331350
## Trademark Acknowledgements
13341351

doc/LMIC-v3.3.0.docx

-99 KB
Binary file not shown.
Binary file not shown.

doc/LMIC-v4.0.0.docx

102 KB
Binary file not shown.
Binary file not shown.

examples/raw-feather/raw-feather.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ const lmic_pinmap lmic_pins = {
7676
// Just like Feather M0 LoRa, but uses SPI at 1MHz; and that's only
7777
// because MCCI doesn't have a test board; probably higher frequencies
7878
// will work.
79+
// /!\ By default Feather 32u4's pin 6 and DIO1 are not connected. Please
80+
// ensure they are connected.
7981
const lmic_pinmap lmic_pins = {
8082
.nss = 8,
8183
.rxtx = LMIC_UNUSED_PIN,

examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ const lmic_pinmap lmic_pins = {
9595
// Just like Feather M0 LoRa, but uses SPI at 1MHz; and that's only
9696
// because MCCI doesn't have a test board; probably higher frequencies
9797
// will work.
98+
// /!\ By default Feather 32u4's pin 6 and DIO1 are not connected. Please
99+
// ensure they are connected.
98100
const lmic_pinmap lmic_pins = {
99101
.nss = 8,
100102
.rxtx = LMIC_UNUSED_PIN,

examples/ttn-otaa-network-time/ttn-otaa-network-time.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@
2727
* DevEUI and AppKey.
2828
*
2929
* Do not forget to define the radio type correctly in config.h.
30+
*
31+
* You will need to also install the library github.com/PaulStoffregen/Time;
32+
* you need a version that has TimeLib.h.
3033
*
3134
*******************************************************************************/
3235

33-
#include <Time.h>
36+
// requires library: github.com/PaulStoffregen/Time
37+
#include <TimeLib.h> // can't use <Time.h> starting with v1.6.1
38+
3439
#include <lmic.h>
3540
#include <hal/hal.h>
3641
#include <SPI.h>

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=MCCI LoRaWAN LMIC library
2-
version=3.3.0
2+
version=4.0.0
33
author=IBM, Matthijs Kooijman, Terry Moore, ChaeHee Won, Frank Rose
44
maintainer=Terry Moore <[email protected]>
55
sentence=Arduino port of the LMIC (LoraWAN-MAC-in-C) framework provided by IBM.

src/hal/getpinmap_catena4420.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Copyright & License:
1313
1414
*/
1515

16+
#if defined(ARDUINO_MCCI_CATENA_4420) || \
17+
/* legacy names */ \
18+
defined(ARDUINO_CATENA_4420)
19+
1620
#include <arduino_lmic_hal_boards.h>
1721
#include <Arduino.h>
1822

@@ -71,4 +75,6 @@ const HalPinmap_t *GetPinmap_Catena4420(void)
7175
return &myPinmap;
7276
}
7377

74-
} // namespace Arduino_LMIC;
78+
} // namespace Arduino_LMIC
79+
80+
#endif

0 commit comments

Comments
 (0)