|
2 | 2 | // arduino_lorawan_esp32_example.ino |
3 | 3 | // |
4 | 4 | // Example sketch showing how to periodically poll a sensor and send the data |
5 | | -// to The Things Network. |
| 5 | +// to a LoRaWAN network. |
6 | 6 | // |
7 | 7 | // Based on simple_sensor_bme280.ino with the following modifications: |
8 | 8 | // - reading the sensor data is replaced by a stub |
|
26 | 26 | // MCCI Arduino Development Kit ADK 0.2.2 |
27 | 27 | // MCCI LoRaWAN LMIC library 4.1.1 |
28 | 28 | // MCCI Arduino LoRaWAN Library 0.9.2 |
29 | | -// LoRa_Serialization 3.1.0 |
| 29 | +// LoRa_Serialization 3.2.1 |
30 | 30 | // |
31 | 31 | // |
32 | 32 | // created: 07/2022 |
|
58 | 58 | // History: |
59 | 59 | // |
60 | 60 | // 20220729 Created |
| 61 | +// 20230307 Changed cMyLoRaWAN to inherit from Arduino_LoRaWAN_network |
| 62 | +// instead of Arduino_LoRaWAN_ttn |
61 | 63 | // |
62 | 64 | // |
63 | 65 | // Notes: |
|
74 | 76 | // |
75 | 77 | /////////////////////////////////////////////////////////////////////////////// |
76 | 78 |
|
| 79 | +//--- Select LoRaWAN Network --- |
| 80 | +// The Things Network |
77 | 81 | #define ARDUINO_LMIC_CFG_NETWORK_TTN 1 |
78 | 82 |
|
| 83 | +// Helium Network |
| 84 | +// see mcci-cathena/arduino-lorawan issue #185 "Add Helium EU868 support" |
| 85 | +// (https://github.com/mcci-catena/arduino-lorawan/issues/185) |
| 86 | +#define ARDUINO_LMIC_CFG_NETWORK_GENERIC 0 |
| 87 | + |
| 88 | +// (Add other networks here) |
| 89 | + |
| 90 | + |
79 | 91 | #include <Arduino_LoRaWAN_network.h> |
80 | 92 | #include <Arduino_LoRaWAN_EventLog.h> |
81 | 93 | #include <arduino_lmic.h> |
@@ -143,10 +155,10 @@ const uint8_t PAYLOAD_SIZE = 8; |
143 | 155 | | |
144 | 156 | \****************************************************************************/ |
145 | 157 |
|
146 | | -class cMyLoRaWAN : public Arduino_LoRaWAN_ttn { |
| 158 | +class cMyLoRaWAN : public Arduino_LoRaWAN_network { |
147 | 159 | public: |
148 | 160 | cMyLoRaWAN() {}; |
149 | | - using Super = Arduino_LoRaWAN_ttn; |
| 161 | + using Super = Arduino_LoRaWAN_network; |
150 | 162 | void setup(); |
151 | 163 |
|
152 | 164 | protected: |
|
0 commit comments