• LoRa Update

    From Warpslide@21:3/110 to All on Friday, December 31, 2021 12:49:55
    Hi All,

    I received the two LoRa modules yesterday and have played around with them a little bit. I may try and do some range tests this afternoon sometime.

    Both Modules:
    https://ibb.co/ncD4cBv

    Module on a Pi3 (sending a .pkt):
    https://ibb.co/NYRCyxH

    Module on a Pi2 (receiving that .pkt):
    https://ibb.co/r3gxFwx


    I've played around with the example code which was kind of fun, the modules have three buttons on them, with that example code you can press a button to send a message to all nearby LoRa radios.

    I modified (bastardized?) that code with code I found elsewhere to take a .pkt file from my board and break it up into chunks and send it over LoRa.

    pi@pi3:~ $ ls -l *.pkt
    -rw-r--r-- 1 pi pi 4164 Dec 31 08:14 12a64038.pkt

    pi@pi3:~ $ ls -lh *.pkt
    -rw-r--r-- 1 pi pi 4.1K Dec 31 08:14 12a64038.pkt

    pi@pi3:~ $ python3 test_radio.py
    Start: Fri 31 Dec 2021 11:25:08 AM EST
    Finish: Fri 31 Dec 2021 11:26:34 AM EST

    It takes about 86 seconds to send 4.1k to the module right next to it.

    With these modules you can have up to 252 bytes in a single transmission (including control data). I tried breaking the .pkt file up into 200 character chunks, but wasn't able to receive the whole file on the other side. Breaking it up into 128 character chunks worked better, but not every time. I seem to have the best luck with 55 character chunks. This is all at close range with the antennas next to each other.

    The python code I'm using doesn't have any error correction or even knows if the receiving end is actually listening, but does work to show it can be done:

    Sending Side:
    [ - cut - ]
    CHUNK_SIZE = 55
    pkt_file = '12a64038.pkt'
    display.text('Sending PKT', 35, 0, 1)
    display.show()

    os.system('date')

    with open(pkt_file, 'rb') as infile:
    while True:

    chunk = infile.read(CHUNK_SIZE)
    if not chunk:
    display.fill(0)
    display.show()
    os.system('date')
    break
    rfm9x.send(chunk)
    time.sleep(1)


    Receiving Side:
    [ - cut - ]
    file = open('trans.pkt', 'wb')

    while True:
    packet = None
    packet = rfm9x.receive()
    if packet is None:
    display.text('- Waiting for PKT -', 15, 20, 1)
    display.show()
    else:
    file.write(packet)
    display.text('Receiving PKT', 15, 20, 1)
    display.show()
    time.sleep(0.1)
    display.fill(0)
    display.show()
    file.close

    Source: https://lowpowerlab.com/forum/general-topics/transmitting-images-with-raspberry -pi/


    If anyone knows of another way of sending files through LoRa please let me know. There's a way of setting up a remote serial port over LoRa that I'm looking into. It'd be neat to try using zmodem or something similar.


    Jay

    ... Dachshunds are really small crocodiles with fur.

    --- Mystic BBS v1.12 A47 2021/12/24 (Raspberry Pi/32)
    * Origin: Northern Realms (21:3/110)
  • From acn@21:3/127.1 to Warpslide on Saturday, January 01, 2022 20:28:00
    Am 31.12.21 schrieb Warpslide@21:3/110 in FSX_NET:

    Hallo Warpslide,

    I received the two LoRa modules yesterday and have played around
    with them a little bit. I may try and do some range tests this
    afternoon sometime.
    [...]

    Very nice experiment!

    I don't have any LoRa hardware on hand, so I cannot participate right
    now, but it sounds quite interesting.
    It would be very nice if you would keep us informed on how it turns
    out :)

    Regads,
    Anna

    --- OpenXP 5.0.51
    * Origin: Imzadi Box Point (21:3/127.1)
  • From Warpslide@21:3/110 to acn on Saturday, January 01, 2022 17:48:29
    On 01 Jan 2022, acn said the following...

    Very nice experiment!

    I don't have any LoRa hardware on hand, so I cannot participate right now, but it sounds quite interesting.

    It would be very nice if you would keep us informed on how it turns
    out :)

    I ended up doing a small range test today. I set up the Pi 3 in my office on the second floor and hooked the Pi2 up to a battery back and took a walk around the block.

    I was able to get about 325 meters south (the end of our street) and 165
    meters north (the other end of our street). As soon as I go around the corner and there were too many houses in the way the signal was blocked.

    https://ibb.co/XJXTMpL

    I'm sure if I were to get the antenna higher and mount it right-side-up (instead of just laying flat on a desk) I'd get some better distance. I may try going on the rail trail tomorrow where I can get a long distance with lots of open space and see what kind of distance I can get there.

    I found some other example code that uses a "reliable datagram" where each packet is addressed to a specific radio node and acknowledged by the receiver.

    https://bit.ly/3ziJqlp

    It sends a "ping" every 10 seconds from node 1 (Pi 3) to node 2 (Pi 2), I modified the code slightly to display the results on the onboard OLED screen so I could see the results in real-time as I walked.

    https://ibb.co/9GTPd2W

    So for sure if I want to get up to 10km away to my father-in-law's house I'll need to get the antenna higher and probably have to use a directional antenna.


    Jay

    ... Pros are those who do their jobs well, even when they don't feel like it.

    --- Mystic BBS v1.12 A47 2021/12/24 (Raspberry Pi/32)
    * Origin: Northern Realms (21:3/110)