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' object has no attribute 'Mesh'

    Scheduled Pinned Locked Moved Firmware
    21 Posts 8 Posters 564 Views 8 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.
    • catalinC Offline
      catalin @jclo13
      last edited by

      @jclo13 As I've tried to explained here https://docs.pycom.io/pymesh/simple-example/ if Pybytes is stopped then you can use directly the Pymesh Library API (like: pymesh = Pymesh(pymesh_config, new_message_cb))

      Stopping Pybytes can be done using (and enabling it can be done by using parameter pycom.pybytes_on_boot(True)):

      import pycom
      pycom.pybytes_on_boot(False)
      machine.reset()
      

      If Pybtyes is stopped then Pymesh is not automatically started, but Pybytes Library scripts are included as frozen.

      1. You can re-upload Pymesh Library scripts (with custom modifications), and this ones will be executed, they are preferred instead of the frozen ones
      2. OR, You can use directly Pybytes low-level micropython API: https://docs.pycom.io/firmwareapi/pycom/network/lora/pymesh/

      Thanks and let me know if anything else is not clear.

      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/

      J F 2 Replies Last reply Reply Quote 1
      • J Offline
        jclo13 @catalin
        last edited by

        @catalin thanks for your response, I am having problems whit the Pymesh Firmware, exactly whit the following code:

        loraSaved = pycom.nvs_get('loraSaved')
        

        I have the follogin error:

        ValueError: No matching object for the provided key
        

        Can you help me, please?

        thanks in advance.

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gijs
          last edited by

          Hi,
          I don't think that has to do with the Pymesh firmware, but rather a missing key in the NVS. You can use a try-except block to catch the error, or use any of the following:

          pycom.nvs_set('loraSaved', value)
          

          to set the key, or

          pycom.nvs_get('loraSaved', value)
          

          Which will return value if the key is not set.

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

            @Gijs Wasn't there a few months ago a breaking change in nvs_get which switched from returning None to generating a ValueError exception when the key does not already exists?

            1 Reply Last reply Reply Quote 0
            • G Offline
              Gijs
              last edited by

              I did a quick search for what you mention, and could only find this, from about a year ago: https://forum.pycom.io/topic/6132/pycom-nvs_get-returns-an-exception. Indeed there was a time where it returned 'None' as per the docs, but it has been like this for (at least) a year, so it should also be implemented in the Pymesh :)

              You're correct when mentioning we should keep track of the API per firmware version.

              1 Reply Last reply Reply Quote 1
              • F Offline
                Fabrizio Giuliano @catalin
                last edited by

                @catalin said in 'LoRa' object has no attribute 'Mesh':

                import pycom
                pycom.pybytes_on_boot(False)
                machine.reset()

                Dear Catalin, many thanks for your support. I still have issues with pmesh on my pycom Fipy.
                Here what I did:
                a. git clone https://github.com/pycom/pycom-libraries.git
                b. in Atom Add a new project from pycom-libraries/pymes/pymesh_frozen
                c. execute the code you suggest

                import machine
                import pycom
                pycom.pybytes_on_boot(False)
                machine.reset()

                d. Upload the project to the device

                result: I got the error:

                Traceback (most recent call last):
                  File "main.py", line 35, in <module>
                  File "/flash/lib/pymesh.py", line 57, in __init__
                  File "/flash/lib/mesh_interface.py", line 56, in __init__
                  File "/flash/lib/mesh_internal.py", line 123, in __init__
                  File "/flash/lib/loramesh.py", line 73, in __init__
                  File "/flash/lib/loramesh.py", line 122, in _lora_init
                AttributeError: 'LoRa' object has no attribute 'Mesh'
                Pycom MicroPython 1.20.3.b3 [v1.11-92f2b22e] on 2021-04-19; FiPy with ESP32
                

                in line 122 does not exist lora.Mesh()
                Wrong firmware version? Which is the right one?
                Here my current version:

                Pycom MicroPython 1.20.3.b3 [v1.11-92f2b22e] on 2021-04-19; FiPy with ESP32
                

                Thanks!
                F.

                1 Reply Last reply Reply Quote 0
                • G Offline
                  Gijs
                  last edited by

                  Hi,
                  As I mentioned in a post above, nowadays you need to get the pymesh firmware through Pybytes. There is a guide here: https://docs.pycom.io/pybytes/pymeshintegration/. The pycom-libraries version of pymesh frozen is a reference to the pymesh code, but the firmware includes some additional closed-source components. If you use the firmware, you do not need to load the pymesh-frozen library seperately.

                  F 1 Reply Last reply Reply Quote 0
                  • F Offline
                    Fabrizio Giuliano @Gijs
                    last edited by

                    @Gijs
                    Hi, thanks for your quick answer. I understood that is possible to use Pybytes, but I would like to understand if the code in github can be still used with some older firmware version or not.

                    BR,
                    F-

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      Gijs
                      last edited by

                      To be honest, I don't know. Perhaps the special submodule can be found in versions 1.20.0.rc8 through rc10 as my colleague Catalin described 2 years ago, but I would not recommend using that firmware in a production environment.

                      F 1 Reply Last reply Reply Quote 0
                      • F Offline
                        Fabrizio Giuliano @Gijs
                        last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • G Offline
                          Gijs
                          last edited by

                          As I mentioned before, the pymesh firmware uses closed-source libraries that unfortunately we cannot publish. When you update to the Pymesh firmware through Pybytes, you accept the license agreement, which is why we cannot publish the source or binary for this firmware. Sorry for the inconvenience.

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            Adrian Cardona Ruiz
                            last edited by Adrian Cardona Ruiz

                            Hello! I'm trying to create a LoRa Mesh or PyMesh network. I'm using LoPy4 and FiPy with expansion board 3.1v. After a few problems, I was able to create a PyMesh network using Pybytes. I have a project on Pybytes with WiFi and LoRa added as networks.

                            The devices have the same firmware version (1.20.2.rc11). They connet to Pybytes and they get a role (the rgbled change its color). However, I checked the monitoring tab and they don't find neighbours.

                            pymesh problem.JPG

                            Moreover, I set the FiPy as Border Router, but something happened because in the image above it isn't appear as I defined previously.

                            I'm running tests right now, the FiPy is the leader of the network (MAGENTA) and the LoPy4 is a router (GREEN). Do I need another LoPy/FiPy to find neighbours between them?

                            I read the tutorials in the Pycom website, but I'm getting a bit confused because what I found here (https://docs.pycom.io/pymesh/licence/) works, but couldn't find neighbours in the network, and what I also found on the website (https://docs.pycom.io/firmwareapi/pycom/network/lora/pymesh/) doesn't work. It throws an error:

                            Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
                            Core 1 register dump:
                            PC      : 0x400ff85a  PS      : 0x00060030  A0      : 0x800ff890  A1      : 0x3ffdd450
                            A2      : 0x00000000  A3      : 0x00000000  A4      : 0x3f433b18  A5      : 0x3ffdd5b8
                            A6      : 0x0000002a  A7      : 0x0000098a  A8      : 0x3f40fc38  A9      : 0x3ffdd430
                            A10     : 0x00000000  A11     : 0x00060023  A12     : 0x00060020  A13     : 0x00000000
                            A14     : 0x0000000a  A15     : 0x3ffdd5e0  SAR     : 0x0000001e  EXCCAUSE: 0x0000001c
                            EXCVADDR: 0x00000000  LBEG    : 0x4009527c  LEND    : 0x40095287  LCOUNT  : 0xffffffff
                            
                            ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000
                            
                            Backtrace: 0x400ff85a:0x3ffdd450 0x400ff88d:0x3ffdd470 0x40108334:0x3ffdd490 0x40101e71:0x3ffdd4c0 0x400fe299:0x3ffdd4e0 0x4010a251:0x3ffdd500 0x40101f84:0x3ffdd5a0 0x400fe299:0x3ffdd600 0x400fe2c6:0x3ffdd620 0x400e1679:0x3ffdd640 0x400e1908:0x3ffdd6e0 0x400e01bd:0x3ffdd720
                            

                            The code above had some core dump info but it was a bunch of letters without much sense and I decided not to put it here.

                            So I would appreciate if someone can give me some hints about whats happening or what to do now.

                            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
                            • 2
                            • 1 / 2
                            • First post
                              Last post

                            Pycom on Twitter

                            Pycom