Downlink receives txack but device does not respond to the request

Hello,

I’m trying to send downlinks with Chirpstack and i can’t figure out where the issue is i have a hunch that the issue is config related. So the node is a Elsys node that uses OTAA. When i schedule a downlink the downlink gets txack from gateway as far as i know. But the device doesn’t respond to the requested change.

I have tested the same setup on TTN and have had successful downlinks there. To try to rule out any hardware issues.

The gateway that i use is a Milesight UG65 that i have tested with both “ChirpStack-Generic” and “Semtech” as packet forwarder.

Is there anyone that could point me in the right direction where the issue could be?

Network Server Configuration

[postgresql]
dsn="postgres://chirpstack_ns:chirpstack_ns@postgresql/chirpstack_ns?sslmode=disable"

[redis]
url="redis://redis:6379"

[network_server]
net_id="000000"

[network_server.band]
name="EU868"

[network_server.network_settings]
rx_window=0
enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7]

[[network_server.network_settings.extra_channels]]
frequency=867100000
min_dr=0
max_dr=12

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

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

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

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

[network_server.gateway.backend.mqtt]
server="tcp://mosquitto:1883"

[join_server.default]
server="http://chirpstack-application-server:8003"

[geolocation_server]
server="chirpstack-geolocation-server:8005"

Logs from scheduled downlink

chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="gateway/mqtt: uplink frame received" gateway_id=24e124fffef11584 uplink_id=0202820f-245b-445c-a6ae-cd39b9219bdf
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="uplink: frame(s) collected" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e mtype=UnconfirmedDataUp uplink_ids="[0202820f-245b-445c-a6ae-cd39b9219bdf]"
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="sent uplink meta-data to network-controller" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e dev_eui=a81758fffe044a33
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="pending mac-command deleted" cid=LinkADRReq ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e dev_eui=a81758fffe044a33
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="link_adr request acknowledged" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e dev_eui=a81758fffe044a33 dr=0 enabled_channels="[0 1 2]" nb_trans=1 tx_power_idx=2
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="device gateway rx-info meta-data saved" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e dev_eui=a81758fffe044a33
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="device-session saved" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e dev_addr=0186c9ad dev_eui=a81758fffe044a33
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="finished client unary call" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e grpc.code=OK grpc.ctx_id=de5ff418-721c-4f39-9196-dad0518ce498 grpc.duration=6.835966ms grpc.method=HandleUplinkData grpc.service=as.ApplicationServerService span.kind=client system=grpc
    chirpstack-application-server_1  | time="2021-09-26T14:33:21Z" level=info msg="device last-seen and dr updated" ctx_id=de5ff418-721c-4f39-9196-dad0518ce498 dev_eui=a81758fffe044a33
    chirpstack-application-server_1  | time="2021-09-26T14:33:21Z" level=info msg="finished unary call with code OK" ctx_id=de5ff418-721c-4f39-9196-dad0518ce498 grpc.code=OK grpc.method=HandleUplinkData grpc.request.deadline="2021-09-26T14:33:22Z" grpc.service=as.ApplicationServerService grpc.start_time="2021-09-26T14:33:21Z" grpc.time_ms=6.304 peer.address="172.19.0.8:59136" span.kind=server system=grpc
    chirpstack-application-server_1  | time="2021-09-26T14:33:21Z" level=info msg="integration/http: publishing event" ctx_id=de5ff418-721c-4f39-9196-dad0518ce498 dev_eui=a81758fffe044a33 event_type=up url="http://192.168.0.118:3100?event=up"
    chirpstack-application-server_1  | time="2021-09-26T14:33:21Z" level=info msg="integration/logger: logging event" ctx_id=de5ff418-721c-4f39-9196-dad0518ce498 dev_eui=a81758fffe044a33 type=up
    chirpstack-application-server_1  | time="2021-09-26T14:33:21Z" level=info msg="integration/mqtt: publishing event" ctx_id=de5ff418-721c-4f39-9196-dad0518ce498 dev_eui=a81758fffe044a33 qos=0 retain=false topic=application/1/device/a81758fffe044a33/event/up
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="device-queue deleted" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e id=117
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="pending mac-command block set" cid=LinkADRReq commands=1 ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e dev_eui=a81758fffe044a33
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="gateway/mqtt: publishing gateway command" command=down downlink_id=3a986303-4a72-4158-8ffe-36799a683c1e gateway_id=24e124fffef11584 qos=0 topic=gateway/24e124fffef11584/command/down
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="device-session saved" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e dev_addr=0186c9ad dev_eui=a81758fffe044a33
    chirpstack-network-server_1      | time="2021-09-26T14:33:21Z" level=info msg="storage: downlink-frame saved" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e token=15000
    chirpstack-network-server_1      | time="2021-09-26T14:33:22Z" level=info msg="backend/gateway: downlink tx acknowledgement received" downlink_id=3a986303-4a72-4158-8ffe-36799a683c1e gateway_id=24e124fffef11584
    chirpstack-network-server_1      | time="2021-09-26T14:33:22Z" level=info msg="sent downlink meta-data to network-controller" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e
    chirpstack-application-server_1  | time="2021-09-26T14:33:22Z" level=info msg="downlink tx acknowledged by gateway" dev_eui=a81758fffe044a33
    chirpstack-network-server_1      | time="2021-09-26T14:33:22Z" level=info msg="finished client unary call" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e grpc.code=OK grpc.ctx_id=83452df4-0a42-469b-b19a-bc54ba66a25d grpc.duration=2.067392ms grpc.method=HandleTxAck grpc.service=as.ApplicationServerService span.kind=client system=grpc
    chirpstack-network-server_1      | time="2021-09-26T14:33:22Z" level=info msg="sent tx ack to application-server" ctx_id=3a986303-4a72-4158-8ffe-36799a683c1e
    chirpstack-application-server_1  | time="2021-09-26T14:33:22Z" level=info msg="finished unary call with code OK" ctx_id=83452df4-0a42-469b-b19a-bc54ba66a25d grpc.code=OK grpc.method=HandleTxAck grpc.service=as.ApplicationServerService grpc.start_time="2021-09-26T14:33:22Z" grpc.time_ms=1.572 peer.address="172.19.0.8:59136" span.kind=server system=grpc
    chirpstack-application-server_1  | time="2021-09-26T14:33:22Z" level=info msg="integration/mqtt: publishing event" ctx_id=83452df4-0a42-469b-b19a-bc54ba66a25d dev_eui=a81758fffe044a33 qos=0 retain=false topic=application/1/device/a81758fffe044a33/event/txack
    chirpstack-application-server_1  | time="2021-09-26T14:33:22Z" level=info msg="integration/http: publishing event" ctx_id=83452df4-0a42-469b-b19a-bc54ba66a25d dev_eui=a81758fffe044a33 event_type=txack url="http://192.168.0.118:3100?event=txack"
    chirpstack-application-server_1  | time="2021-09-26T14:33:22Z" level=info msg="integration/logger: logging event" ctx_id=83452df4-0a42-469b-b19a-bc54ba66a25d dev_eui=a81758fffe044a33 type=txack
    chirpstack-network-server_1      | time="2021-09-26T14:33:42Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=24e124fffef11584 stats_id=0a293608-200e-49c9-b332-dcc736e3dadf
    chirpstack-network-server_1      | time="2021-09-26T14:33:42Z" level=info msg="storage: gateway state updated" ctx_id=0a293608-200e-49c9-b332-dcc736e3dadf gateway_id=24e124fffef11584
    chirpstack-application-server_1  | time="2021-09-26T14:33:42Z" level=info msg="gateway updated" ctx_id=1ca7c6cf-ff25-43ef-9147-351d4aaedc03 id=24e124fffef11584 name=ursalinkhome
    chirpstack-network-server_1      | time="2021-09-26T14:33:42Z" level=info msg="finished client unary call" ctx_id=0a293608-200e-49c9-b332-dcc736e3dadf grpc.code=OK grpc.ctx_id=1ca7c6cf-ff25-43ef-9147-351d4aaedc03 grpc.duration=27.794642ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
    chirpstack-application-server_1  | time="2021-09-26T14:33:42Z" level=info msg="metrics saved" aggregation="[MINUTE HOUR DAY MONTH]" ctx_id=1ca7c6cf-ff25-43ef-9147-351d4aaedc03 name="gw:24e124fffef11584"
    chirpstack-application-server_1  | time="2021-09-26T14:33:42Z" level=info msg="finished unary call with code OK" ctx_id=1ca7c6cf-ff25-43ef-9147-351d4aaedc03 grpc.code=OK grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService grpc.start_time="2021-09-26T14:33:42Z" grpc.time_ms=27.421 peer.address="172.19.0.8:59136" span.kind=server system=grpc
    chirpstack-application-server_1  | time="2021-09-26T14:33:55Z" level=error msg="integration/http: publish event error" ctx_id=83452df4-0a42-469b-b19a-bc54ba66a25d dev_eui=a81758fffe044a33 error="http request error: Post \"http://192.168.0.108:5100/api/decoder?event=txack\": dial tcp 192.168.0.108:5100: i/o timeout" event_type=txack url="http://192.168.0.108:5100/api/decoder?event=txack"

Might be worth trying it a few more times.

One thing I notice is that there are MAC commands included in that downlink, because the session is so new its sill being configured.

Would be good to get beyond that so that you get a “clean” downlink with empty fopts, just in case the parser on the device is less than solid.

Are you 100% sure that the downlink payload you queued is what you want, eg that there isn’t any mixup between raw bytes vs. a hexdump of those bytes accidentally sent as the bytes representing the printable hex digits?

Thank you for the repsonse!

I have been trying after longer sessions aswell with the same result.

Asfar as i understand the payload should be valid. Used the same hex on TTN when validating before. But i will check it again to be totally sure about that.

So for example with the elsys downlink generator i change splper to 600 I would take the string and base64 encode it and then queue it in chirpstack correct?

Probably not.

The “string” is a textual hex representation of raw bytes.

I’m not sure if you should be base64 encoding before injecting into chirpstack (may depend on how you do it) but if you do need to base64 encode it yourself, you need to encode the raw bytes, not the string.

eg, this is right, as the hex digits are escaped to produce their byte values

echo -en “\x3E\x05\x14\x00\x00\x02\x58” | base64
PgUUAAACWA==

but this is wrong, as it encodes the printable digits rather than the bytes (and doubles the size)

echo -en “3E051400000258” | base64
M0UwNTE0MDAwMDAyNTg=

I believe the frmPayload in your screenshot is shown in session encrypted form so it’s not directly possible to make sense of, but the length is suspiciously too long if the intended message is similar in length to the 7 bytes represented by 3E051400000258 rather than the 14 bytes comprising the printable string 3E051400000258.

1 Like

That makes sense. Thank you so much.

Well this was embarrassing, this was the issue all along.

Thank you for your swift response.

1 Like