[solved] How to initiate downlink message to TTN console

I’d love to implement a demo where a temperature forecast from a free, open weather API (i.e. darksky.com) is forwarded as downlink to a LoRa node and shown there at an ePaper screen.

I am aware that downloads should be used rarely, however this demo would work with two updates per day or so sufficiently.

My current setup allows to schedule some payload as downlink in the TTN console and to receive this payload on the node and show its content on the ePaper successfully (code is based on ideetron/nexus).

What I don’t understand is if it is possible to trigger a http-get-request from the weather api to the TTN console.

Any support would be great…

Thanks + Cheers,
Robert

That is highly unlikely but depends on what the weather api provides. Most likely you need some code in between that pulls the information from the weather api, translates it to the format required for TTN and pushes it to TTN.

Consider also that with class A nodes downlinks can be only an answer to a node uplink, so the trigger will be a packet sent by the node to some script, which will call the weather API and send it’s data back to the URI you find in the JSON received.

Given the tight timing that will only work if the weather API responds within 50 ms. I would suggest queuing downlink data at regular intervals during the day and replacing the scheduled downlink (check the TTN API on how to do that) if it hasn’t been sent yet.

You are right, I was thinking at how to avoid delays due to the weather API but in fact is better to just asynchronously schedule downlinks.

OK thanks. Just learned that Node RED with its TTN integration could be useful for this task.

The flow below checks regularely (i.e. every hour) the weather API, extracts temperature/humidity etc. from the http response and forms the payload which is then added/replaced to the TTN console.

image

This now works fine but is running only locally; the next step is to find out how to run it permanently.

1 Like