Python to automatically send a downlink to a v3 device using the HTTP webhook

Hi Guys,

I am currently working on a web interface where the user can program custom sending intervals and transmit them via downlink to a v3 device.

For this project, I am using a LDDS75 distance sensor from Dragino:

Here is a sample code for the payload:

Downlink Command: 0x01

Format: Command Code (0x01) followed by 3 bytes time value.

If the downlink payload=0100003C, it means set the END Node’s Transmit Interval to 0x00003C=60(S), while type code is 01.

Example 1: Downlink Payload: 0100001E // Set Transmit Interval (TDC) = 30 seconds
Example 2: Downlink Payload: 0100003C // Set Transmit Interval (TDC) = 60 seconds

I have found following ressources
- outdated python sdk for ttn

I think this is the most recent and relevant resource on the subject downlink programming with http, mqtt etc.

And this documentation provides the http example that I think fits my needs best.

Is there a python example for sending the post request?

Not yet, because I don’t do downlinks, but if (OK, when) I do, it will appear here:

You can see how to send requests for data in the Data Storage example - downlinks are the same, just a different incantation - the computer doesn’t know you are sending a downlink rather than requesting data so don’t worry about the direction.

@descartes thank you for the friendly help as always. I’ll just try to implement it. There shouldn’t be too many hurdles with the provided documentation.

1 Like

@descartes I’m progressing a bit with my application that schedules a downlink using python. Right now, i can schedule a downlink with following payload:
“frm_payload”:“vu8=”

As provided in the documentation.

And I also see the data arriving:
image

But what kind of format is vu8=?

I would like to transmit the payload 0x00003C as provided here on page 27: https://www.dragino.com/downloads/downloads/LoRa_End_Node/LDDS75/LoRaWAN_LDDS75_User%20Manual_v1.4.pdf to change the sending interval.

That’s isn’t progress that is regression for all! As just posted in the other thread

When thinking of downlinks and especially automating the process have in mind the TTN FUP … limit is 10 per day… and as Nick of these parts says whenever a downlink happens a puppy goes hungry. Downlinks render the gw deaf to uplinks…your convenience is a nightmare for all other community users in range of said gw!

One every 6 mins? :scream: :scream_cat: :bomb:

Don’t worry, I’m prototyping this in my office plus I’m also just sending uplinks/downlinks to gateways that we brought out in the field.

Sorry but no! Response here