You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -169,7 +169,7 @@ However, in the current implementation, the LMIC is tracking the completion of u
169
169
170
170
#### Working with MCCI Murata-based boards
171
171
172
-
The Board Support Package V2.5.0 for the MCCI Murata-based boards ([MCCI Catena 4610](https://mcci.io/catena4610), [MCCI Catena 4612](https://mcci.io/catena4612), etc.) has a defect in clock calibration that prevents the compliance script from being used without modification. The update to V2.6.0 is expected to solve this issue.
172
+
The Board Support Package V2.5.0 for the MCCI Murata-based boards ([MCCI Catena 4610](https://mcci.io/catena4610), [MCCI Catena 4612](https://mcci.io/catena4612), etc.) has a defect in clock calibration that prevents the compliance script from being used without modification. Versions V2.6.0 and later solve this issue.
> To help you know if you have to worry, we'll call such boards "pre-integrated" and prefix each section with suitable guidance.
468
473
469
474
## PlatformIO
470
475
471
-
For use with PlatformIO, the `lmic_project_config.h` has to be disabled with the flag `ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS`.
472
-
The settings are defined in PlatformIO by `build_flags`.
476
+
For use with PlatformIO, the `lmic_project_config.h` has to be disabled with the flag `ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS`.
477
+
The settings are defined in PlatformIO by `build_flags`.
473
478
474
479
```ini
475
480
lib_deps =
@@ -747,6 +752,10 @@ This library provides several examples.
747
752
from defaults. This sketch also works with the MCCI Catena family of products
748
753
as well as with the Feather 32u4 LoRa.
749
754
755
+
- [`ttn-otaa-halconfig-us915.ino`](examples/ttn-otaa-halconfig-us915/ttn-otaa-halconfig-us915.ino) is a version of `ttn-otaa.ino` that uses the LMIC automatic configuration system, in the US915 region,
756
+
with The Things Network. Remember that you may also have to change `config.h`
757
+
from defaults. This sketch works with all the boards listed above under [Pre-Integrated Boards](#pre-integrated-boards).
is a further refinement of `ttn-otaa-feather-us915.ino`. It measures and
752
761
transmits temperature and relative humidity using a DHT22 sensor. It's only
@@ -762,6 +771,8 @@ This library provides several examples.
762
771
for the Adafruit [Feather M0 LoRa](https://www.adafruit.com/product/3178), and for a variety
763
772
of other MCCI products.
764
773
774
+
- [`raw-halconfig.ino](examples/raw-halconfig/raw-halconfig.ino) is like the other `raw` examples, but is most general. It's configured according to the LMIC's auto-configuration mechanism, and adapts according to the selected region.
775
+
765
776
- [`ttn-abp.ino`](examples/ttn-abp/ttn-abp.ino) shows a basic transmission of a "Hello, world!" message
766
777
using the LoRaWAN protocol. This example
767
778
uses activation-by-personalization (ABP, preconfiguring a device
@@ -791,6 +802,12 @@ This library provides several examples.
791
802
792
803
- [`header_test.ino`](examples/header_test/header_test.ino) just tests the header files; it's used for regression testing.
793
804
805
+
- [`compliance-otaa-halconfig.ino`](examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino) is a test sketch that is used for LoRaWAN compliance testing.
806
+
807
+
- [`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.
808
+
809
+
- [`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.
810
+
794
811
## Timing
795
812
796
813
The library is
@@ -820,25 +837,17 @@ Fortunately, LoRa is a fairly slow protocol and the timing of the
820
837
receive windows is not super critical. To synchronize transmitter and
821
838
receiver, a preamble is first transmitted. Using LoRaWAN, this preamble
822
839
consists of 8 symbols, of which the receiver needs to see 4 symbols to
823
-
lock on. The current implementation tries to enable the receiver for 5
824
-
symbol times at 1.5 symbol after the start of the receive window,
825
-
meaning that a inaccuracy of plus or minus 2.5 symbol times should be
826
-
acceptable.
840
+
lock on. The current implementation tries to enable the receiver for 6
841
+
symbol times slightly before the start of the receive window.
827
842
828
843
The HAL bases all timing on the Arduino `micros()` timer, which has a platform-specific
829
-
granularity, and is based on the primary microcontroller clock.
844
+
granularity and accuracy, and is based on the primary microcontroller clock.
830
845
831
-
At the fastest LoRa setting supported by the SX127x (SF5BW500) a
832
-
single preamble symbol takes 64 microseconds, so the receive window timing should
833
-
be accurate within 160 microseconds (for LoRaWAN this is SF7BW250, needing accuracy
834
-
within 1280μs). This accuracy should also be
835
-
feasible with the polling approach used, provided that the LMIC loop is
836
-
run often enough.
846
+
If using an internal oscillator that is less than 100ppm accurate but better than 4000 ppm accurate, or if your other `loop()` processing
847
+
is time consuming, you can use [`LMIC_setClockError()`](#lmic_setclockerror)
848
+
to cause the library to leave the radio on longer. Note that for various reasons, it is not practical to set enormous clock errors. Oscillators that are 4000 ppm accurate or worse should be supplemented or disciplined with a better timing source. The LoRaWAN spec, for class B, implicitly assumes 100 ppm accuracy in the clock.
837
849
838
-
If using an internal oscillator (which is 1% - 10%
839
-
accurate, depending on calibration), or if your other `loop()` processing
840
-
is time consuming, you may have to use [`LMIC_setClockError()`](#lmic_setclockerror)
841
-
to cause the library to leave the radio on longer.
850
+
Users of older versions of the library were advised to set large clock errors if they were experiencing timing problems. However, close analysis and debugging during the preparation of v3.1.0 of this library revealed that the real errors were in the timing calculations in the library. Once those were corrected, the need for large clock error settings was reduced. It's still possible to use large clock errors if needed, but this must be enabled via a compile time switch.
842
851
843
852
An even more accurate solution could be to use a dedicated timer with an
844
853
input capture unit, that can store the timestamp of a change on the DIO0
@@ -849,7 +858,7 @@ a special API, `radio_irq_handler_v2(u1_t dio, ostime_t tEvent)`. This
849
858
API allows you to supply a hardware-captured time for extra accuracy.
850
859
851
860
The practical consequence of inaccurate timing is reduced battery life;
852
-
the LMIC must turn on the receiver earlier in order to be sure to capture downlink packets.
861
+
the LMIC must turn on the receiver earlier in order to be sure to capture downlink packets. However, this is a second order effect on class A devices; every receive is preceded by a transmit, which takes approximately ten times as much power per millisecond as a receive.
Setting a high clock error causes the RX windows to be opened earlier than it otherwise would be. This causes more power to be consumed. For Class A devices, this extra power is not substantial, but for Class B devices, this can be significant.
875
884
885
+
For a variety of reasons, the LMIC normally ignores clock errors greater than 4000 ppm (0.4%). The compile-time flag `LMIC_ENABLE_arbitrary_clock_error` can remove this limit. To do this, define it to a non-zero value.
886
+
876
887
This clock error is not reset by `LMIC_reset()`.
877
888
878
889
## Downlink data rate
@@ -1182,7 +1193,9 @@ function uflt12f(rawUflt12)
1182
1193
1183
1194
## Release History
1184
1195
1185
-
- v3.0.99 (still in pre-release) adds the following changes. (This is not an exhaustive list.) Note that the behavior of the LMIC changes in important ways, as it now enforces the LoRaWAN mandated maximum frame size for a given data rate. For Class A devices, this may cause your device to go silent after join, if you're not able to handle the frame size dictated by the parameters downloaded to the device by the network during join. The library will attempt to find a data rate that will work, but there is no guarantee that the network has provided such a data rate.
1196
+
- v3.1.0 officially adopts the changes from v3.0.99. There were dozens of changes; check the GitHub issue logs and change logs. This was a breaking release (due to changes in data layout in the LMIC structure; the structure is accessed by apps).
1197
+
1198
+
- v3.0.99 (the pre-release for v3.1.0) added the following changes. (This is not an exhaustive list.) Note that the behavior of the LMIC changes in important ways, as it now enforces the LoRaWAN mandated maximum frame size for a given data rate. For Class A devices, this may cause your device to go silent after join, if you're not able to handle the frame size dictated by the parameters downloaded to the device by the network during join. The library will attempt to find a data rate that will work, but there is no guarantee that the network has provided such a data rate.
1186
1199
1187
1200
-[#470](https://github.com/mcci-catena/arduino-lmic/pull/470) corrects the name of AU915 region. [#516](https://github.com/mcci-catena/arduino-lmic/pull/516) makes sure that `LMIC_REGION_au921` is defined (but deprecated) for backward compatibility.
1188
1201
-[#452](https://github.com/mcci-catena/arduino-lmic/pull/452) fixes a bug [#450](https://github.com/mcci-catena/arduino-lmic/issues/450) in `LMIC_clrTxData()` that would cause join hiccups if called while (1) a join was in progress and (2) a regular data packet was waiting to be uplinked after the join completes. Also fixes AS923- and AU915-specific bugs [#446](https://github.com/mcci-catena/arduino-lmic/issues/446), [#447](https://github.com/mcci-catena/arduino-lmic/issues/447), [#448](https://github.com/mcci-catena/arduino-lmic/issues/448). Version is `v3.0.99.5`.
@@ -1245,6 +1258,14 @@ This library started from the IBM V1.5 open-source code.
1245
1258
1246
1259
-[`@tanupoo`](https://github.com/tanupoo) of the WIDE Project debugged AS923JP and LBT support.
1247
1260
1261
+
-[`@frazar`](https://github.com/frazar) contributed numerous features, e.g. network time support, CI testing, documentation improvements.
1262
+
1263
+
-[`@manuelbl`](https://github.com/manuelbl) contributed numerous ESP32-related patches and improvements.
1264
+
1265
+
-[`@ngraziano`](https://github.com/ngraziano) did extensive testing and contributed numerous ADR-related patches.
1266
+
1267
+
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.
1268
+
1248
1269
## Trademark Acknowledgements
1249
1270
1250
1271
LoRa is a registered trademark of Semtech Corporation. LoRaWAN is a registered trademark of the LoRa Alliance.
0 commit comments