Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "src/LoRaMac-node"]
path = src/LoRaMac-node
url = https://github.com/Lora-net/LoRaMac-node.git
url = https://github.com/boston-engineering/LoRaMac-node.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in your fork here can you include output of the linking issue in the git commit log body? have you opened a PR against the upstream repo? we really want to avoid having to use a forked loramac-node if we can avoid it by getting your PR in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ set(COMPONENT_SRCS
"src/LoRaMac-node/src/apps/LoRaMac/common/LmHandler/packages/LmhpClockSync.c"
"src/LoRaMac-node/src/apps/LoRaMac/common/LmHandler/packages/LmhpCompliance.c"
"src/LoRaMac-node/src/mac/region/Region.c"
"src/LoRaMac-node/src/mac/region/RegionBaseUS.c"
"src/LoRaMac-node/src/mac/region/RegionCommon.c"
"src/LoRaMac-node/src/mac/region/RegionEU868.c"
"src/LoRaMac-node/src/mac/region/RegionUS915.c"
)

# idf.py build 2>&1 | tee LOG | grep "undefined reference" | sed -e 's/.*reference to//' | sort | uniq
Expand All @@ -54,7 +56,14 @@ set(COMPONENT_ADD_INCLUDEDIRS
"src/LoRaMac-node/src/peripherals/soft-se"
)

register_component()
idf_component_register(SRCS ${COMPONENT_SRCS}
INCLUDE_DIRS ${COMPONENT_ADD_INCLUDEDIRS}
REQUIRES ${COMPONENT_REQUIRES}
)

add_definitions(-DREGION_EU868=1)
include_directories(
$ENV{IDF_PATH}/components/driver/gpio/include
$ENV{IDF_PATH}/components/driver/spi/include
$ENV{IDF_PATH}/components/esp_timer/include
)
add_definitions(-DSOFT_SE)
47 changes: 47 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
menu "SX126x Configuration"

config SX126X_SPI_MISO_GPIO
int "SX126x SPI MISO GPIO"
help
Set the GPIO number used for SPI MISO.

config SX126X_SPI_MOSI_GPIO
int "SX126x SPI MOSI GPIO"
help
Set the GPIO number used for SPI MOSI.

config SX126X_SPI_SCLK_GPIO
int "SX126x SPI SCLK GPIO"
help
Set the GPIO number used for SPI SCLK.

config SX126X_SPI_CS_GPIO
int "SX126x SPI CS GPIO"
help
Set the GPIO number used for SPI CS.

config SX126X_RESET_GPIO
int "SX126x RESET GPIO"
help
Set the GPIO number used for RESET.

config SX126X_IRQ_DIO1_GPIO
int "SX126x IRQ (DIO1) GPIO"
help
Set the GPIO number used for IRQ (DIO1).

config SX126X_BUSY_GPIO
int "SX126x BUSY GPIO"
help
Set the GPIO number used for BUSY.

config SX126X_SPI_HOST
int "SX126x SPI HOST"
default 1
help
The SPI peripheral used to communicate with the SX1262.
0 = SPI1_HOST
1 = SPI2_HOST
2 = SPI3_HOST

endmenu
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# LoRaMac-node-esp32
ESP32 port of LoRaMac-node
#### ESP32 port of LoRaMac-node
Creates a Semtech SX126x compatible ESP32 component that pulls in all LoRaMac-node sources, allowing for a custom ESP32 board definition to be used.

This is work in progress - not usable yet
## Compatibility
This library is written for and is currently only compatible with Semtech SX126x LoRaWAN chips.

## Configuration
- Running menuconfig with LoRaMac-node-esp32 added as a component will allow for configuration of SPI pins and the host to be used.
- Region(s) of operation must be selected by pulling in one of the pre-processor definitions used by LoRaMac-node, e.g. `REGION_US915`.
- Regions are listed in `src/LoRaMac-node/src/mac/region/Region.h`

## Notes
- `SX126xWaitOnBusy()` indefinitely blocks with a busy wait, waiting for a low BUSY signal
- This is work in progress - not usable yet
4 changes: 4 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: Creates an ESP32 component to allow ESP32 board compatibility with the LoRaMac-node stack.
dependencies:
idf:
version: ">=5.0"
Loading