Trying to import LoRa but the package is not installed and where do I get it?



  • Hi All:

    I am not a newbie to python but I am to MicroPython and LoRa. So please be gentle :-)

    The first and simplest exaple I picked starts with:
    from network import LoRa

    from network import LoRa
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: can't import name LoRa

    I know about upip and I know the micropython-lib exists on github. What I do not know is how to translate:
    import LoRa
    into a package name so I tried what I believed to be logical ideas, all of which returned with errors:

    upip.install('LoRa')
    upip.install('lora')
    upip.install('pylora')
    upip.install('pyLoRa')
    upip.install('ESP32-micropython-lora')

    and some other sillier attempts that devolved into burning insence and praying to strange gods that I would get lucky ... nope!

    In any event, If I could get some orientation I would appreciate it. Happy New Year! Let's hope it is 2022 and not 2020 TOO



  • @Gary-Kuipers Which Pycom board do you use? LoRa works with LoPy and FiPy.



  • Robert! Thanks for answering. I amy have been jumping the gun. I was trying to run this piece of code from pycom:

    https://docs.pycom.io/tutorials/networks/lora/lora-mac/

    The first line of which is the statement that is giving me problems.

    If you have any ideas as to why this would be in example code please let me know. Meanwhile I will try the "read EVERYTHING" approach.

    Thanks for helping.



  • @Gary-Kuipers LoRa is part of the firmware for devices with LoRa hardware. So if you cannot import it, you may either have the wrong firmware or the wrong hardware.


Log in to reply
 

Pycom on Twitter