Skip to content

Commit

Permalink
Fix bug in defining the syncWord
Browse files Browse the repository at this point in the history
Added deep sleep support for ESP32   
Add deep sleep example code    
Added some Semtech data sheets
  • Loading branch information
beegee-tokyo committed Dec 9, 2019
1 parent d914e3d commit 6a463d2
Show file tree
Hide file tree
Showing 24 changed files with 1,301 additions and 50 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ examples/LoRaWanPio/lib/

examples/LoRaWanPio/.vscode

examples/DeepSleepPio/test/

examples/DeepSleepPio/lib/

examples/DeepSleepPio/.vscode

*.DB
2 changes: 1 addition & 1 deletion .library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SX126x-Arduino",
"version": "1.0.4",
"version": "1.0.5",
"keywords": [
"lora",
"Semtech",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Arduino library for LoRa communication with Semtech SX126x chips. It is based on

# Release Notes

## V1.0.5 Bug fix and deep-sleep functionality
- Fixed bug in the definition of the sync word
- Added possibility to re-init connection to SX1261/2 after CPU wakes up from sleep/deep-sleep
- **`lora_hardware_re_init()`** to re-initialize SX1262 connection without resetting the LoRa chip
- **`Radio.ReInit()`** to re-initialize SX1262 connection without resetting the LoRa chip
- **`Radio.IrqProcessAfterDeepSleep()`** to handle IRQ that woke up the CPU (RX_DONE, TX_DONE, ...)
## V1.0.4 Extended LoRaWan functionality
- Tested with both Single Channel ([ESP32](https://github.com/beegee-tokyo/SX1262-SC-GW)) and 8 Channel ([Dragino LPS8](https://www.dragino.com/products/lora-lorawan-gateway/item/148-lps8.html)) LoRaWan gateways
- Added possibility to set LoRaWan keys programmatically
Expand Down
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SX126x-Arduino
----
Arduino library for LoRa communication with Semtech SX126x chips. It is based on Semtech's SX126x libraries and adapted to the Arduino framework for ESP32. ESP8266 and nRF52832. It will not work with other uC's like AVR.
Arduino library for LoRa communication with Semtech SX126x chips. It is based on Semtech's SX126x libraries and adapted to the Arduino framework for ESP32, ESP8266 and nRF52832. It will not work with other uC's like AVR.

----
## Content
Expand All @@ -26,6 +26,9 @@ For now the library is tested with an [eByte E22-900M22S](http://www.ebyte.com/e

__**Check out the example provided with this library to learn the basic functions.**__

Especially for the deep sleep support on the ESP32 check out the example DeepSleep.
===

THIS IS WORK IN PROGRESS AND NOT ALL FUNCTIONS ARE INCLUDED NOR TESTED. USE IT AT YOUR OWN RISK!
===
----
Expand Down Expand Up @@ -66,6 +69,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
----
## Changelog
- 2019-12-09:
- Fixed bug in the definition of the sync word
- Added possibility to re-init connection to SX1261/2 after CPU wakes up from sleep/deep-sleep
- **`lora_hardware_re_init()`** to re-initialize SX1262 connection without resetting the LoRa chip
- **`Radio.ReInit()`** to re-initialize SX1262 connection without resetting the LoRa chip
- **`Radio.IrqProcessAfterDeepSleep()`** to handle IRQ that woke up the CPU (RX_DONE, TX_DONE, ...)

- 2019-11-09:
- Added Workarounds for limitations as written in DS_SX1261-2_V1.2 datasheet
- Tested with both Single Channel ([ESP32](https://github.com/beegee-tokyo/SX1262-SC-GW)) and 8 Channel ([Dragino LPS8](https://www.dragino.com/products/lora-lorawan-gateway/item/148-lps8.html)) LoRaWan gateways
Expand Down Expand Up @@ -218,6 +228,13 @@ Fill the structure with the HW configuration
lora_isp4520_init(SX1262);
```

----
#### Initialize the LoRa HW after CPU woke up from deep sleep
When you want to use the deep sleep function of the ESP32 with external wake up source, you do not want to reset and reconfigure the SX126x chip after its IRQ woke up the ESP32. This re-init function sets up only the required definitions for the communication without resetting the ESP32
```cpp
lora_hardware_re_init(hwConfig);
```
----
#### Setup the callbacks for LoRa events
```cpp
Expand Down Expand Up @@ -248,6 +265,16 @@ Initialize the radio and set the TX and RX parameters
0, true, 0, 0, LORA_IQ_INVERSION_ON, true);
```

----
#### Initialize the radio after CPU woke up from deep sleep
When you want to use the deep sleep function of the ESP32 with external wake up source, you do not want to reset and reconfigure the SX126x chip after its IRQ woke up the ESP32. Radio.ReInit() sets up only the required communication means resetting the ESP32.
Radio.IrqProcessAfterDeepSleep() is checking the reason for the wake-up IRQ and calls the event handler
```cpp
Radio.ReInit(&RadioEvents);

Radio.IrqProcessAfterDeepSleep();
```

----
#### Start listening for packages
```cpp
Expand Down
Binary file added documentation/SX1261-2_V1.2.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 6a463d2

Please sign in to comment.