Skip to content

Commit 783c325

Browse files
committed
Release 4.2.1
- Add CI/CD - Issue #20 - Fix segfault in UART receive - Fix different compilation issues - Add CodeRabbit for automatic reviews - Remove __pycache__ from git tracking - Fixes from CodeRabbit review - Simplify RAK3172_DEFAULT_CONFIG macro definition Closes #20 Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
1 parent 23d66ed commit 783c325

66 files changed

Lines changed: 580 additions & 523 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
reviews:
4+
profile: "chill"
5+
high_level_summary: true
6+
poem: false
7+
collapse_walkthrough: true
8+
sequence_diagrams: false
9+
auto_review:
10+
enabled: true
11+
drafts: true
12+
in_progress_fortune: false
13+
tools:
14+
github-checks:
15+
enabled: false
16+
cppcheck:
17+
enabled: true
18+
pylint:
19+
enabled: true
20+
yamllint:
21+
enabled: false
22+
markdownlint:
23+
enabled: true
24+
finishing_touches:
25+
docstrings:
26+
enabled: false
27+
unit_tests:
28+
enabled: false
29+
pre_merge_checks:
30+
docstrings:
31+
mode: "off"
32+
title:
33+
mode: "off"
34+
chat:
35+
art: false

.github/workflows/release.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Component
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '[0-9]+.[0-9]+.[0-9]+'
8+
branches:
9+
- main
10+
- dev
11+
paths-ignore:
12+
- '*.md'
13+
14+
env:
15+
# Master branch (main or master). Can be changed for testing
16+
master_branch: master
17+
18+
permissions:
19+
contents: write
20+
id-token: write
21+
22+
jobs:
23+
release:
24+
if: startsWith(github.ref, 'refs/tags/')
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v5
30+
with:
31+
fetch-depth: 0
32+
ref: ${{ github.ref }}
33+
34+
- name: ZIP artifact
35+
shell: bash
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y zip
39+
zip -r ${GITHUB_REF_NAME}.zip .
40+
41+
# - name: Upload to Component registry
42+
# uses: espressif/upload-components-ci-action@v2
43+
# with:
44+
# components: "ESP32-RAK3172:."
45+
# version: ${{ env.VERSION }}
46+
# namespace: "Kampi"
47+
# api_token: ${{ secrets.IDF_COMPONENT_REGISTRY_TOKEN }}
48+
49+
- name: Release
50+
uses: docker://antonyurchenko/git-release:v6
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
CHANGELOG_FILE: CHANGELOG.md
54+
with:
55+
args: |
56+
${GITHUB_REF_NAME}.zip
57+
58+
generate_outputs:
59+
if: github.ref_type == 'branch'
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v5
65+
66+
- name: Initialize
67+
run: |
68+
mkdir -p log
69+
echo "DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> "${GITHUB_ENV}"
70+
71+
- name: Get release version
72+
run: |
73+
BRANCH_NAME="${GITHUB_REF_NAME}"
74+
echo "BRANCH_NAME=${BRANCH_NAME}"
75+
BASE_VERSION="${BRANCH_NAME%%_*}"
76+
77+
IFS='.' read -r MAJOR MINOR BUILD <<< "${BASE_VERSION}"
78+
79+
echo "MAJOR=${MAJOR}" >> ${GITHUB_ENV}
80+
echo "MINOR=${MINOR}" >> ${GITHUB_ENV}
81+
echo "BUILD=${BUILD}" >> ${GITHUB_ENV}
82+
echo "VERSION=${BASE_VERSION}" >> ${GITHUB_ENV}
83+
84+
- name: Update version numbers
85+
shell: bash
86+
run: |
87+
echo "Using version: ${{ env.VERSION }}"
88+
sed -i -E "s/(RAK3172_LIB_MAJOR=)[0-9]+/\1${{ env.MAJOR }}/" CMakeLists.txt
89+
sed -i -E "s/(RAK3172_LIB_MINOR=)[0-9]+/\1${{ env.MINOR }}/" CMakeLists.txt
90+
sed -i -E "s/(RAK3172_LIB_BUILD=)[0-9]+/\1${{ env.BUILD }}/" CMakeLists.txt
91+
sed -i "s/^## \[Unreleased\]/## [${{ env.VERSION }}] - $(date +'%Y-%m-%d')/" CHANGELOG.md
92+
sed -i -E "s/^version: \".*\"/version: \"${{ env.VERSION }}\"/" idf_component.yml
93+
94+
- name: Push outputs
95+
uses: stefanzweifel/git-auto-commit-action@v5
96+
with:
97+
branch: ${{ github.ref_name }}
98+
commit_message: Push outputs from CI/CD (${{ env.DATE }})

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
desktop.ini
22
*.log
3-
.vscode
3+
.vscode
4+
5+
__pycache__
6+
dist

CHANGELOG.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
## [4.2.0] -
3+
## [4.2.1] - 2025-11-09
44

55
**Fixed:**
66

@@ -10,14 +10,15 @@
1010
- Fix wrong length for long payload in `RAK3172_LoRaWAN_Transmit`
1111
- Fix missing transmission confirmation in unconfirmed mode in `RAK3172_LoRaWAN_Transmit`
1212
- Fix different smaller errors
13+
- Fix segfault caused by a timeout in UART driver for ESP32 when using module firmware version 1.0.4 and below
1314

1415
**Added:**
1516

1617
- Add `RAK3172_ERR_WRONG_PORT` error for LoRaWAN
1718
- Add `RAK3172_ERR_CLASS_B_DISABLED` error for class B devices
1819
- Add device class to driver object
19-
- Added `isMulticast` field to `RAK3172_Rx_t` object
20-
- Added `AT_NO_NETWORK_JOINED` error to `RAK3172_LoRaWAN_Transmit`
20+
- Add `isMulticast` field to `RAK3172_Rx_t` object
21+
- Add `AT_NO_NETWORK_JOINED` error to `RAK3172_LoRaWAN_Transmit`
2122
- Add `RAK3172_LoRaWAN_SetClass` and `RAK3172_LoRaWAN_GetClass` function
2223
- Add arch specific watchdog
2324
- Add `RAK3172_isBusy` function
@@ -31,23 +32,23 @@
3132
**Added (EXPERIMENTAL):**
3233

3334
- Add FUOTA support for the host CPU via LoRaWAN
34-
- Add clock synchronization support for the host CPU via LoRaWAN
35+
- Add clock synchronization v1.0.0 support for the host CPU via LoRaWAN
3536

3637
**Changed:**
3738

38-
- Remove RUI3 option in `RAK3172_FactoryReset`
3939
- Improve error check in class B and multicast driver and add a check for the current device mode
4040
- Set `Retries` in `RAK3172_LoRaWAN_Transmit` as optional parameter
4141
- Swap `Retries` and `Confirmed` in `RAK3172_LoRaWAN_Transmit`
42-
- Remove overloaded `RAK3172_LoRaWAN_Transmit`
4342
- Clean up CMakeLists.txt
4443
- Update examples
4544
- Update documentation
46-
- Update README
47-
- Update CHANGELOG
48-
- Change version number to 4.2.0
4945

50-
## [4.1.1] - 21.04.2023
46+
**Removed:**
47+
48+
- Remove overloaded `RAK3172_LoRaWAN_Transmit`
49+
- Remove RUI3 option in `RAK3172_FactoryReset`
50+
51+
## [4.1.1] - 2023-04-21
5152

5253
**Fixed:**
5354

@@ -61,7 +62,7 @@
6162
- Update CHANGELOG
6263
- Change version number to 4.1.1
6364

64-
## [4.1.0] - 01.04.2023
65+
## [4.1.0] - 2023-04-01
6566

6667
**Fixed:**
6768

@@ -123,7 +124,7 @@
123124
- Rework CHANGELOG layout
124125
- Change version number to 4.1.0
125126

126-
## [4.0.0] - 09.09.2022
127+
## [4.0.0] - 2022-09-09
127128

128129
**Fixed:**
129130

@@ -162,7 +163,7 @@
162163
- Update CHANGELOG
163164
- Change version number to 4.0.0
164165

165-
## [3.0.0] - 22.05.2022
166+
## [3.0.0] - 2022-05-22
166167

167168
**Added:**
168169

@@ -179,7 +180,7 @@
179180
- Update CHANGELOG
180181
- Change version number to 3.0.0
181182

182-
## [2.0.0] - 22.03.2022
183+
## [2.0.0] - 2022-03-22
183184

184185
**Added:**
185186

@@ -195,7 +196,7 @@
195196
- Update CHANGELOG
196197
- Change version number to 2.0.0
197198

198-
## [1.0.0] - 19.03.2022
199+
## [1.0.0] - 2022-05-19
199200

200201
**Added:**
201202

CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ if(CONFIG_RAK3172_MODE_WITH_LORAWAN)
2828
endif()
2929
endif()
3030

31-
if(CONFIG_RAK3172_MODE_WITH_LORAWAN)
31+
if(CONFIG_RAK3172_MODE_WITH_P2P)
3232
list(APPEND COMPONENT_SRCS "src/Modes/P2P/rak3172_p2p.cpp")
3333
list(APPEND COMPONENT_SRCS "src/Modes/P2P/rak3172_p2p_rui3.cpp")
3434
endif()
3535

36-
if(CONFIG_RAK3172_MODE_WITH_RF)
37-
list(APPEND COMPONENT_SRCS "src/Modes/RF/rak3172_rf.cpp")
38-
endif()
39-
4036
if((IDF_TARGET STREQUAL "esp32") OR (IDF_TARGET STREQUAL "esp32c2") OR (IDF_TARGET STREQUAL "esp32c3") OR (IDF_TARGET STREQUAL "esp32s2") OR (IDF_TARGET STREQUAL "esp32s3"))
4137
list(APPEND COMPONENT_PRIV_REQUIRES esp_timer)
4238
list(APPEND COMPONENT_SRCS "src/Arch/Timer/rak3172_timer.cpp")
@@ -58,4 +54,4 @@ idf_component_register(SRCS ${COMPONENT_SRCS}
5854

5955
target_compile_definitions(${COMPONENT_LIB} PUBLIC RAK3172_LIB_MAJOR=4)
6056
target_compile_definitions(${COMPONENT_LIB} PUBLIC RAK3172_LIB_MINOR=2)
61-
target_compile_definitions(${COMPONENT_LIB} PUBLIC RAK3172_LIB_BUILD=0)
57+
target_compile_definitions(${COMPONENT_LIB} PUBLIC RAK3172_LIB_BUILD=1)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2023 Daniel Kampert (www.kampis-elektroecke.de)
1+
Copyright (c) 2025 Daniel Kampert (www.kampis-elektroecke.de)
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- [Clock Synchronization](#clock-synchronization)
1010
- [Use with PlatformIO](#use-with-platformio)
1111
- [Use with esp-idf](#use-with-esp-idf)
12-
- [Additional ressources](#additional-ressources)
12+
- [Additional resources](#additional-resources)
1313
- [Support me](#support-me)
1414
- [Maintainer](#maintainer)
1515

@@ -48,7 +48,7 @@ lib_deps =
4848
- Run `menuconfig` from the root of your project to configure the driver and the examples
4949
- Build the project
5050

51-
## Additional ressources
51+
## Additional resources
5252

5353
- [ST AN5554](https://www.st.com/resource/en/application_note/an5554-lorawan-firmware-update-over-the-air-with-stm32cubewl-stmicroelectronics.pdf)
5454
- [LoRaWAN Fragmented Data Block Transport Specification](https://lora-alliance.org/resource_hub/lorawan-fragmented-data-block-transport-specification-v1-0-0/)
@@ -63,4 +63,4 @@ If you are interested in the RAK3172 modules or in other RAKwireless products, y
6363

6464
## Maintainer
6565

66-
- [Daniel Kampert](mailto:daniel.kameprt@kampis-elektroecke.de)
66+
- [Daniel Kampert](mailto:DanielKampert@kampis-elektroecke.de)

examples/ClockSynchronization/Device/main.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "settings/LoRaWAN_Default.h"
1111

1212
static RAK3172_t _Device = RAK3172_DEFAULT_CONFIG(CONFIG_RAK3172_UART_PORT, CONFIG_RAK3172_UART_RX, CONFIG_RAK3172_UART_TX, CONFIG_RAK3172_UART_BAUD);
13+
14+
// WARNING: These are example keys only. Replace with your actual multicast group credentials.
1315
static RAK3172_MC_Group_t _Group = {
1416
.Class = RAK_CLASS_C,
1517
.DevAddr = "B8DD8FDB",
@@ -39,6 +41,8 @@ static void applicationTask(void* p_Parameter)
3941
if(Error != RAK3172_ERR_OK)
4042
{
4143
ESP_LOGE(TAG, "Cannot initialize RAK3172! Error: 0x%04X", static_cast<unsigned int>(Error));
44+
vTaskDelay(5000 / portTICK_PERIOD_MS);
45+
esp_restart();
4246
}
4347

4448
ESP_LOGI(TAG, "Firmware: %s", Info.Firmware.c_str());
@@ -49,6 +53,8 @@ static void applicationTask(void* p_Parameter)
4953
if(Error != RAK3172_ERR_OK)
5054
{
5155
ESP_LOGE(TAG, "Cannot initialize RAK3172 LoRaWAN! Error: 0x%04X", static_cast<unsigned int>(Error));
56+
vTaskDelay(5000 / portTICK_PERIOD_MS);
57+
esp_restart();
5258
}
5359

5460
if(RAK3172_LoRaWAN_isJoined(_Device) == false)
@@ -59,6 +65,8 @@ static void applicationTask(void* p_Parameter)
5965
if(Error != RAK3172_ERR_OK)
6066
{
6167
ESP_LOGE(TAG, "Cannot join network! Error: 0x%04X", static_cast<unsigned int>(Error));
68+
vTaskDelay(5000 / portTICK_PERIOD_MS);
69+
esp_restart();
6270
}
6371
}
6472
else
@@ -90,15 +98,15 @@ static void applicationTask(void* p_Parameter)
9098
ESP_LOGE(TAG, "Clock sync failed! Error: 0x%X", static_cast<unsigned int>(Error));
9199
}
92100

93-
vTaskDelay(10000 / portTICK_PERIOD_MS);
101+
vTaskDelay(3600000 / portTICK_PERIOD_MS);
94102
}
95103
}
96104

97105
extern "C" void app_main(void)
98106
{
99107
ESP_LOGI(TAG, "Starting application...");
100108

101-
_applicationHandle = xTaskCreateStatic(applicationTask, "applicationTask", sizeof(_applicationStack), NULL, 1, _applicationStack, &_applicationBuffer);
109+
_applicationHandle = xTaskCreateStatic(applicationTask, "applicationTask", 8192, NULL, 1, _applicationStack, &_applicationBuffer);
102110
if(_applicationHandle == NULL)
103111
{
104112
ESP_LOGE(TAG, " Unable to create application task!");
File renamed without changes.

0 commit comments

Comments
 (0)