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

    LoraMAC demo not working

    Scheduled Pinned Locked Moved Issues & Bugs
    loramac
    8 Posts 3 Posters 1.9k Views 3 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
      johnmcdnz
      last edited by

      I've received new Lopy units, and upgraded to latest version, details as:
      (sysname='LoPy', nodename='LoPy', release='1.7.8.b1', version='v1.8.6-724-g2b9ed601 on 2017-07-28', machine='LoPy with ESP32', lorawan='1.0.0')

      I've tried the basic LoraMAC sample and am not receiving any data between the pair of units.
      (wifi is working fine)

      I noticed an old support message, that mentions similar error.
      https://forum.pycom.io/topic/770/lora-receiving-only-b

      Is this bug still existing?

      This is a pain as I'm doing a workshop demo later this week and wanted to use the units for a hands on demo.

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

        @johnmcdnz Just to be sure, you have connected the antenna to the correct port (the one next to the LED and reset button)?

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

          @jcaron Yes. I already have two working Lopy from earlier delivery (on different os version) that are working fine.

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            bucknall @johnmcdnz
            last edited by

            @johnmcdnz Could you please give a snippet of your code? I'll have a look at this now.

            Thanks!

            Developer Evangelist - Pycom

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              johnmcdnz @bucknall
              last edited by

              @bucknall Thanks Alex....
              This code runs on both units, and each just prints b' ' repeatedly.

              from network import LoRa
              import socket
              import time

              #lora = LoRa(mode=LoRa.LORA, frequency=925000000, sf=7)
              lora = LoRa(mode=LoRa.LORA, frequency=925000000, power_mode=LoRa.ALWAYS_ON, tx_power=5, bandwidth=LoRa.BW_250KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_5, tx_iq=False, rx_iq=False)

              s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
              s.setblocking(False)

              while True:
              # send some data
              s.setblocking(True)
              s.send('Hello')
              print('hello send')

              # get any data received...
              s.setblocking(False)
              data = s.recv(64)
              print(data)
              
              # wait a random amount of time
              time.sleep(machine.rng() & 0x0F)
              
              1 Reply Last reply Reply Quote 0
              • J Offline
                johnmcdnz
                last edited by

                Sleep on it....

                Alex, and anyone else: I came home this evening to have another crack at this problem. Turned my PC on (Lopy powered from the USB ports). Suddenly I see the 'hello' message!!!!

                What can I say?

                I have each unit on opposite sides of the PC, about 50cm apart. So we can suspect some local RF interference probably.

                Now I can get my workshop demo ready.

                B 1 Reply Last reply Reply Quote 1
                • B Offline
                  bucknall @johnmcdnz
                  last edited by

                  @johnmcdnz Great to hear! Sometimes it's worth changing external variables for things like RF. I know I've previously had issues with some antennas as well.

                  Developer Evangelist - Pycom

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    johnmcdnz @bucknall
                    last edited by

                    @bucknall
                    Had a couple of hours on it and have all 5 units working. I'm not sure I fully understand the issue, but this is what I noticed:

                    I have a wifi router connected to my laptop, that I'm using as a separate AP for the Lopy. If I disconnect the ethernet from the Laptop, this may remove the problem.
                    So, I've wondering if there is RF EMC interference in the cables between the router/laptop/lopy.
                    Also if I then reboot the Lopy the problem disappears.

                    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