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

    Cannot import lora library

    Scheduled Pinned Locked Moved LoPy
    lopyloraimportlibrarypycom
    2 Posts 2 Posters 98 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.
    • K Offline
      Kcsss
      last edited by Kcsss

      I'm having a problem when uploading the final project file to the board. I had updated both the pysense board and the firmware ( v 1.18.3). When I try this piece of code:

      from network import lora
      

      As in the examples, the board responds with this message.
      ImportError: cannot import name lora

      My project folder it's something like this :

      Project
      . -main.py
      . -boot.py
      . -pymakr.conf
      . -lib(dir):
      . -LIS2HH12.py
      . -LTR329ALS... .py
      . -pycoproc.py
      . -pysense.py
      . -SI7006A20.py

      What could I be doing wrong ?

      ShanevanJS 1 Reply Last reply Reply Quote 0
      • ShanevanJS Offline
        ShanevanJ @Kcsss
        last edited by

        @Kcsss Read the documentation here more carefully. The case is important!

        from network import LoRa
        import socket
        import ubinascii
        import struct
        
        # Initialise LoRa in LORAWAN mode.
        # Please pick the region that matches where you are using the device:
        # Asia = LoRa.AS923
        # Australia = LoRa.AU915
        # Europe = LoRa.EU868
        # United States = LoRa.US915
        lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868)
        
        

        Design | Develop | Deploy

        1 Reply Last reply Reply Quote 1

        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