<?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[LoPy LoraWAN gateway with an ST LoraWAN device]]></title><description><![CDATA[<p dir="auto">I'm trying to connect a couple of Class-A ST devices to TTN using a LoPy LoraWAN gateway.</p>
<p dir="auto">From the Gateway management page in TTN I see that the nano gateway receives the join request and forward it. Then it transmits the join confirmation received from TTN. But the ST device never receives it.</p>
<p dir="auto">Debugging the ST code, I see that the device specifies join answer delays of 5 and 6 seconds, while, looking at the TTN log, the gateway appears to transmit the join answer after slightly more than 4 seconds (so before the 5 seconds). Is the log reliable? It the nano gateway intended to respect transmission windows?</p>
<p dir="auto">Any other idea which could be the reason for ST device to fail receiving the join confirmation?</p>
<p dir="auto">Regards,<br />
Bernardo</p>
]]></description><link>https://forum.pycom.io/topic/1330/lopy-lorawan-gateway-with-an-st-lorawan-device</link><generator>RSS for Node</generator><lastBuildDate>Sat, 17 Oct 2026 17:42:52 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/1330.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Jun 2017 14:02:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LoPy LoraWAN gateway with an ST LoraWAN device on Sat, 10 Jun 2017 14:02:15 GMT]]></title><description><![CDATA[<p dir="auto">I'm trying to connect a couple of Class-A ST devices to TTN using a LoPy LoraWAN gateway.</p>
<p dir="auto">From the Gateway management page in TTN I see that the nano gateway receives the join request and forward it. Then it transmits the join confirmation received from TTN. But the ST device never receives it.</p>
<p dir="auto">Debugging the ST code, I see that the device specifies join answer delays of 5 and 6 seconds, while, looking at the TTN log, the gateway appears to transmit the join answer after slightly more than 4 seconds (so before the 5 seconds). Is the log reliable? It the nano gateway intended to respect transmission windows?</p>
<p dir="auto">Any other idea which could be the reason for ST device to fail receiving the join confirmation?</p>
<p dir="auto">Regards,<br />
Bernardo</p>
]]></description><link>https://forum.pycom.io/post/8274</link><guid isPermaLink="true">https://forum.pycom.io/post/8274</guid><dc:creator><![CDATA[berpast]]></dc:creator><pubDate>Sat, 10 Jun 2017 14:02:15 GMT</pubDate></item><item><title><![CDATA[Reply to LoPy LoraWAN gateway with an ST LoraWAN device on Sat, 10 Jun 2017 19:01:22 GMT]]></title><description><![CDATA[<p dir="auto">It's normal to see the response appear in TTN before actual transmission, the packet includes a tmst field which tells the gateway when to actually transmit it (and starting point is the the tmst of the initial packet) so the time when TTN sends the packet doesn't matter*</p>
<p dir="auto">(* as long as it's not too late - you must have a fast link from the gateway to TTN backend, any ping latency over 500ms will cause problems)</p>
<p dir="auto">The nano gateway code then schedules the transmission using an Alarm:</p>
<p dir="auto"><a href="http://nanogateway.py" target="_blank" rel="noopener noreferrer nofollow">nanogateway.py</a> line 224:</p>
<pre><code>              self.uplink_alarm = Timer.Alarm(handler=lambda x: self._send_down_link(binascii.a2b_base64(tx_pk[&quot;txpk&quot;][&quot;data&quot;]), tx_pk[&quot;txpk&quot;][&quot;tmst&quot;] - 10, tx_pk[&quot;txpk&quot;][&quot;datr&quot;], int(tx_pk[&quot;txpk&quot;][&quot;freq&quot;] * 1000000)), us=t_us)
</code></pre>
<p dir="auto">However that particular section of the code doesn't seem very 'bulletproof' to me. Would you mind sharing your TTN logs (the join request and accept responses) to help with this?</p>
]]></description><link>https://forum.pycom.io/post/8283</link><guid isPermaLink="true">https://forum.pycom.io/post/8283</guid><dc:creator><![CDATA[jmarcelino]]></dc:creator><pubDate>Sat, 10 Jun 2017 19:01:22 GMT</pubDate></item><item><title><![CDATA[Reply to LoPy LoraWAN gateway with an ST LoraWAN device on Sun, 11 Jun 2017 10:44:40 GMT]]></title><description><![CDATA[<p dir="auto">I think I found the culprit (and possibly this is the root cause of the issue reported in the last comment to: <a href="https://forum.pycom.io/topic/884/ttn-join-accept-not-handled-properly">https://forum.pycom.io/topic/884/ttn-join-accept-not-handled-properly</a>)</p>
<p dir="auto">I'm using the latest firmware, and the error is caused by the lines:<br />
stats = lora.stats()<br />
self._push_data(self._make_node_packet(rx_data, self.rtc.now(), <strong>stats.rx_timestamp</strong>, stats.sfrx, stats.rssi, stats.snr))</p>
<p dir="auto">stats.rx_timestamp is usually a time in the future. I added the following print line:<br />
print(&quot;Data received, time:&quot;, time.ticks_us(), stats.rx_timestamp)</p>
<p dir="auto">And while soon after reboot, the times are comparable, rx_timestamp  tends continuously to drift in  the future. As an example output:<br />
Data received, time: 1109195579 1119221332</p>
<p dir="auto">If you compare them, you have rx_timestamp about 10 seconds larger than the current time. This makes the join answer arrive too late.</p>
<p dir="auto">I replaced stats.rx_timestamp with time.ticks_us() in the self._push_data function call and now the device is able to join.</p>
]]></description><link>https://forum.pycom.io/post/8290</link><guid isPermaLink="true">https://forum.pycom.io/post/8290</guid><dc:creator><![CDATA[berpast]]></dc:creator><pubDate>Sun, 11 Jun 2017 10:44:40 GMT</pubDate></item><item><title><![CDATA[Reply to LoPy LoraWAN gateway with an ST LoraWAN device on Sun, 11 Jun 2017 16:01:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1228">@berpast</a>  Thanks, tried to get it working all day. Your solution made the difference. Time for the next step.....</p>
]]></description><link>https://forum.pycom.io/post/8292</link><guid isPermaLink="true">https://forum.pycom.io/post/8292</guid><dc:creator><![CDATA[kringloper]]></dc:creator><pubDate>Sun, 11 Jun 2017 16:01:23 GMT</pubDate></item><item><title><![CDATA[Reply to LoPy LoraWAN gateway with an ST LoraWAN device on Mon, 12 Jun 2017 14:40:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1228">@berpast</a> awesome I updated my project with your solution and it is working perfectly.</p>
]]></description><link>https://forum.pycom.io/post/8338</link><guid isPermaLink="true">https://forum.pycom.io/post/8338</guid><dc:creator><![CDATA[jpalbinet]]></dc:creator><pubDate>Mon, 12 Jun 2017 14:40:57 GMT</pubDate></item></channel></rss>