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

    loramesh example crashing on LoPy4

    Scheduled Pinned Locked Moved LoPy
    3 Posts 2 Posters 271 Views 2 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.
    • C Offline
      cuca94
      last edited by

      hi everyone!
      @catalin

      i got a couple of LoPy4 devices (with ext. board 3.1), upgraded the firmware to v1.20.0.rc11 and tested the raw lora successfully between two devices.
      after that i moved on to loramesh since this is very interresting for my application.

      i flashed the example code from the documentation (https://docs.pycom.io/tutorials/lora/lora-mesh.html) including the library source file (https://github.com/pycom/pycom-libraries/blob/master/lib/lora_mesh/loramesh.py) onto two lopy's, but after powering them they both did not connect to the loramesh.

      both devices act the same:
      the rgbled stays red and after around 50 seconds of hanging in the first while loop getting "state: detached" it breaks the while, says "neighbors found: 0" and crashes with an error in this line: https://github.com/pycom/pycom-libraries/blob/adb22c2d005b8ce83d8a9a6b31bbe5265135018a/lib/lora_mesh/main.py#L68

      i will post the exact error tomorrow.

      am i understanding the whole mesh thing wrong or is it right that the first device powered up will "start" the mesh and the others will "log in" to it?!
      how are the roles of the mesh members selected?

      thanks for your help
      best regards

      1 Reply Last reply Reply Quote 0
      • catalinC Offline
        catalin
        last edited by

        hi @cuca94, glad you tried pymesh example.
        The error is due to the method rc_cb() which should have 2 parameters, as it's in docs: https://development.pycom.io/firmware-and-api-reference/pycom/network/lora/pymesh#mesh-rx_cb-handler-argument
        If you fix it, maybe you could raise a pull-request.

        am i understanding the whole mesh thing wrong or is it right that the first device powered up will "start" the mesh and the others will "log in" to it?!

        In principle it's correct.

        how are the roles of the mesh members selected?

        The firmware is identical for all devices, so every device could take any role, dinamically. First one powered, is most-likely the Leader. The following ones are Child, but they become Routers (after a random time up to 2 mins). Overall the max number of Routers is 16, so the 17th will stay Child.

        Catalin,

        Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io
        Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

        1 Reply Last reply Reply Quote 0
        • C Offline
          cuca94
          last edited by

          thanks for your reply, i fixed the problem and raised a pull-request!

          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