LoRa-MAC (Raw LoRa)



  • hello. I follow this tutorial to send data using LoRa MAC

    I received this:
    alt text

    how can I get rid of the b'0.1'? I want 0.1 only because I am publishing this data to cloud.

    I received this in cloud.
    alt text

    how to change this coding:

    s.setblocking(False)
    some_number = s.recv(64)
    client.publish(topic=AIO_RANDOMS_FEED, msg=str(some_number))
    

    Also I wanna ask how far it can goes? I searched but I cant find any documentation about the distance travel for LoRa-MAC.

    Any help would be appreciated. Thanks!



  • @robert-hh Thanks! You saved my day again.



  • @vicky_ you can use decode to get ride of the b
    b'0.1'.decode() gets '0.1", so you code would look like

    s.setblocking(False)
    some_number = s.recv(64)
    client.publish(topic=AIO_RANDOMS_FEED, msg=some_number.decode())
    

    The distance you can achieve with Raw LoRa is the same as with LoRa-MAC, because it is a property of the RF hardware. It all depends on proper RF design of your devices box, antennas in the mote and in your gateway. So, best case are a 5-10 km outdoors, fair case is about 3km, with a sound gateway antenna outdoors, no lower limit for the worst case.



Pycom on Twitter