Send Downlink SQL request

Good afternoon friends. I am new to work with ChirpStack and I have a problem when sending DownLink to a device, I need to send a message like HEX “0С01” in BASE64 “DAE =”


Everything works correctly through the WEB, but I need to send the same message directly through the SQL query to the ChirpStaсk database

Here is my request to create a downlink entry:

INSERT INTO device_queue (id,created_at, updated_at, dev_eui, frm_payload, f_cnt, f_port, confirmed, is_pending, timeout_after, emit_at_time_since_gps_epoch, dev_addr, retry_after) VALUES (‘888’, ‘08.11.2021 18:23:40’, ‘08.11.2021 18:23:40’, decode(‘0000000000000002’, ‘hex’), ‘DAE=’, ‘1’, ‘4’, ‘FALSE’, ‘FALSE’, null, ‘0’, decode(‘01CAA576’, ‘hex’), ‘01.01.0001 0:00:00’)

And I get the wrong base64 value


Tell me how to send downlink via SQL request?

Please don’t do this. The database schemas are subject to change, and Postgres isn’t the only place that ChirpStack stores data and state.

1 Like

Please tell me where you can learn more about the principle of forming a Downlink package?
Do I understand correctly that DOWNLINK can only be sent via WEB or MQTT?

You can use the REST api to do that.

2 Likes

Thanks! The solution with the REST API turned out to be successful.

1 Like