Communication between a LoPy and several LoPys via LORA



  • Hello,

    I have two lopys that communicates via Lora and one of my lopy must act as a relay mast so it has to handle communication via Lora with several lopys, possibly at the same time. In fact, the relay LoPy has to be able to receive data from different LoPys and to know from which LoPy the data come. Can I do that if I start from the code below? How can I distinguish the origins of the data?

    from network import LoRa
    import socket
    import time

    lora = LoRa(mode=LoRa.LORA, frequency=863000000)
    s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
    s.setblocking(False)

    while True:
    rec = s.recv(1024) #reception of the data in bytes
    time.sleep(2)

    Thank you for your answers,

    Jérôme Maquoi



  • I suggest to use this Pycom LoRa-Mac nano-gateway to start with :
    LoPy Nano-Gateway Extended (Timeout and Retry)
    It was a development from the earlier version :
    LoPy Nano-Gateway



Pycom on Twitter