<?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[Lorawan node can not send packages. US frequency.]]></title><description><![CDATA[<p dir="auto">I tried to set a lorawan nsode US frequencies, but i can not get traffic in my gateway, sometimes only get 1 or 2 packages. I supposed that my transcever was damaged but if i use lora-lora connection it works well.</p>
<p dir="auto">I am attaching the code if the community see something wrong that helps me.</p>
<p dir="auto">from network import LoRa<br />
import socket<br />
import binascii<br />
import struct<br />
import time</p>
<h1>Initialize LoRa in LORAWAN mode.</h1>
<p dir="auto">lora = LoRa(mode=LoRa.LORAWAN, public=True, adr=True)</p>
<h1>create an ABP authentication params</h1>
<p dir="auto">dev_addr = struct.unpack(&quot;&gt;l&quot;, binascii.unhexlify('01 0E 1A DD'.replace(' ','')))[0]<br />
nwk_swkey = binascii.unhexlify('47400CAAE9B7B6E2A3EDD26F45274BBE'.replace(' ',''))<br />
app_swkey = binascii.unhexlify('D06604A453F36920881C5AD78FE10E4D'.replace(' ',''))</p>
<h1>set the channels</h1>
<p dir="auto">#lora.add_channel(0, frequency=902300000, dr_min=0, dr_max=4)<br />
#lora.add_channel(1, frequency=902500000, dr_min=0, dr_max=4)<br />
#lora.add_channel(2, frequency=902700000, dr_min=0, dr_max=4)<br />
#lora.add_channel(3, frequency=902900000, dr_min=0, dr_max=4)<br />
#lora.add_channel(4, frequency=903100000, dr_min=0, dr_max=4)<br />
#lora.add_channel(5, frequency=903300000, dr_min=0, dr_max=4)<br />
#lora.add_channel(6, frequency=903500000, dr_min=0, dr_max=4)<br />
#lora.add_channel(7, frequency=903700000, dr_min=0, dr_max=4)</p>
<p dir="auto">lora.add_channel(0, frequency=902300000, dr_min=0, dr_max=3)</p>
<h1>remove all the non-default channels</h1>
<p dir="auto">for i in range(1, 15):<br />
lora.remove_channel(i)</p>
<h1>join a network using ABP (Activation By Personalization)</h1>
<p dir="auto">lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey))</p>
<h1>create a LoRa socket</h1>
<p dir="auto">s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)</p>
<h1>set the LoRaWAN data rate</h1>
<p dir="auto">s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)</p>
<h1>make the socket blocking</h1>
<p dir="auto">s.setblocking(False)</p>
<p dir="auto">for i in range (200):<br />
print(&quot;Sending..&quot;)<br />
s.send(b'PKT #' + bytes([i]))<br />
time.sleep(4)</p>
<pre><code>rx = s.recv(256)
if rx:
    print(rx)
time.sleep(6)</code></pre>
]]></description><link>https://forum.pycom.io/topic/1576/lorawan-node-can-not-send-packages-us-frequency</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 02:19:42 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/1576.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Jul 2017 23:24:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Lorawan node can not send packages. US frequency. on Fri, 28 Jul 2017 23:24:41 GMT]]></title><description><![CDATA[<p dir="auto">I tried to set a lorawan nsode US frequencies, but i can not get traffic in my gateway, sometimes only get 1 or 2 packages. I supposed that my transcever was damaged but if i use lora-lora connection it works well.</p>
<p dir="auto">I am attaching the code if the community see something wrong that helps me.</p>
<p dir="auto">from network import LoRa<br />
import socket<br />
import binascii<br />
import struct<br />
import time</p>
<h1>Initialize LoRa in LORAWAN mode.</h1>
<p dir="auto">lora = LoRa(mode=LoRa.LORAWAN, public=True, adr=True)</p>
<h1>create an ABP authentication params</h1>
<p dir="auto">dev_addr = struct.unpack(&quot;&gt;l&quot;, binascii.unhexlify('01 0E 1A DD'.replace(' ','')))[0]<br />
nwk_swkey = binascii.unhexlify('47400CAAE9B7B6E2A3EDD26F45274BBE'.replace(' ',''))<br />
app_swkey = binascii.unhexlify('D06604A453F36920881C5AD78FE10E4D'.replace(' ',''))</p>
<h1>set the channels</h1>
<p dir="auto">#lora.add_channel(0, frequency=902300000, dr_min=0, dr_max=4)<br />
#lora.add_channel(1, frequency=902500000, dr_min=0, dr_max=4)<br />
#lora.add_channel(2, frequency=902700000, dr_min=0, dr_max=4)<br />
#lora.add_channel(3, frequency=902900000, dr_min=0, dr_max=4)<br />
#lora.add_channel(4, frequency=903100000, dr_min=0, dr_max=4)<br />
#lora.add_channel(5, frequency=903300000, dr_min=0, dr_max=4)<br />
#lora.add_channel(6, frequency=903500000, dr_min=0, dr_max=4)<br />
#lora.add_channel(7, frequency=903700000, dr_min=0, dr_max=4)</p>
<p dir="auto">lora.add_channel(0, frequency=902300000, dr_min=0, dr_max=3)</p>
<h1>remove all the non-default channels</h1>
<p dir="auto">for i in range(1, 15):<br />
lora.remove_channel(i)</p>
<h1>join a network using ABP (Activation By Personalization)</h1>
<p dir="auto">lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey))</p>
<h1>create a LoRa socket</h1>
<p dir="auto">s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)</p>
<h1>set the LoRaWAN data rate</h1>
<p dir="auto">s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)</p>
<h1>make the socket blocking</h1>
<p dir="auto">s.setblocking(False)</p>
<p dir="auto">for i in range (200):<br />
print(&quot;Sending..&quot;)<br />
s.send(b'PKT #' + bytes([i]))<br />
time.sleep(4)</p>
<pre><code>rx = s.recv(256)
if rx:
    print(rx)
time.sleep(6)</code></pre>
]]></description><link>https://forum.pycom.io/post/9776</link><guid isPermaLink="true">https://forum.pycom.io/post/9776</guid><dc:creator><![CDATA[blackansible]]></dc:creator><pubDate>Fri, 28 Jul 2017 23:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to Lorawan node can not send packages. US frequency. on Sat, 29 Jul 2017 07:04:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1433">@blackansible</a> said in <a href="/post/9776">Lorawan node can not send packages. US frequency.</a>:</p>
<blockquote>
<p dir="auto">for i in range(1, 15):<br />
lora.remove_channel(i)</p>
</blockquote>
<p dir="auto">Are you using a single channel gateway (for example another LoPy as as a nano gateway)?</p>
<p dir="auto">If so you need to remove_channels up to 72, not just 15.</p>
]]></description><link>https://forum.pycom.io/post/9778</link><guid isPermaLink="true">https://forum.pycom.io/post/9778</guid><dc:creator><![CDATA[jmarcelino]]></dc:creator><pubDate>Sat, 29 Jul 2017 07:04:15 GMT</pubDate></item><item><title><![CDATA[Reply to Lorawan node can not send packages. US frequency. on Sat, 29 Jul 2017 08:37:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1433">@blackansible</a> what does <code>lora.has_joined()</code> return? Note that it may take a little while to join.</p>
]]></description><link>https://forum.pycom.io/post/9783</link><guid isPermaLink="true">https://forum.pycom.io/post/9783</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Sat, 29 Jul 2017 08:37:57 GMT</pubDate></item><item><title><![CDATA[Reply to Lorawan node can not send packages. US frequency. on Sat, 29 Jul 2017 08:48:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1538">@jcaron</a><br />
The code is using ABP so there is no actual join procedure, it's just assigning keys</p>
]]></description><link>https://forum.pycom.io/post/9784</link><guid isPermaLink="true">https://forum.pycom.io/post/9784</guid><dc:creator><![CDATA[jmarcelino]]></dc:creator><pubDate>Sat, 29 Jul 2017 08:48:47 GMT</pubDate></item></channel></rss>