Another discover : as this f****ing LiveObject is taking hhouurssss to change a profile, I think I missed a thing when join process worked : I tested another generic profile named “LORA/GenericA.1.0.2b_ETSI_Rx2-SF12” but I can’t know what is the real operationnal profile, I thougth that it was RX9SF2 profile that it was working but I am pretty sure it was LORA/GenericA.1.0.2b_ETSI_Rx2-SF12 what was “really” being used because when it works it’s using the same SF as the JOIN_REQ (like TTN) so I see some JOIN_ACCEPT with SF7 and it works. What a mess …
So finally here the probable scenario :
LiveObjects profile “Generic_classA_RX2SF12” use only RX2 with SF12
LiveObjects profile “Generic_classA_RX2SF9” use only RX2 with SF9
LiveObjects profile “LORA/GenericA.1.0.2b_ETSI_Rx2-SF12” use RX1 with SF accept = SF request (+RX2SF12 ?)
beegee-tokyo/SX126x-Arduino has an issue with RX2 so we can consider that RX2 windows is not working (as previous @beegee tests show) so if exchanges between gateway and node are tried on RX2, it cant work.
UPDATE :
Sorry for the multiple posts but I prefer to give the maximum information in case anyone meet the same troubles as me xD
I found a workaround, it’s not pretty but even with Generic_classA_RX2SF12 it works !
In RegionEU868.cpp → bool RegionEU868RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate) I just commented the return false :
if (Radio.GetStatus() != RF_IDLE)
{
//return false;
}
I think this part is just a safety to avoid changing radio parameters as the stack is using it, but as the stack already manage that, we can be confident in the fact that it could not happen when there is no other issue.
Clearly it doesn’t fix the real issue, but now everything seems to work well !
UPDATE2
I think I found the issue !!
So background first :
In order to manage timings, the library use two mecanisms : one base on MCU timers and the timeout function included in SX127x. If I detail join process as it should happen :
- TX JOIN request is sent and RX1TIMER is started for 5000 ms, and RX2TIMER is started for 6000 ms.
- RX1 Timer is triggered, and Sx126x is configured to receive. Here internal Sx126x timeout function is activated.
- Sx1276 internal timeout is triggered, leading to STANDBY state.
- RX2Timer is triggered, and Sx126x is configured to receive. Here internal Sx126x timeout function is activated.
- Sx1276 internal timeout is triggered, leading to STANDBY state and triggering a JOIN_FAIL event.
This process is what SHOULD happen, BUT the SX126x timeout is badly configured : the registry is configured without taking account that there is a conversion to do, leading to a timeout which is triggered after the RX2Timer. So it’s why the library complains that the radio is not in stand by mode.
I made this simple correction (I think there is a better to do but for now …) :
src/radio/sx12x/radio.cpp → void RadioSetRxConfig(RadioModems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
uint32_t bandwidthAfc, uint16_t preambleLen,
uint16_t symbTimeout, bool fixLen,
uint8_t payloadLen,
bool crcOn, bool freqHopOn, uint8_t hopPeriod,
bool iqInverted, bool rxContinuous)
there is this :
// Timeout Max, Timeout handled directly in SetRx function
RxTimeout = 0xFA0;
I changed it to 700 and it’s joining on RX2 SF12.
Why 700 ? it’s a little bit arbitrary … Data sheet is not clear on this point : https://www.mouser.com/datasheet/2/761/DS_SX1261-2_V1.1-1307803.pdf → 13.1.5 SetRx
They do not explain on this registry what is the unit for duration. As any other timeout in this datasheet is using 15.625µs as conversion factor, I did the same. 700 * 15.625 = 11 ms (it’s too short I think compared to LoraWan specs, tell me if you find the exact value )