chirpstack / node-red-contrib-chirpstack

ChirpStack Node-RED nodes
https://www.chirpstack.io/
MIT License
13 stars 5 forks source link

downlink enqueueing error #4

Open porzim opened 1 year ago

porzim commented 1 year ago

Hi, we are using the downlink node with chirpstack 4.01 and nod red 3.02 and lates version of the node. we get however always an "enque error" and no logs to understand where the problem is. anything we are missing? we noticed had to change the echo function to adapt to the new upling json format, may something need to be also updated in downlink node? thanks

brocaar commented 1 year ago

Which version of the node-red-contrib-chirpstack version are you using?

porzim commented 1 year ago

latest.. 4….

m

Sent from my iPhone

On 16 Jan 2023, at 15:58, Orne Brocaar @.***> wrote:

 Which version of the node-red-contrib-chirpstack version are you using?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

porzim commented 1 year ago

4.1.1 to be precise … and node red 3.02

but we have found many differences from chirpstack documentation. we are able to enqueue with an our function, however trying with the downlink node either using the echo function as per the example, or with other type of message we always get same error..

Sent from my iPhone

On 16 Jan 2023, at 15:58, Orne Brocaar @.***> wrote:

 Which version of the node-red-contrib-chirpstack version are you using?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

brocaar commented 1 year ago

Could you specify which differences you have found with regards to the documentation? Then I can look into this.

On Mon, Jan 16, 2023, 22:02 porzim @.***> wrote:

4.1.1 to be precise … and node red 3.02

but we have found many differences from chirpstack documentation. we are able to enqueue with an our function, however trying with the downlink node either using the echo function as per the example, or with other type of message we always get same error..

Sent from my iPhone

On 16 Jan 2023, at 15:58, Orne Brocaar @.***> wrote:

 Which version of the node-red-contrib-chirpstack version are you using?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

— Reply to this email directly, view it on GitHub https://github.com/chirpstack/node-red-contrib-chirpstack/issues/4#issuecomment-1384609040, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABIM6MXNM7W3TMJZ63MWGLWSXAOBANCNFSM6AAAAAAT3EYUGM . You are receiving this because you commented.Message ID: @.***>

porzim commented 1 year ago

in the end we found out that in order to enquue downlink using mqtt we have format a payload like this and then transform to a json object

let d = new Date(); let t = d.getTime(); return { payload: { "devEui": msg.payload.deviceInfo.devEui, "fPort": 3, "confirmed": false, "object": { "dat01": msg.payload.data, "dat02": t.toString() } } }

this way message is correctly enqueued

Sent from my iPhone

On 16 Jan 2023, at 23:05, Orne Brocaar @.***> wrote:

 Could you specify which differences you have found with regards to the documentation? Then I can look into this.

On Mon, Jan 16, 2023, 22:02 porzim @.***> wrote:

4.1.1 to be precise … and node red 3.02

but we have found many differences from chirpstack documentation. we are able to enqueue with an our function, however trying with the downlink node either using the echo function as per the example, or with other type of message we always get same error..

Sent from my iPhone

On 16 Jan 2023, at 15:58, Orne Brocaar @.***> wrote:

 Which version of the node-red-contrib-chirpstack version are you using?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

— Reply to this email directly, view it on GitHub https://github.com/chirpstack/node-red-contrib-chirpstack/issues/4#issuecomment-1384609040, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABIM6MXNM7W3TMJZ63MWGLWSXAOBANCNFSM6AAAAAAT3EYUGM . You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

jcwren commented 10 months ago

I'm running into this same issue. Using 4.1.1 with NodeRed v3.0.2. I have an inject node connected to a device downlink node. The API token was created using the web interface "API Keys" function, then pasted into the device downlink token field. The server is specified the same way I log into it (debresc.private.com:18080, as it's running in a container). The encoding is set to BASE64, and I'm not using TLS.

When I inject the following parameters into the device downlink node, it returns the Enqueue error: error, but there's no actual error text returned in the err variable from the client object. It doesn't matter if the payload is defined or not. When it's not defined I see the expected payload is undefined, assuming empty downlink frame message in NodeRed's log.

It doesn't appear that a topic is required, but that's not clear in the documentation. Additionally, while I understand the API key is global, that seems kind of odd. I would have thought an API key would be bound to a particular application, so there's less chance of a bad actor using the "Lighting" application sending messages to the "HVAC" application, etc. But that's likely a whole topic to itself.

{"_msgid":"a00b44f3e6aff38b","topic":"application/8/device/2d027433c50760ab/event/down","devEui":"2d027433c50760ab","fPort":2,"confirmed":true,"payload":"AA=="}