probably no reason for your troubles but you have a recursive call to join() in the if statement. That may not be a problem till the stack runs out due to not joining.
Woah there cowboy, once more I don’t see explicit detail that tells the volunteers trying to help you, but as @Jeff-UK says, I do see a focus on screen shots of the gateway config.
First rule of LoRaWAN club, have a known good working node and a recent gateway. Then you can indulge in any gateway and any device you like, as you have a base line to test against.
My money is that the issue is related to the endianness of the keys as that is a recurring theme here, comes up two or three times a month. RTFM for the win.
As @bnnorman says, the recursion on on the Join is likely to lead to a StackOverflow™, literally. Second rule of LoRaWAN club is use the provided vanilla no-frills example provided by the vendor. Sadly the MKR WAN 1310 is a “special” with more than a few wrinkles in its application. So definitely go with the out-of-the-box example, having extracted the DevEUI that Arduino derives from its v1 library for the board (v1.1.0) that uses the firmware for the Murata module v1.2.3.
Third rule of LoRaWAN club is use recommended hardware - which the Arduino MKR WAN 1310 is absent from that list as the unique combo of SAMD21 with a CMWX1ZZABZ-078 module consisting of the STM32L071 + SX1276 module is a total geekfest but has far too much going on for most getting started sort of situations.
And whilst there is the potential to run LMIC on the SAMD to drive the radio directly, that’s just weird when you have a LoRaMAC-node based module driven by AT commands. And complicated.
TL;DR - go with anything from the LMIC-node recommended hardware list and follow the instructions to the letter.
I personally recommend the Adafruit Feather M0 with RFM95. It has plenty of flash space & RAM and is real easy to get to sleep (other current threads not withstanding).
I haven’t tested de LMIC library, due to some work that I got
Select individual rights then chose Link as Gateway…… and then try again
Change to ‘Grant individual rights’ and check ‘Link as Gateway to a Gateway Server …’ and . Then try again please.