Enqueue_downlink script

Hello,

I’m trying to send a command to the device via this example:
https://www.chirpstack.io/docs/chirpstack/api/js-examples.html

But I get the following error:
13. Error: 13 INTERNAL: Invalid string length

I suspect that the error is now somehow related to that api token. I think that should be correct, but I just can’t get that code to work.

Could someone tell me what the problem could be?

Give us some screenshots to debug.
Especially your token and your downlink payload.
You can hide part of sensitive data.

It takes times to “guess” these days.

1 Like

Hi,

thanks for the reply, here is screenshot of code and debug:


It complains about string length.

I don’t use ChirpStack grpc but this seems not right.
Are you sure the format for the deveui required by grpc is like this?

This is from ChirpStack REST API.

Generally, DevEUI is often like string of hexes.
image

Hi,

I changed DevEUI address binary to hex, and now script works, thanks.

Some reason chirpstack guidance show that deveui is binary: JavaScript examples - ChirpStack open-source LoRaWAN® Network Server documentation

BTW is there other way send downlink command than grpc thru api? Iam using mainly my old chirpstack 3, but in the future i want upgrade it to 4 version.

1 Like

Glad it works now for you. Your screenshots are helpful.
Yah, it may be confusing.
The author means hex 0101010101010101. That’s why the string is short.

GRPC is the main API.
Then ChirpStack v4 has REST API to point to gRPC.
I use REST API instead.

In Chirpstack v3, there is built-in REST API.
In Chirpstack v4, we have to install it.

1 Like

There is also the MQTT integration downlink capability:
https://www.chirpstack.io/docs/chirpstack/integrations/mqtt.html

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.