<?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[Communication with other lora device doesn&#x27;t work]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">First I appologize if I'm not in the right category this is my first post.</p>
<p dir="auto">I actually have two questions.</p>
<p dir="auto"><strong>First one :</strong> I have a <a href="https://www.adafruit.com/product/3178" target="_blank" rel="noopener noreferrer nofollow">feather M0 lora board from Adafruit</a> which communicate over LoRa. I also have a lopy4 and a pytrack. I tried to get both communicate (simple packages) over LoRa but it does not work. I made sure of the frequencies and I used the &quot;raw lora&quot; mode.<br />
Here is the code, maybe I made a mistake : (the first one is the pycom code and the second one is the feather code)</p>
<pre><code>from network import LoRa
import socket
import machine
import time

# initialise LoRa in LORA mode
# Please pick the region that matches where you are using the device:
# Asia = LoRa.AS923
# Australia = LoRa.AU915
# Europe = LoRa.EU868
# United States = LoRa.US915
# more params can also be given, like frequency, tx power and spreading factor
lora = LoRa(mode=LoRa.LORA, region=LoRa.EU868, frequency=870000000, tx_power=14,sf=12)

# create a raw LoRa socket
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)

while True:
    # send some data
    s.setblocking(True)
    s.send('Hello world !!')

    print(&quot;I sent hello !&quot;)
    print(lora.stats())
    # wait a random amount of time
    time.sleep(1)
</code></pre>
<p dir="auto">Here's the feather code :</p>
<pre><code>import board
import busio
import digitalio
import time
import adafruit_rfm9x



RADIO_FREQ_MHZ   = 870
CS    = digitalio.DigitalInOut(board.RFM9X_CS)
RESET = digitalio.DigitalInOut(board.RFM9X_RST)
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
rfm9x.tx_power = 23

led.value = True
time.sleep(3)

while True:
    packet = rfm9x.receive()
    if packet is None:
        print('Received nothing! Listening again...')
   led.value = False
    else:
        print('Received (raw bytes): {0}'.format(packet))
        packet_text = str(packet, 'ascii')
        print('Received (ASCII): {0}'.format(packet_text))
        rssi = rfm9x.rssi
        print('Received signal strength: {0} dB'.format(rssi))
   led.value = True
       time.sleep(0.5)
       led.value = False
       time.sleep(0.5)
</code></pre>
<p dir="auto">It really should be basic but I can't manage to get those board communicate.</p>
<p dir="auto"><strong>My second question</strong> has nothing to do with the previous one : Is it possible to give arguments when uploading a file with micro python. I mean that when I launch my program in a python terminal I can specify command line arguments. How to do the same with micro python ? (By the way, I'm using Atom).</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.pycom.io/topic/4726/communication-with-other-lora-device-doesn-t-work</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 00:18:29 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/4726.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Apr 2019 09:55:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Tue, 23 Apr 2019 09:55:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">First I appologize if I'm not in the right category this is my first post.</p>
<p dir="auto">I actually have two questions.</p>
<p dir="auto"><strong>First one :</strong> I have a <a href="https://www.adafruit.com/product/3178" target="_blank" rel="noopener noreferrer nofollow">feather M0 lora board from Adafruit</a> which communicate over LoRa. I also have a lopy4 and a pytrack. I tried to get both communicate (simple packages) over LoRa but it does not work. I made sure of the frequencies and I used the &quot;raw lora&quot; mode.<br />
Here is the code, maybe I made a mistake : (the first one is the pycom code and the second one is the feather code)</p>
<pre><code>from network import LoRa
import socket
import machine
import time

# initialise LoRa in LORA mode
# Please pick the region that matches where you are using the device:
# Asia = LoRa.AS923
# Australia = LoRa.AU915
# Europe = LoRa.EU868
# United States = LoRa.US915
# more params can also be given, like frequency, tx power and spreading factor
lora = LoRa(mode=LoRa.LORA, region=LoRa.EU868, frequency=870000000, tx_power=14,sf=12)

# create a raw LoRa socket
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)

while True:
    # send some data
    s.setblocking(True)
    s.send('Hello world !!')

    print(&quot;I sent hello !&quot;)
    print(lora.stats())
    # wait a random amount of time
    time.sleep(1)
</code></pre>
<p dir="auto">Here's the feather code :</p>
<pre><code>import board
import busio
import digitalio
import time
import adafruit_rfm9x



RADIO_FREQ_MHZ   = 870
CS    = digitalio.DigitalInOut(board.RFM9X_CS)
RESET = digitalio.DigitalInOut(board.RFM9X_RST)
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
rfm9x.tx_power = 23

led.value = True
time.sleep(3)

while True:
    packet = rfm9x.receive()
    if packet is None:
        print('Received nothing! Listening again...')
   led.value = False
    else:
        print('Received (raw bytes): {0}'.format(packet))
        packet_text = str(packet, 'ascii')
        print('Received (ASCII): {0}'.format(packet_text))
        rssi = rfm9x.rssi
        print('Received signal strength: {0} dB'.format(rssi))
   led.value = True
       time.sleep(0.5)
       led.value = False
       time.sleep(0.5)
</code></pre>
<p dir="auto">It really should be basic but I can't manage to get those board communicate.</p>
<p dir="auto"><strong>My second question</strong> has nothing to do with the previous one : Is it possible to give arguments when uploading a file with micro python. I mean that when I launch my program in a python terminal I can specify command line arguments. How to do the same with micro python ? (By the way, I'm using Atom).</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.pycom.io/post/27390</link><guid isPermaLink="true">https://forum.pycom.io/post/27390</guid><dc:creator><![CDATA[melkoutch]]></dc:creator><pubDate>Tue, 23 Apr 2019 09:55:24 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Tue, 23 Apr 2019 11:48:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/4410">@melkoutch</a> If I'm not mistaken, 870 MHz is actually (just) outside the allowed frequency band in the EU region.</p>
<p dir="auto">Also, it takes over a second to send a frame at SF12, and, depending on the sub-band, you are only allowed to transmit 10%, 1% or even 0.1% of the time. You are clearly exceeding duty cycle limits here.</p>
<p dir="auto">Not sure if that is actually related to your issue (don't know if in raw LoRa mode the stack will prevent sending outside of the configured band for instance), but in any case you are required to comply with local radio regulations. You could be interfering with other systems.</p>
]]></description><link>https://forum.pycom.io/post/27396</link><guid isPermaLink="true">https://forum.pycom.io/post/27396</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Tue, 23 Apr 2019 11:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Tue, 23 Apr 2019 20:48:21 GMT]]></title><description><![CDATA[<p dir="auto">In addition to what jcaron said, 23dBm is way above the maximum allowed transmit power in EU, unless your cable/antenna has a lot of attenuation.</p>
<p dir="auto">The crazy high output power could be the reason the devices can't communicate. You might be saturating the receiver.</p>
<p dir="auto"><a href="https://www.disk91.com/2017/technology/internet-of-things-technology/all-what-you-need-to-know-about-regulation-on-rf-868mhz-for-lpwan/" target="_blank" rel="noopener noreferrer nofollow">https://www.disk91.com/2017/technology/internet-of-things-technology/all-what-you-need-to-know-about-regulation-on-rf-868mhz-for-lpwan/</a> has a good introduction to the legal limits on the 868 ism band.</p>
]]></description><link>https://forum.pycom.io/post/27420</link><guid isPermaLink="true">https://forum.pycom.io/post/27420</guid><dc:creator><![CDATA[mfalkvidd]]></dc:creator><pubDate>Tue, 23 Apr 2019 20:48:21 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Wed, 24 Apr 2019 07:15:18 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Thanks</strong> both of you ! I will make changes accordingly and see if that solves the problem !</p>
]]></description><link>https://forum.pycom.io/post/27428</link><guid isPermaLink="true">https://forum.pycom.io/post/27428</guid><dc:creator><![CDATA[melkoutch]]></dc:creator><pubDate>Wed, 24 Apr 2019 07:15:18 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Fri, 26 Apr 2019 09:08:05 GMT]]></title><description><![CDATA[<p dir="auto">You were right the spreading factor was indeed the problem. However I don't really understand what it is. I just removed it from the params and it works. I saw in the documentation :</p>
<p dir="auto"><em>sf sets the desired spreading factor. Accepts values between 7 and 12.</em></p>
<p dir="auto"><strong>What actually is a spreading factor ?</strong></p>
]]></description><link>https://forum.pycom.io/post/27496</link><guid isPermaLink="true">https://forum.pycom.io/post/27496</guid><dc:creator><![CDATA[melkoutch]]></dc:creator><pubDate>Fri, 26 Apr 2019 09:08:05 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Fri, 26 Apr 2019 09:59:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/4410">@melkoutch</a> the spreading factor determines the transmission speed, which in turn has an influence on range and resistance to interference (in theory at least).</p>
<p dir="auto">SF7 is the fastest, SF12 is the slowest. SF12 is so slow that it takes over a second to send a LoRaWAN frame with just a single data byte. In theory it gives a better range.</p>
]]></description><link>https://forum.pycom.io/post/27498</link><guid isPermaLink="true">https://forum.pycom.io/post/27498</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Fri, 26 Apr 2019 09:59:29 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Tue, 02 Jul 2019 11:13:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/4410">@melkoutch</a> said in <a href="/post/27390">Communication with other lora device doesn't work</a>:</p>
<blockquote>
<p dir="auto">My second question has nothing to do with the previous one : Is it possible to give arguments when uploading a file with micro python. I mean that when I launch my program in a python terminal I can specify command line arguments. How to do the same with micro python ? (By the way, I'm using Atom).</p>
</blockquote>
<p dir="auto">There is not OS or shell on the Pycom devices, and not <strong>main</strong>() function. If the main entry point of your code is a function, you can supply arguments to that, when executed from the REPL command line. Basically, that's what the Python interpreter on a PC does: calling <strong>main</strong>() with the arguments derived from the command line of the OS shell.</p>
]]></description><link>https://forum.pycom.io/post/28493</link><guid isPermaLink="true">https://forum.pycom.io/post/28493</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Tue, 02 Jul 2019 11:13:02 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Wed, 03 Jul 2019 07:10:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/98">@robert-hh</a> Thanks for clearing this out !</p>
]]></description><link>https://forum.pycom.io/post/28507</link><guid isPermaLink="true">https://forum.pycom.io/post/28507</guid><dc:creator><![CDATA[melkoutch]]></dc:creator><pubDate>Wed, 03 Jul 2019 07:10:17 GMT</pubDate></item><item><title><![CDATA[Reply to Communication with other lora device doesn&#x27;t work on Tue, 06 Oct 2020 11:00:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/4410">@melkoutch</a> hope you still read this as this thread is quite old. I stumbled upon it having the exact same problem (LoPy4 &lt;-&gt; Feather M0 in raw LoRa). Adjusting the spreading factor doesn't seem to solve it for me. Would you be able to post the code fragment that you used to successfully connect the two? Thanks a lot!</p>
]]></description><link>https://forum.pycom.io/post/34822</link><guid isPermaLink="true">https://forum.pycom.io/post/34822</guid><dc:creator><![CDATA[Bernd Meyer]]></dc:creator><pubDate>Tue, 06 Oct 2020 11:00:44 GMT</pubDate></item></channel></rss>