OTAA activation in TTN LoRaWAN Please HELP

1 - Node is TTGO LORA32 868/915MHz
scatch is provided in file main.cpp.txt
But the same issues we have with other kind of nodes we have tested

FiPy, LoPy from pycom programed via micropython
Feather32u programed with Arduino Studio
-TTGO LoRA32 - with Arduino Studio and right now I use the Visual Studion
at all nodes we are able create scatch which have the same issues like is described with TTGO LoRa32
We also test a many LMIC library right now we are using https://github.com/matthijskooijman/arduino-lmic
but in other library such as
MCCI LoRaWAN LMIC library by IBM
MCCI Arduino Development Kit ADK by Terry Moore
the issue is exactly same.

2 - Gateway Rpi 3 +ic880 with code of ttt-gateway cca 10 days old

3 - screen shot show related request at device and gateway.
There is no difference if it is after restart of node or if it it after some times of running node.
As you can see from device screen the Join request is repeated after some time.
At gateway screen is repeated the both request join and accept join.
I opened the relevant request to the device screen based on time of creation.

The question from previous:
-What does clicking an Activation show you? At printscreen

Distance between your own gateway and the device - 5m

Did your device use downlinks while it was still working, and if yes: did that work? (Including confirmed uplinks.) -
In past cca to the 09.2019 I had cca 68 nodes which work withou any problem. Since 09.2019 the new node which we want to introduce has this issues and the nodes which was working in past and is restarted from any kind of reason (battery changes, clasical restart) has this issues too.

Does your device use ADR, and if yes: what SF was it using when it still worked? (If that was SF12, then such might indicate it has not been receiving downlinks for some time before you changed the battery.)
I don’t know. When we start our first aplication 2018 with 68 nodes and 5 gateways we don’t need any modification of default examples from library. We setup the app_eui, dev_eui in proper format and everything works. Last couple months we play a game with several things and the results is in scatch file main.cpp.txt

We have in Czech Republic a commercial provider Ceske Radiokomunikace CRA and if I use exactly sam

e code (default example for OTAA activation) and only change app_eui, dev_eui to the setup for device in CRA LoRaWAN everything works.
We are in situation that we want to use a community LoRaWAN network TheNetworkThings from reason that the idea of TTN is close to our mind. We want to be independent from commercial provider, open for local communities.

I am working at University UJEP and we have access to the founding for increasing of the nr. of gateways to cover almost all Ustecky Region in Czech Republic. We have ideas for sensors which we can provide to our partner in the related project, number of sensors could be hundreds almost immediately (electricity presence 68, flooding and dry sensor for Ustecky kraj - cca 100, CO2 measurement in school room 200+ etc.).

-Are there other gateways in your neighbourhood? Right now I am located at home a there is only one gateway. At University we have cca 4-6 gateways at the University building.
Device Gateway ttn-syslog.txt (186.0 KB) ttnlog.txt (5.4 KB) main.cpp.txt (8.7 KB)

Check your networks as it looks like the gateway is not receiving any data from TTN. You should see:

### [DOWNSTREAM] ###
# PULL_DATA sent: 3 (100.00% acknowledged)

Notice the 100%. Your log shows 0% which means the return packets from TTN are not received by the gateway and as a result downlink (required for OTAA) will not work.

Fix that and your nodes should start working as expected.

As previously requested:

Thanks a lot for your effort.
I find that at gateway was running the openvpn which do something strange. In case when the openvpn services is stopped then everything works.

Thanks for the follow up.
Good that you were able to find the origin of the problem.