Giter VIP home page Giter VIP logo

Comments (8)

kallemooo avatar kallemooo commented on July 20, 2024

Antenna switching is enabled in the example.

The problem is that the default timekeeping in the STM32 (almost all examples, including the Aurdino plattform) is using interrupts to count milliseconds.
The LMIC radio core is executing with interrupts disabled and that causes timekeeping instability.

The result is that the receive window is missed and join is delayed.

To mitigate this problem this following can be done:

  • Set LMIC_setClockError so the RX window is opened for longer time.
    • LMIC_setClockError(MAX_CLOCK_ERROR / 10u);
  • Set inital SF to SF9 then join succeeds much faster, as the receive window timing is less strict in SF9.
  • Make sure that power is stable.
    • If WisTrio-Lora RAK5205 is used the battery must be connected or J11 connected so power is stable.

from rak811_lorawan_arduino.

MilovdZee avatar MilovdZee commented on July 20, 2024

Thank you very much. I'll experiment with your suggestions.

from rak811_lorawan_arduino.

mtbspace avatar mtbspace commented on July 20, 2024

@MilovdZee, did you manage to solve this?

I have the same problem. I can see the Join Request is accepted on the gateway, but it is not received on the RAK811. I have tried experimenting with different clock errors and different Spread factors when joining, but it is not helping.

@kallemooo, when you say 'Antenna switching is enabled in the example', are you referring to this line of code?
.rxtx = 32,

There is more information about switching on the radios here, but this is also not helping:

stm32duino/Arduino_Core_STM32#859

Receive state:

pinMode(RADIO_RF_CRX_RX, OUTPUT);
digitalWrite(RADIO_RF_CRX_RX, 1); //control LoRa work to receive
pinMode(RADIO_RF_CTX_PA, OUTPUT);
digitalWrite(RADIO_RF_CTX_PA, 0); //

Transmit state:

pinMode(RADIO_RF_CRX_RX, OUTPUT);
digitalWrite(RADIO_RF_CRX_RX, 0);
pinMode(RADIO_RF_CTX_PA,OUTPUT);
digitalWrite(RADIO_RF_CTX_PA, 1); //control LoRa send by PA_BOOST

from rak811_lorawan_arduino.

MilovdZee avatar MilovdZee commented on July 20, 2024

Hello, I did not proceed with this. I'm actually trying it in a different way and that is by fully trying to understand the protocol and do it myself. But not much luck yet. The library seems a bit overkill for just registering...

from rak811_lorawan_arduino.

mtbspace avatar mtbspace commented on July 20, 2024

I've got this working... I should have read the mcci-catena / arduino-lmic documents sooner! They tell the user to ensure they call 'os_runloop_once()' often enough, because it is polling. I had a delay in my main loop, so it wasn't getting called nearly often enough to catch the join accept.

OTAA is working with no changes to the code (other than keys/EUIs), including no extra allowance for clock error.

I've not tried class b or class c

EDIT: Seems I shouted too soon... Although it now joins easily, receiving downlinks is not reliable

from rak811_lorawan_arduino.

jezdd avatar jezdd commented on July 20, 2024

Having same issues here, I tried going back to older mcci-catena / arduino-lmic versions 3.0, 3.1 etc as were working at one point.

Its all related to the RAK811 tracker being unable to receive downlinks/joins etc - I will try in ABP mode and test normal downlinks.

In my testing on the latest versions of STM core/libraries I am getting OTAA to join maybe once in 50 attempts.

Anyone made progress?

from rak811_lorawan_arduino.

jezdd avatar jezdd commented on July 20, 2024

Been playing with this and got OTAA working but its limited, from my point of view this seems to be a RX1/2 window timing issue.

Using the following I can get SF10 to connect via OTAA every time, also SF11 and SF12 too with less aggressive setclockerror settings. Of course you could switch to ABP but there will still be issues with downlinks.

    case EV_JOINING:
        LMIC_setClockError(MAX_CLOCK_ERROR * 50 / 100);  //Relax RX timing window
        LMIC_setDrTxpow(DR_SF10, 14);  // DR TxPower
        Serial.println(F("EV_JOINING"));
        break;

I am using latest platform and libraries under PlatformIO for testing.

from rak811_lorawan_arduino.

jezdd avatar jezdd commented on July 20, 2024

If anyone is out there I have found a working and stable setup, EU freq from SF7 to SF12 - more a stumble while testing all combo, I stripped back all adjustments for starters. So basic default code:

setup......
os_init();
LMIC_reset();
LMIC_setClockError(MAX_CLOCK_ERROR * 5 / 100); //Relax RX timing window
// LMIC_setAdrMode(true); // ADR
do_send(&sendjob);

case EV_JOINING:
// LMIC_setAdrMode(true); // ADR
LMIC_setDrTxpow(DR_SF7, 14); // DR TxPower
Serial.println(F("EV_JOINING"));
break;

platformio.ini
build_flags =
-D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS
-D CFG_eu868=1
-D CFG_sx1276_radio=1
-D DISABLE_PING
-D DISABLE_BEACONS
; remove this -D LMIC_ENABLE_arbitrary_clock_error=1

from rak811_lorawan_arduino.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.