Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Problem with receiving ABP due to frequencies

    Scheduled Pinned Locked Moved Comments & Feedback
    7 Posts 4 Posters 254 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jonas2707
      last edited by jonas2707

      I'm trying to set up comm. between a transmitter and a receiver but I am unable to prevent the receiver from using multiple frequencies. Is there an easy way to force the Pycom to only use one frequency? I'm using LoPy4 and LoRa

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @jonas2707
        last edited by

        @jonas2707 It's unclear what you are doing and what your problem is. I suppose if you mention ABP that you are using LoRaWAN rather than raw LoRa? Also you talk about transmitters and receivers, but you should probably tell us which device is a node and which one is a gateway (both LoPy4? or are you using a different device as a gateway? In that case, which?), and which one you have a problem with. You tell us the "receiver" is using multiple frequencies, which shouldn't be a problem for a receiver, quite the opposite.

        If you are in a situation where you use a LoPy as a gateway (the so-called "nano-gateway"), it will only listen on a single frequency and data rate at a time, so you need to force the node to only use that frequency as well. This is usually achieved by using the lora.remove_channel and lora.add_channel methods to adjust things.

        1 Reply Last reply Reply Quote 1
        • J Offline
          jonas2707
          last edited by

          My current setup is two LoPy4 devices:
          First is in LoRaWAN mode transmitting periodically.
          Second is in raw LoRa mode.

          As I understand it, the LoRaWAN mode changes channel in order to increase robustness. But this makes it difficult to receive the data on the second device, and as I am just using a cable for now, i don't care too much about performance.

          I have tried setting the first three channels to the same frequency (868.0MHz, dr_min=5, drmax=5), and removing all other channels, but i can see from lora.stats() that the frequency still changes.

          So basically, I'm wondering how to set the transmitter in LoRaWAN mode to only use a single frequency and data rate.

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jcaron @jonas2707
            last edited by

            @jonas2707 remove all channels and indeed set them all to the same frequency and you should be fine.

            I don’t remover the default channels settings in ABP mode. I know in OTAA mode in the EU region only the first 3 channels are used for join requests, but maybe all channels are used by default in ABP mode, too lazy to check right now.

            You could also check the nanogateway and associated client examples for hints.

            F 1 Reply Last reply Reply Quote 0
            • F Offline
              fink @jcaron
              last edited by

              @jcaron I'm trying to do the same thing as @jonas2707 , but it still seems to use multiple frequencies.

              If I set the first four channels (0,1,2,3) as 868.0MHz, I got the following results:
              868.0: 30 packets
              868.1: 28 packets
              868.3: 22 packets
              868.5: 22 packets

              If I set all channels to 868.0 MHz (so channel 0 through 15), i get the following distribution:
              868.0: 126 packets
              868.1: 12 packets
              868.3: 10 packets
              868.5: 8 packets

              So it seems there are some channels which cannot be changed.

              The code I'm using is as follows:

              from network import LoRa
              import socket
              import struct
              import ubinascii
              import time
              
              lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868, tx_power=8)
              
              # Set channels
              for x in range(0,16):
                  lora.add_channel(index=x, frequency=868000000, dr_min=5, dr_max=5)
              
              # ABP parameters and join
              dev_addr = struct.unpack(">l", ubinascii.unhexlify('12345678'))[0]
              nwk_swkey = ubinascii.unhexlify('12341234123412341234123412341234')
              app_swkey = ubinascii.unhexlify('12341234123412341234123412341234')
              lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey))
              
              while True:
                  s.setblocking(True)
                  s.send(payload)
                  s.setblocking(False)
                  print(lora.stats())
                  time.sleep(1)
              
              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @fink
                last edited by

                @fink did you perform a hard reset between the tests? I have had situatutions where channel Configurations did not get active until. I made a hard reset by pushing the reset button.

                F 1 Reply Last reply Reply Quote 0
                • F Offline
                  fink @robert-hh
                  last edited by

                  @robert-hh I just tried this, but it's still using the other frequencies. I have also tried powering it off fully, but again, no luck...

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 1 / 1
                  • First post
                    Last post

                  Pycom on Twitter

                  Pycom