<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[What is the best way to send downlink data?]]></title><description><![CDATA[<p dir="auto">To set the time on a node (without wifi) I have made a small Python script. It sends the date/time as a string, like '201712101458'. Is this the preferred way to send data, or is there a better way?</p>
<p dir="auto">I have included some code below. I could not find a way to format the code in a codeblock. so sorry for the formatting.</p>
<p dir="auto">Here is the simple Python script to send the data:</p>
<p dir="auto">import requests<br />
from datetime import datetime</p>
<p dir="auto">nu = datetime.now()<br />
datum = nu.strftime('%Y%m%d%H%M')<br />
payload = datum.encode('base64')<br />
r = requests.post(&quot;<a href="https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/f4ce46a550ec/12?key=ttn-account-v2.-" target="_blank" rel="noopener noreferrer nofollow">https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/f4ce46a550ec/12?key=ttn-account-v2.-</a>&lt;removed&gt;&quot;,<br />
json={<br />
&quot;dev_id&quot;: &quot;&lt;removed&gt;&quot;,    # The device ID<br />
&quot;port&quot;: 1,                # LoRaWAN FPort<br />
&quot;confirmed&quot;: False,       # Whether the downlink should be confirmed by the device<br />
&quot;payload_raw&quot;: payload    # Base64 encoded payload<br />
})<br />
print(r.status_code, r.reason)</p>
<p dir="auto">On the node I set the time this way:</p>
<p dir="auto">rtc.init((int(rx[0:4]),int(rx[4:6]),int(rx[6:8]),int(rx[8:10]),int(rx[10:12])))</p>
]]></description><link>https://forum.pycom.io/topic/2282/what-is-the-best-way-to-send-downlink-data</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 20:32:49 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/2282.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Dec 2017 14:07:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to What is the best way to send downlink data? on Sun, 10 Dec 2017 14:08:43 GMT]]></title><description><![CDATA[<p dir="auto">To set the time on a node (without wifi) I have made a small Python script. It sends the date/time as a string, like '201712101458'. Is this the preferred way to send data, or is there a better way?</p>
<p dir="auto">I have included some code below. I could not find a way to format the code in a codeblock. so sorry for the formatting.</p>
<p dir="auto">Here is the simple Python script to send the data:</p>
<p dir="auto">import requests<br />
from datetime import datetime</p>
<p dir="auto">nu = datetime.now()<br />
datum = nu.strftime('%Y%m%d%H%M')<br />
payload = datum.encode('base64')<br />
r = requests.post(&quot;<a href="https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/f4ce46a550ec/12?key=ttn-account-v2.-" target="_blank" rel="noopener noreferrer nofollow">https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/f4ce46a550ec/12?key=ttn-account-v2.-</a>&lt;removed&gt;&quot;,<br />
json={<br />
&quot;dev_id&quot;: &quot;&lt;removed&gt;&quot;,    # The device ID<br />
&quot;port&quot;: 1,                # LoRaWAN FPort<br />
&quot;confirmed&quot;: False,       # Whether the downlink should be confirmed by the device<br />
&quot;payload_raw&quot;: payload    # Base64 encoded payload<br />
})<br />
print(r.status_code, r.reason)</p>
<p dir="auto">On the node I set the time this way:</p>
<p dir="auto">rtc.init((int(rx[0:4]),int(rx[4:6]),int(rx[6:8]),int(rx[8:10]),int(rx[10:12])))</p>
]]></description><link>https://forum.pycom.io/post/13472</link><guid isPermaLink="true">https://forum.pycom.io/post/13472</guid><dc:creator><![CDATA[rvandam]]></dc:creator><pubDate>Sun, 10 Dec 2017 14:08:43 GMT</pubDate></item></channel></rss>