ImportError: cannot import name LoRa

  • Hi,

    I'm stuck with this error on VSCode :
    Using Pygate + Wipy3
    Had already :

    • updated firmware (Wipy3) using pycom firmware updater using different options (pybytes / pygate / local file)
    • actually running a downgrade firmware for pygate release :
    Pycom MicroPython 1.20.2.rc11 [v1.11-d574024] on 2020-08-25; WiPy with ESP32
    Pybytes Version: 1.5.2

    instead of latest wipy version : (which also did the import Error)

    Pycom MicroPython 1.20.2.r3 [v1.11-044dfea] on 2020-12-23; WiPy with ESP32
    Pybytes Version: 1.6.1

    And if I try :

    from network import WLAN

    it works well meaning network module is available....

    From the documentation I read :

    This class provides a LoRaWAN 1.0.2 compliant driver for the LoRa network processor in the LoPy, LoPy4 and FiPy.

    I can't believe this class is not available for WiPy ?!

    Any Idea ?

    As Without LoraMAC it's impossible to register in TTN.

  • Finally, my problem is Solved :

    With pygate, no need to register the device EUI, just create one from scratch ! (and edit config.json accordingly) as the doc says

  • @jcaron Thanks.

    My aim is to register the pygate as new LORAWAN gateway at TTN.
    First thing to register is the EUI of the gateway (which I supposed was on the Pygate board).
    And so following the pygate tutorial and the pycom documentation, I found this code to get the EUI of a LORA module :

    from network import LoRa
    import ubinascii
    lora = LoRa()
    print("DevEUI: %s" % (ubinascii.hexlify(lora.mac()).decode('ascii')))```
    So now I understand that with my WiPy chip that's not the good way to get my devEUI of the pygate.

  • @Dominique-popek what exactly are you trying to do? The WiPy does not have LoRa support, and the LoRa class is used solely for the LoRa chip in the LoPy and FiPy (which are end-devices, not a gateway like the Pygate). It’s not relevant for the Pygate.

    Just follow the instructions in the Pygate docs:

Pycom on Twitter