Skip to content

Commit 606dbde

Browse files
committed
ADR_ACK_LIMIT corrections.
1 parent 16e1425 commit 606dbde

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The majority of the work was done by Hendrik Hagendorn and Ideetron B.V. Thanks
4141
# MAC commands supported.
4242

4343
- [x] ADR for Data Rate and TxPower. After join with SF9 in different room from gateway (RSSI -85), TTN sends SF7 (or SF8) ADR command and SlimLoRa conforms.
44-
- [x] ADR_ACK_LIMIT
4544
- [x] NbTrans
4645
- [x] Channel Mask
4746
- [x] RxTimingSetup
@@ -68,6 +67,7 @@ Solutions with avr style.
6867

6968
# Semi-Working
7069

70+
- [x] ADR_ACK_LIMIT, must follow directive on p. 17 based pn ADR_ACK_DELAY
7171
- [x] Duty Cycle. Added GetTXms function to return the TOTAL duration of ALL transmissions. At SF7 1byte reports 45-48ms vs 46ms [theoretical](https://avbentem.github.io/airtime-calculator/ttn/eu868/1) at SF8 reports 84ms vs 82ms (theoretical). SF7 5 bytes reports 52ms vs 51.5ms (theoretical). Application HAVE to read the value of GetTXms() after every transmission to check if the the Duty Cycle is respected. I decided to not respect Duty Cycle on SlimLoRa, since if the device is going to Deep Sleep and wakes up via a accelerometer on AVR MCU's freezes the timer0. I think the solution is the RTC or to read a time from GPS.
7272
- [x] Power to the people. Several values made public. Take care to not write them or you may loose access to the network. Instead of using getters I selected to make public some variables.
7373
- [x] MAC Commands.

Diff for: SlimLoRa.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ void SlimLoRa::RfmSendPacket(uint8_t *packet, uint8_t packet_length, uint8_t cha
758758
// semi TODO fCnt don't increase if we havee UNCONFIRMED_DATA_UP and NbTrans to do.
759759
if ( NbTrans_counter == 0 ) {
760760
tx_frame_counter_++;
761+
adr_ack_counter_++;
761762
NbTrans_counter = NbTrans;
762763
}
763764

@@ -767,7 +768,6 @@ void SlimLoRa::RfmSendPacket(uint8_t *packet, uint8_t packet_length, uint8_t cha
767768
SetTxFrameCounter();
768769
}
769770
#endif
770-
adr_ack_counter_++;
771771
}
772772

773773
/**
@@ -1870,9 +1870,9 @@ void SlimLoRa::Transmit(uint8_t fport, uint8_t *payload, uint8_t payload_length)
18701870
if (adr_enabled_) {
18711871
packet[packet_length] |= LORAWAN_FCTRL_ADR;
18721872

1873-
// Request ACK if data_rate is higher than 0 and adr_ack_counter_ is over the limit
1873+
// Request ADR if adr_ack_counter_ is over the limit of LORAWAN_ADR_ACK_LIMIT
18741874
// p. 17
1875-
if (adr_ack_counter_ >= LORAWAN_ADR_ACK_LIMIT && data_rate_ > 0 ) {
1875+
if (adr_ack_counter_ >= LORAWAN_ADR_ACK_LIMIT ) {
18761876
packet[packet_length] |= LORAWAN_FCTRL_ADR_ACK_REQ;
18771877
}
18781878
}

Diff for: library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SlimLoRa",
3-
"version": "0.6.9",
3+
"version": "0.6.11",
44
"description": "LoRaWAN library with OTAA join, ADR support and most important MAC commands for EU868 suitable for AVR's with 32Kbytes. It uses 14kBytes of program flash instead of 52kBytes of RadioLib or 32kBytes of LMIC. Tested avr32u4 / ATmega32u4 and HopeRF 95w (SX1276) on Adafruit Feather. ABP untested. Session is stored to EEPROM. Testers wanted and PR's for other regions. It supports downlinks.",
55
"keywords": "LoRaWAN, rfm95w, hoperf, SX1276, radio, communication",
66
"repository":

Diff for: library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SlimLoRa
2-
version=0.6.9
2+
version=0.6.11
33
author=clavisound
44
maintainer=clavisound
55
sentence=SlimLoRa Library

0 commit comments

Comments
 (0)