<?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[Having trouble making a lorawan using 2 lopy4 devices]]></title><description><![CDATA[<p dir="auto">R<br />
Roberto Duca about an hour ago</p>
<p dir="auto">Hi there! I am quite new to Iot and lorawan.</p>
<p dir="auto">I am trying to set up a small network between two lopy4 devices using lorawan in Australia using the 915 frequency. One device is set up as a gateway using the example off the github drive <a href="https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway" target="_blank" rel="noopener noreferrer nofollow">https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway</a></p>
<p dir="auto">for the config i am currently using the following settings in my config file</p>
<p dir="auto">LORA_FREQUENCY = 916800000<br />
LORA_GW_DR = &quot;SF12BW500&quot;<br />
LORA_NODE_DR = 8</p>
<p dir="auto">on the things network i have the device registered with teh following frequency plan: AU_915_928_FSB_2</p>
<p dir="auto">the gateway seems to connect to the internet and shows being active on ttn console, but unfortunately I am not achieving any communication between the node and gateway using lorawan.</p>
<p dir="auto">I have tried a couple of various pieces of code i've found but suspect it must be how i am registereing the end device. in my code i am trying this code at the moment to no avail:</p>
<pre><code>from network import LoRa
import time
import binascii
import pycom

pycom.heartbeat(False) #needs to be disabled for LED functions to work
pycom.rgbled(0x7f0000) #red

#Set AppEUI and AppKey - use your values from the device settings --&gt; https://console.thethingsnetwork.org/
app_eui = binascii.unhexlify('removed')
app_key = binascii.unhexlify('removed')

lora = LoRa(mode=LoRa.LORAWAN, public=1,  adr=0, tx_retries=0)

# Remove default channels
for index in range(0, 72):
    lora.remove_channel(index)

# Set  AU ISM 915 channel plan for TTN Australia
for index in range(8, 15):
    lora.add_channel(index, frequency=915200000+index*200000, dr_min=0, dr_max=3)

lora.add_channel(65, frequency=917500000,  dr_min=4,  dr_max=4)

for index in range(0, 7):
    lora.add_channel(index, frequency=923300000+index*600000, dr_min=0, dr_max=3)

#Join TTN Network via OTAA
lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)

# wait until the module has joined the network
while not lora.has_joined():
    pycom.rgbled(0x7f7f00) #yellow
    time.sleep(5)
    print('Trying to join TTN Network!')
    pass

print('Network joined!')
pycom.rgbled(0x007f00) #green


while not lora.has_joined():
    pycom.rgbled(0x7f7f00) #yellow
    time.sleep(5)
    print('Trying to join TTN Network!')
    pass

print('Network joined!')
pycom.rgbled(0x007f00) #green
</code></pre>
<p dir="auto">i have tried OTAA and ABP but it doesnt seem to work. i think the hardware is working because if i set up a raw lora gateway and node i can see packets being sent to each other.</p>
<p dir="auto">i am not sure what i might be doing wrong? any advice or help would be much appreciated.</p>
<p dir="auto">Thanks,</p>
<p dir="auto">Rob</p>
]]></description><link>https://forum.pycom.io/topic/7254/having-trouble-making-a-lorawan-using-2-lopy4-devices</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 18:30:37 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/7254.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Sep 2021 13:48:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Having trouble making a lorawan using 2 lopy4 devices on Wed, 08 Sep 2021 13:48:41 GMT]]></title><description><![CDATA[<p dir="auto">R<br />
Roberto Duca about an hour ago</p>
<p dir="auto">Hi there! I am quite new to Iot and lorawan.</p>
<p dir="auto">I am trying to set up a small network between two lopy4 devices using lorawan in Australia using the 915 frequency. One device is set up as a gateway using the example off the github drive <a href="https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway" target="_blank" rel="noopener noreferrer nofollow">https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway</a></p>
<p dir="auto">for the config i am currently using the following settings in my config file</p>
<p dir="auto">LORA_FREQUENCY = 916800000<br />
LORA_GW_DR = &quot;SF12BW500&quot;<br />
LORA_NODE_DR = 8</p>
<p dir="auto">on the things network i have the device registered with teh following frequency plan: AU_915_928_FSB_2</p>
<p dir="auto">the gateway seems to connect to the internet and shows being active on ttn console, but unfortunately I am not achieving any communication between the node and gateway using lorawan.</p>
<p dir="auto">I have tried a couple of various pieces of code i've found but suspect it must be how i am registereing the end device. in my code i am trying this code at the moment to no avail:</p>
<pre><code>from network import LoRa
import time
import binascii
import pycom

pycom.heartbeat(False) #needs to be disabled for LED functions to work
pycom.rgbled(0x7f0000) #red

#Set AppEUI and AppKey - use your values from the device settings --&gt; https://console.thethingsnetwork.org/
app_eui = binascii.unhexlify('removed')
app_key = binascii.unhexlify('removed')

lora = LoRa(mode=LoRa.LORAWAN, public=1,  adr=0, tx_retries=0)

# Remove default channels
for index in range(0, 72):
    lora.remove_channel(index)

# Set  AU ISM 915 channel plan for TTN Australia
for index in range(8, 15):
    lora.add_channel(index, frequency=915200000+index*200000, dr_min=0, dr_max=3)

lora.add_channel(65, frequency=917500000,  dr_min=4,  dr_max=4)

for index in range(0, 7):
    lora.add_channel(index, frequency=923300000+index*600000, dr_min=0, dr_max=3)

#Join TTN Network via OTAA
lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)

# wait until the module has joined the network
while not lora.has_joined():
    pycom.rgbled(0x7f7f00) #yellow
    time.sleep(5)
    print('Trying to join TTN Network!')
    pass

print('Network joined!')
pycom.rgbled(0x007f00) #green


while not lora.has_joined():
    pycom.rgbled(0x7f7f00) #yellow
    time.sleep(5)
    print('Trying to join TTN Network!')
    pass

print('Network joined!')
pycom.rgbled(0x007f00) #green
</code></pre>
<p dir="auto">i have tried OTAA and ABP but it doesnt seem to work. i think the hardware is working because if i set up a raw lora gateway and node i can see packets being sent to each other.</p>
<p dir="auto">i am not sure what i might be doing wrong? any advice or help would be much appreciated.</p>
<p dir="auto">Thanks,</p>
<p dir="auto">Rob</p>
]]></description><link>https://forum.pycom.io/post/39205</link><guid isPermaLink="true">https://forum.pycom.io/post/39205</guid><dc:creator><![CDATA[Roberto Duca]]></dc:creator><pubDate>Wed, 08 Sep 2021 13:48:41 GMT</pubDate></item><item><title><![CDATA[Reply to Having trouble making a lorawan using 2 lopy4 devices on Wed, 08 Sep 2021 18:55:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/9095">@Roberto-Duca</a> the nano gateway only listens on a single frequency rather than 9 or so a real gateway does. You must remove all channels and only use the signe channel the gateway listens on.</p>
]]></description><link>https://forum.pycom.io/post/39209</link><guid isPermaLink="true">https://forum.pycom.io/post/39209</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Wed, 08 Sep 2021 18:55:55 GMT</pubDate></item><item><title><![CDATA[Reply to Having trouble making a lorawan using 2 lopy4 devices on Thu, 09 Sep 2021 04:17:07 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 />
Thanks for your reply!</p>
<p dir="auto">ok so when i set the frequency on the gateway of 916.8MHz that is the listening frequency?</p>
<p dir="auto">i should then restrict the channel frequencies to 916.8MHz on the node then too?</p>
]]></description><link>https://forum.pycom.io/post/39211</link><guid isPermaLink="true">https://forum.pycom.io/post/39211</guid><dc:creator><![CDATA[Roberto Duca]]></dc:creator><pubDate>Thu, 09 Sep 2021 04:17:07 GMT</pubDate></item><item><title><![CDATA[Reply to Having trouble making a lorawan using 2 lopy4 devices on Thu, 09 Sep 2021 11:57:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/9095">@Roberto-Duca</a> yes, you need to use only the frequency chosen on the gateway.</p>
<p dir="auto">Note that the network may (and probably will) send it’s on list of channels and frequencies after the join, so ideally you should configure the network to only send that single frequency (don’t know if you can do that on TTN), or you will have to reset the list of channels after the join (or rather before each transmit).</p>
<p dir="auto">Also I believe the nano-gateway only listen on a single DR, so likewise, you should restrict your node to that single DR (both for join and subsequent traffic).</p>
<p dir="auto">Remember that a nano-gateway is just there for a bit of testing, it’s by far not a real LoRaWAN-compliant gateway.</p>
]]></description><link>https://forum.pycom.io/post/39215</link><guid isPermaLink="true">https://forum.pycom.io/post/39215</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Thu, 09 Sep 2021 11:57:05 GMT</pubDate></item></channel></rss>