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

    LoRa receiving data intermittently

    Scheduled Pinned Locked Moved LoPy
    lopyrfm95adafruitfeatherarduino
    18 Posts 5 Posters 4.8k Views 6 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.
    • bmarkusB Offline
      bmarkus
      last edited by

      First I would repeat the test on different frequencies. You may have an interference from other devices. I'm not saying there is no bug in LoPy but RFI can cause issues for any properly working device.

      If you are planning to work with LoRa a bit longer time, it is worth to buy a DVB-T USB stick for few bucks and use an SDR (Software Defined Radio). With this you can see noise level on the band, what is going on adjacent channels, etc.

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        maelstrom @bmarkus
        last edited by

        @bmarkus Thanks, I just ordered a tuner to do some investigation. However I have had no issues transmitting between two RFM95 modules attached to Arduinos using the RadioHead library. Should I expect much variance in terms of tuning frequency across different LoRa radios? I did try some different frequencies around 915 but didn't know how granular I should get so
        I was pretty much poking around in the dark.

        1 Reply Last reply Reply Quote 0
        • M Offline
          maelstrom
          last edited by maelstrom

          Ok so I did some poking around with different frequencies and only got one hit on 908000000 and it wasn't my GPS transmission from the M0. Also wanted to double check that the M0 was consistently transmitting so I fired up my other Arduino with the RFM95 and it picks up the transmissions perfectly every second. I am at a loss, this worked with very little troubleshooting using the RFM95 + Arduino.

          Here's what I was using to cycle through all the ISM 915 MHz frequencies at 100000 increments.

          from network import LoRa
          import socket
          import machine
          import time
          
          lora = LoRa(mode=LoRa.LORA)
          frequency = 902000000
          
          while True:
              if frequency <= 928000000:
                  lora.init(frequency=frequency)
                  s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
                  s.setblocking(False)
                  time.sleep(1.2)
                  print("Frequency: "+ str(lora.frequency()))
                  data = s.recv(128)
                  print(lora.stats())
                  print(data)
                  frequency = frequency + 100000
              else:
                  frequency = 902000000
              
          
          1 Reply Last reply Reply Quote 0
          • ledbelly2142L Offline
            ledbelly2142
            last edited by

            @maelstrom

            I am using firmware 1.8.0.b1
            I am using LoRa Nano-Gateway (Raw LoRa)

            Friends don't let friends run with scissors

            1 Reply Last reply Reply Quote 0
            • M Offline
              maelstrom
              last edited by maelstrom

              Looks there is a discrepancy between docs and implementation for coding_rate.

              modlora.c shows:

              typedef enum {
                  E_LORA_CODING_4_5 = 1,
                  E_LORA_CODING_4_6 = 2,
                  E_LORA_CODING_4_7 = 3,
                  E_LORA_CODING_4_8 = 4
              } lora_coding_rate_t;
              

              While docs indicate:

              lora.coding_rate([coding_rate]) Get or set the coding rate in raw LoRa mode (LoRa.LORA). The allowed values are: LoRa.CODING_4_5 (0), LoRa.CODING_4_6 (1), LoRa.CODING_4_7 (2) and LoRa.CODING_4_8 (3).

              I think this is just a documentation issue as setting the coding rate to 0 on the sx1272 would put it in FSK mode.

              J 1 Reply Last reply Reply Quote 0
              • ledbelly2142L Offline
                ledbelly2142
                last edited by

                This is what I am using

                lora = LoRa(mode=LoRa.LORA, bandwidth=LoRa.BW_125KHZ, coding_rate=LoRa.CODING_4_8, sf=12, tx_iq=True)
                lora_sock = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
                lora_sock.setblocking(False)
                

                with the 'nano-gateway' inside the office, we had a good signal up to about 1/4 mile with large buildings in the way. Still have intermittent issues and occasional corrupted messages.

                Friends don't let friends run with scissors

                M 1 Reply Last reply Reply Quote 0
                • M Offline
                  maelstrom @ledbelly2142
                  last edited by maelstrom

                  @ledbelly2142 Thanks for the info. Right now I would say I am getting ~99% packet loss when receiving on the LoPy from an Arduino driven RFM95. To double check that I wasn't getting interference I had another Arduino/RFM95 receiving next to the LoPy and I received 100% of the packets. I also tried the reverse (LoPy transmitting, Arduino receiving) and did not receive anything. However if I had my GPS transmitter sending at the same time the LoPy would interfere with it so something is happening around the 915 frequency. I get my DVB-T tuner today so I will keep poking around.

                  I have a feeling there is some default setting that is different between the Arduino and LoPy, I just cant figure out what it is and having 1% of the transmissions come across randomly is adding to the confusion.

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    JimT @maelstrom
                    last edited by

                    @maelstrom

                    Is it possible to use FSK on the LoPy?

                    M 1 Reply Last reply Reply Quote 0
                    • M Offline
                      maelstrom @JimT
                      last edited by

                      @JimT I am not sure.

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        maelstrom
                        last edited by

                        Does anyone have a couple of LoPys running firmware 1.8.0.b1 and can test out the raw LoRa mode to confirm that this isn't a firmware issue?

                        I got my DVB-T tuner and nothing seems out of the ordinary and 915mhz in my basement is clean of interference. Even did some additional fine tuning of the frequency that the LoPy is listening on and still got intermittent results.

                        I am starting to wonder if there is a bad trace or ground that is contributing to this. I did have some issues when soldering the ground pin when I put in the headers, the board has a lot of grounding copper left on the PCB which acted as a heat sink so the solder didn't flow as well... maybe I will go resolver it to be sure.

                        H 1 Reply Last reply Reply Quote 0
                        • H Offline
                          husigeza @maelstrom
                          last edited by

                          @maelstrom
                          Hello,

                          LoRaRAW works for me between 2 LoPys both on EUR and US frequencies on the latest firmware, all the other parameters are default values.

                          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