Join request but not accepted

Hi,

I created an application server and a network server on my Raspberry Pi. Everything seems to be ok as i successfully added a new Gateway through the application server web interface.
I registered a new device, Application Key and DeviceEUI must be correct, as the same are used inside a TTN application for which the same device is registered and working.

What i get, both on the device and gateway frame views, is always the following :

The device seems to be activated, even if no Join accept is received, as AppSessionKey and NwkSessionKey are generated at each request, as I can see on the Activation tab.
This is the current setup for the device profile:

LoRaWAN MAC version *
1.0.0
LoRaWAN Regional Parameters revision *
A
ADR algorithm *
Default ADR algorithm
Max EIRP *
0
Uplink interval (seconds) *
600

(No class B or C selected)

And this is the log of the application server at each Join request:

> feb 26 17:16:05 raspberrypi chirpstack-application-server[7880]: time="2021-02-26T17:16:05+01:00" level=info msg="backend/joinserver: request received" message_type=JoinReq receiver_id=70b3d57ed0036ca9 sender_id=000000 transaction_id=3018763251
> feb 26 17:16:05 raspberrypi chirpstack-application-server[7880]: time="2021-02-26T17:16:05+01:00" level=info msg="device-keys updated" ctx_id="<nil>" dev_eui=*xxxxxxxxxxxxxxxx*
> feb 26 17:16:05 raspberrypi chirpstack-application-server[7880]: time="2021-02-26T17:16:05+01:00" level=info msg="backend/joinserver: sending response" dev_eui=*xxxxxxxxxxxxxxxx*message_type=JoinAns receiver_id=000000 result_code=Success sender_id=70b3d57ed0036ca9 transaction_id=3018763251

Any help? What I did to configure the server is following this page and nothing more, only modified user and password in the chirpstak-application/network-server.toml files.
Also tried to set the ApplicationEUI to 000000000000 on the device side.
Thanks in advance

This may help to point out the problem, network session key is generated after the join request, but the application session key is set to 0:
image

This is happening both with a TTN currently registered device (thus sending the AppEUI on Join) and with an unregistered device (TTN Node programmed with arduino, randomly generated AppKey and AppEUI set to 0)

This is driving me crazy, this is the Network server log. Everything seems to be ok, doesn’t it?

mar 01 15:18:31 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:31+01:00" level=info msg="gateway/mqtt: uplink frame received" gateway_id=*XXXXXXXXXXXXXX* uplink_id=5b93d64a-9459-4d73-8cbb-88807065b30b
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="uplink: frame(s) collected" ctx_id=16bcb5de-8a67-4530-8465-bfa5948299dc mtype=JoinRequest uplink_ids="[5b93d64a-9459-4d73-8cbb-88807065b30b]"
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="lorawan/backend: finished backend api call" message_type=JoinReq protocol_version=1.0 receiver_id=70b3d57ed0036ca9 result_code=Success sender_id=000000 transaction_id=3972408433
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="sent uplink meta-data to network-controller" ctx_id=16bcb5de-8a67-4530-8465-bfa5948299dc dev_eui=*XXXXXXXXXXXXXX*
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="device-queue flushed" ctx_id=16bcb5de-8a67-4530-8465-bfa5948299dc dev_eui=*XXXXXXXXXXXXXX*
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="device-session saved" ctx_id=16bcb5de-8a67-4530-8465-bfa5948299dc dev_addr=012e5ff9 dev_eui=*XXXXXXXXXXXXXX*
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="device-activation created" ctx_id=16bcb5de-8a67-4530-8465-bfa5948299dc dev_eui=*XXXXXXXXXXXXXX* id=1869
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="device updated" ctx_id=16bcb5de-8a67-4530-8465-bfa5948299dc dev_eui=*XXXXXXXXXXXXXX*
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="gateway/mqtt: publishing gateway command" command=down downlink_id=16bcb5de-8a67-4530-8465-bfa5948299dc gateway_id=*XXXXXXXXXXXXXX* qos=0 topic=gateway/*XXXXXXXXXXXXXX*/command/down
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="storage: downlink-frame saved" ctx_id=16bcb5de-8a67-4530-8465-bfa5948299dc token=32468
mar 01 15:18:32 raspberrypi chirpstack-network-server[27822]: time="2021-03-01T15:18:32+01:00" level=info msg="backend/gateway: downlink tx acknowledgement received" downlink_id=16bcb5de-8a67-4530-8465-bfa5948299dc gateway_id=*XXXXXXXXXXXXXX*

What else should i look for? Unfortunately my gateway is not a “DIY” one but a commercial solution that should allow me to use it with chirpstack, with these configurations:

Not received or not shown in the ChirpStack web-interface. Please note that ChirpStack relies on the tx acknowledgement of the packet-forwarder. Older packet-forwarder versions did not sent this tx ack, but did transmit the downlink.

If that is the case, your gateway does send the downlink but from the web-interface side, it looks like no downlink was transmitted.

Hi brocaar,
The downlink is neither shown in the application server nor transmitted from the gateway, as the devices (custom board and TTN node) do not success in the OTAA procedure.
The gateway bridge is installed in the same raspberry server.

To be honest i don’t know if inside the gateway the gateway bridge is already installed. How cain i find this out? It is based on a raspberry as well and i do have router access, but no documentation

Well, a quick reply to myself:
The gateway bridge may not be present in the gateway, as the mosquitto_sub command is known.

Moreover, i found a shell script inside the gateway (/opt/LoraServerIO/bin/Lora_pkt_fwd), that, once run:

INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
INFO: no configuration for LBT
INFO: antenna_gain 0 dBi
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -166.000000, tx enabled 1, tx_notch_freq 129000
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -166.000000, tx enabled 0, tx_notch_freq 0
INFO: Lora multi-SF channel 0> radio 0, IF -137500 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1> radio 0, IF 202500 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3 disabled
INFO: Lora multi-SF channel 4 disabled
INFO: Lora multi-SF channel 5 disabled
INFO: Lora multi-SF channel 6 disabled
INFO: Lora multi-SF channel 7 disabled
INFO: Lora standard channel 8 disabled
INFO: FSK channel 8 disabled
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to XXXXXXXXXXX
INFO: server hostname or IP address is configured to “192.168.23.83”
INFO: upstream port is configured to “1700”
INFO: downstream port is configured to “1700”
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to “/dev/ttyAMA0”
INFO: Reference latitude is configured to 0.000000 deg
INFO: Reference longitude is configured to 0.000000 deg
INFO: Reference altitude is configured to 0 meters
INFO: Auto-quit after 1 non-acknowledged PULL_DATA
WARNING: [main] impossible to open /dev/ttyAMA0 for GPS sync (check permissions)
Library version information: Version: Embit HAL Library Version 2.0SP Build 20180320
INFO: FPGA supported features: [TX filter] [Spectral Scan] [LBT]
INFO: [main] concentrator started, packet can now be received

INFO: Disabling GPS mode for concentrator’s counter…
INFO: host/sx1301 time offset=(1614679118s:782654µs) - drift=-951246658µs
INFO: Enabling GPS mode for concentrator’s counter.

INFO: [down] PULL_ACK received in 0 ms
INFO: [down] PULL_ACK received in 1 ms

INFO: Received pkt from mote: D0036CA9 (fcnt=46037)

JSON up: {“rxpk”:[{“tmst”:14347659,“chan”:2,“rfch”:1,“freq”:868.100000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“lsnr”:10.0,“rssi”:-73,“size”:23,“data”:“AKlsA9B+1bNwf0QRcAbFGwCOPQRPjio=”}]}**
INFO: [up] PUSH_ACK received in 1 ms
INFO: [down] PULL_RESP received - token[176:60] : )

JSON down: {“txpk”:{“imme”:false,“rfch”:0,“powe”:14,“ant”:0,“brd”:0,“tmst”:19347659,“freq”:868.1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“ipol”:true,“size”:33,“data”:“IORHeE6ORTu0wgQ/cFrfVW1Oa/puFdeIDKmCsG2mdp/5”}}
ERROR: Packet REJECTED, unsupported frequency - 868100000 (min:865000000,max:867000000)
INFO: [down] PULL_RESP received - token[176:60] : )

JSON down: {“txpk”:{“imme”:false,“rfch”:0,“powe”:27,“ant”:0,“brd”:0,“tmst”:20347659,“freq”:869.525,“modu”:“LORA”,“datr”:“SF12BW125”,“codr”:“4/5”,“ipol”:true,“size”:33,“data”:“IORHeE6ORTu0wgQ/cFrfVW1Oa/puFdeIDKmCsG2mdp/5”}}
ERROR: Packet REJECTED, unsupported frequency - 869525000 (min:865000000,max:867000000)
INFO: [down] PULL_ACK received in 0 ms

INFO: Received pkt from mote: D0036CA9 (fcnt=46037)

JSON up: {“rxpk”:[{“tmst”:26948811,“chan”:2,“rfch”:1,“freq”:868.100000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“lsnr”:9.2,“rssi”:-69,“size”:23,“data”:“AKlsA9B+1bNwf0QRcAbFGwAiCCqyHbU=”}]}
INFO: [up] PUSH_ACK received in 1 ms
INFO: [down] PULL_RESP received - token[141:192] : )

JSON down: {“txpk”:{“imme”:false,“rfch”:0,“powe”:14,“ant”:0,“brd”:0,“tmst”:31948811,“freq”:868.1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“ipol”:true,“size”:33,“data”:“IBPB9GnQGUqqlehY0m8uo5lxUxfWelFFKYUclY7gHSmz”}}
ERROR: Packet REJECTED, unsupported frequency - 868100000 (min:865000000,max:867000000)
INFO: [down] PULL_RESP received - token[141:192] : )

JSON down: {“txpk”:{“imme”:false,“rfch”:0,“powe”:27,“ant”:0,“brd”:0,“tmst”:32948811,“freq”:869.525,“modu”:“LORA”,“datr”:“SF12BW125”,“codr”:“4/5”,“ipol”:true,“size”:33,“data”:“IBPB9GnQGUqqlehY0m8uo5lxUxfWelFFKYUclY7gHSmz”}}
ERROR: Packet REJECTED, unsupported frequency - 869525000 (min:865000000,max:867000000)

2021-03-02 09:59:11 GMT #####
[UPSTREAM] ###
RF packets received by concentrator: 2
CRC_OK: 100.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
RF packets forwarded: 2 (46 bytes)
PUSH_DATA datagrams sent: 2 (409 bytes)
PUSH_DATA acknowledged: 100.00%
[DOWNSTREAM] ###
PULL_DATA sent: 3 (100.00% acknowledged)
PULL_RESP(onse) datagrams received: 4 (854 bytes)
RF packets sent to concentrator: 0 (132 bytes)
TX errors: 0
BEACON queued: 0
BEACON sent so far: 0
BEACON rejected: 0
[JIT] ###
SX1301 time (PPS): 32257999
src/jitqueue.c:448:jit_print_queue(): INFO: [jit] queue is empty
[GPS] ###
GPS sync is disabled
END #####

I think the error is self explaining, but i now can’t figure out what and where is wrong with my parameters! This is the network configuration file:

[network_server.band]
name=“EU868”

LoRaWAN network related settings.
[network_server.network_settings]

# Extra channel configuration.
#
# Use this for LoRaWAN regions where it is possible to extend the by default
# available channels with additional channels (e.g. the EU band).
# The first 5 channels will be configured as part of the OTAA join-response
# (using the CFList field).
# The other channels (or channel / data-rate changes) will be (re)configured
# using the NewChannelReq mac-command.
#
[[network_server.network_settings.extra_channels]]
frequency=867100000
min_dr=0
max_dr=5

[[network_server.network_settings.extra_channels]]
frequency=867300000
min_dr=0
max_dr=5

[[network_server.network_settings.extra_channels]]
frequency=867500000
min_dr=0
max_dr=5

[[network_server.network_settings.extra_channels]]
frequency=867700000
min_dr=0
max_dr=5

[[network_server.network_settings.extra_channels]]
frequency=867900000
min_dr=0
max_dr=5

While this is the (/opt/LoraServerIO/bin/global_conf.json)

   "SX1301_conf": {
            "lorawan_public":true,
            "clksrc": 1,
            "clksrc_desc": "radio_1 provides clock to concentrator for most devices except MultiTech. For MultiTech set to 0.",
            "antenna_gain": 0,
            "antenna_gain_desc": "antenna gain, in dBi",
            "radio_0": {
                    "enable":true,
                    "type": "SX1257",
                    "freq":867500000,
                    "rssi_offset": -166.0,
                    "tx_enable": true,
                    "tx_freq_min": 865000000,
                    "tx_freq_max": 867000000,
                    "tx_notch_freq": 129000
            },
            "radio_1": {
                    "enable":true,
                    "type": "SX1257",
                    "freq":868500000,
                    "rssi_offset": -166.0,
                    "tx_enable": false

There is no reason why, but i discovered that the opt/LoraServerIO/bin/global_conf.json file was the IN one present at the TTN repository (https://github.com/TheThingsNetwork/gateway-conf).
I replaced it with the EU one and everything is working!