Using LoRa for P2P half-duplex long range communication

Ғылым және технология

#lora #arduino #duplex
We will use 2 LoRa modules to create a duplex communication across the long-range. This setup can be used as a GPS tracker or to send simple sensor data real-time between 2 nodes where cellular connectivity is weak or low power is required.
⏰ TIMESTAMPS
0:00 Intro
1:06 LoRa vs LoRaWAN
1:22 Hardware setup
2:49 Setting up 2 nodes
5:29 Loop function to send and receive messages
8:53 Receive message function
11:04 Data exchange between 2 nodes
‣ Some links below are affiliate. I receive a small commission at no extra cost to you.
📻 PRODUCTS MENTIONED
Adafruit RFM95W LoRa Radio Transceiver Breakout amzn.to/3mF1Qq8
🎩 DEMO FILES
hutscape.com/tutorials/lora-d...
hutscape.com/tutorials/lora-d...
🔗 LINKS SHOWN
Adafruit RFM95W LoRa Radio Transceiver Breakout - 868 or 915 MHz - RadioFruit www.adafruit.com/product/3072
Adafruit RFM69HCW and RFM9X LoRa Packet Radio Breakouts tutorial learn.adafruit.com/adafruit-r...
arduino-LoRa by Sandeep Mistry github.com/sandeepmistry/ardu...
arduino-LoRa example with duplex communication github.com/sandeepmistry/ardu...
Arduino millis() www.arduino.cc/en/pmwiki.php?...
Arduino random() www.arduino.cc/reference/en/l...
LoRa Module VS nRF24 VS Generic RF Module || Range & Power Test by Great Scotts • LoRa Module VS nRF24 V...
ESP32 and ESP8266 point-to-point (ESP-Now): Fast and efficient. Comparison with LoRa by Andreas Spiess • #172 Hidden: ESP32 and...
🔌 HARDWARE LAB EQUIPMENT
EEVBlog Digital Multimeter 121GW www.eevblog.com/product/121gw/
Saleae Logic Analyzer amzn.to/3n47Jxh
ATTEN-862D Hot Air Gun workstation s.click.aliexpress.com/e/_A7zoa8
💻 SOFTWARE USED
dotfiles for terminal configuration github.com/sayanee/dotfiles
KiCad kicad.org/
CoolTerm for serial monitor freeware.the-meiers.org/
PartsBox for inventory management partsbox.com/
GoodNotes for highlighting datasheets www.goodnotes.com/
📹 VIDEO PRODUCTION GEAR
iPhone 7S Plus for recording video
Microphone Audio Technica ATR2100-USB for voice recording amzn.to/3gsOiwA
IKEA TERTIAL Work lamp stand hacked as a microphone stand amzn.to/2QJWnCx
Tripod SLIK SDV-10iPhone holder Xiletu XJ-8 s.click.aliexpress.com/e/_AVrL8v
🎬 VIDEO EDITING SOFTWARE TOOLS
Davinci Resolve for video editing
QuickTime for recording screencasts
Canva.com for KZread thumbnail, titles, outro www.canva.com/

Пікірлер: 62

  • @muhammadfajarb
    @muhammadfajarb3 жыл бұрын

    Hi, nice video. I'm new about LoRa. Can you explain, how if there are more LoRa device active at the same time? Will it be interfere with each other? the idea that I got from your explanation, LoRa will check and receive all signal from other LoRa whether it is a known device or unknown device. If like that, LoRa will take more time to check the right address sender device.

  • @sayanee

    @sayanee

    3 жыл бұрын

    Specific to this example that I showed in the video, it might seem that the 2 nodes are receiving data from each other simultaneously, but it is not. The code adds a little random interval time plus a constant period of 2 seconds: github.com/hutscape/hutscape.github.io/blob/master/_tutorials/lora-duplex-a/lora-duplex-a.ino#L36. This ensures the 2 nodes are not "clashing" or interfering with each other. You can say that this is a very simplified form of ALOHA random access protocol www.scholarpedia.org/article/Aloha_random_access "In an ALOHA channel each transmitter sharing the channel transmits data packets at random times."

  • @muhammadfajarb

    @muhammadfajarb

    3 жыл бұрын

    ​@@sayanee Yes, I see. Thanks.

  • @jonathanm9436
    @jonathanm94363 жыл бұрын

    I really enjoyed this - clearly spoken, clearly explained, well paced, focussed, engaging and technically very competent. Thank you. Subscribed.

  • @Heppetronics
    @Heppetronics4 жыл бұрын

    I had been looking at the adafruit data sheet with the example code for RX and TX transmission.... and that was rather long winded. This was clean and crisp. Thank you so much!

  • @budirahmani
    @budirahmani3 жыл бұрын

    There are many things that I have to learn about LORA, thank's for the explanation.

  • @v12cat
    @v12cat4 жыл бұрын

    Excellent clear description!!

  • @salvodippolito6013
    @salvodippolito6013Ай бұрын

    Great video! Thanks a lot for explaining everything so clearly.

  • @SantanderDiogenes
    @SantanderDiogenes3 жыл бұрын

    Excellent project!! Very well explained and very usefull!!

  • @dl8cy
    @dl8cy4 жыл бұрын

    your videos are always a pleasure

  • @kcpkcp1000
    @kcpkcp10007 ай бұрын

    Thank you for the video. It is so useful and informative. I just subscribed.

  • @aadhikarianish
    @aadhikarianish4 жыл бұрын

    Great tutorial superb explanation :D

  • @sureshbabuvu
    @sureshbabuvu Жыл бұрын

    excellent, in-depth knowledge in coding, pl keep uploading such high standard contents.

  • @Aeroimagem
    @Aeroimagem11 ай бұрын

    Excelente video! Thank you very much!!!

  • @soumitradey8208
    @soumitradey82084 жыл бұрын

    Excellent, Heltec LoRa V2 is also a good module on oled, great . Sx1278 and Sx1268 is a good module.

  • @chilljlt
    @chilljlt4 жыл бұрын

    great tutorial!

  • @mamunurrashid4628
    @mamunurrashid46282 жыл бұрын

    wow its too nice explanation . thanks

  • @victordiaz5922
    @victordiaz59222 жыл бұрын

    excellent video, I am learning LORA Arduino and also English. She also looks like an English teacher.

  • @SA-oj3bo
    @SA-oj3bo2 жыл бұрын

    Explained very well ....

  • @sanjeevrao7121
    @sanjeevrao71212 жыл бұрын

    Excellent video

  • @ralphchen1125
    @ralphchen11253 жыл бұрын

    nice explanation

  • @TheAndrexso
    @TheAndrexso4 жыл бұрын

    Great video! But I have a doubt, the EN pin doesn't need to be connected to any pin of the Arduino?

  • @goncalobarroso8493
    @goncalobarroso84932 жыл бұрын

    hi, ive notice you´re not implementing things like Duty cycle, spreading facture(SF), code rate, power transmition, bandwidth. My question is: when using only lora(not lloraWAN) we can simply ignore most of the regulations like the duty cycle, SF/bandwidth? thanx for the explanation.

  • @wangchaichana5710
    @wangchaichana57104 жыл бұрын

    Is it possible to use two LoRa which one of them being client and another being server? Such as one of them sending the data, another receiving the data only.

  • @Sebastianltaylor
    @Sebastianltaylor4 жыл бұрын

    Excellent video! I'm working on a multiple objects GPS tracking project where I track objects in movement, and I need to repeat their signals using repeaters(obviously) to finally receive them in the master device (objects -> repeaters -> Master) or well (objects -> Master). It's a really long dinstance the signals have to travel (from the master to one of the repeaters is around 33KM!!!) I think LoRa in 433mhz is my best option, what do you think? What results did you get in your project? Thank you a lot, now I'm a subscriber :)

  • @sayanee

    @sayanee

    4 жыл бұрын

    Thanks for sharing! I'm working on a simple GPS LoRaWAN keychain. It was about a 500m line of sight with the antenna I showed. I haven't yet optimized anything in the firmware or the antenna to get a longer range. Regarding the frequency, isn't it mandated by the country? Hence, I have to use the 915MHz.

  • @ramimehyar481
    @ramimehyar4812 жыл бұрын

    Thank u for the vid! Question though, if i want to send only from one node and receive only from the other, do i still need the timing and delay?

  • @sayanee

    @sayanee

    2 жыл бұрын

    I guess no. If one is receiving and the other is solely transmitting, then just set the transmitting to a periodic interval (or whenever your application needs to transmit). Set the receiving node to receive the packet continuously. I have the TX and RX examples: hutscape.com/tutorials/lora-tx hutscape.com/tutorials/lora-rx

  • @anandathalia9189
    @anandathalia91893 жыл бұрын

    thanks for the tutorial, i tried this but it just show that it sending without receiving. is it means just my receiver module that broken, or the transmiter it self? can anyone help me?

  • @sayanee

    @sayanee

    3 жыл бұрын

    You should have 2 exact pairs of the same LoRa node. If you cannot receive with node A, then try swapping around E.g. Make Node A transmit and Node B receive and vice-versa.

  • @mumbaiverve2307
    @mumbaiverve23072 жыл бұрын

    Hi Sayanee, Thanks for the post. Just in case 2 nodes transmit simultaneously and there is a collision , is there an automatic re transmit with some random backoff , built into the LoRa hardware , Or is the data lost ?

  • @sayanee

    @sayanee

    2 жыл бұрын

    Great question!! LoRa (which I covered in this video) in the OSI layer only covers the *Physical layer*, so I believe we can tackle the collision problem in the upper layers like the Transport Layer. LoRaWAN on the other hand covers the higher layers in the OSI model. I think the hardware only has support for the Physical Layer for the radio, so we have to incorporate our own upper layers to tackle this collision. As an analogy, TCP which is in the Transport layer of the OSI model, deals with the delivery of data from the source to the destination and it guarantees the delivery, but UDP does not guarantee the delivery of data. Ethernet or WiFi in the Physical layer does not deal with this.

  • @mumbaiverve2307

    @mumbaiverve2307

    2 жыл бұрын

    @@sayanee ​ Thanks for your reply. AFAIK , in the upper layers collisions are usually detected by listening on the transmit channel while broadcasting.Since LoRa is half duplex , would this be possible ? Hope my question is not too inane (won't be the first time)

  • @sayanee

    @sayanee

    2 жыл бұрын

    @@mumbaiverve2307 Interesting thought! I'm not sure about that :) It would depend on the application we are building I guess.

  • @azizbouslimi3655
    @azizbouslimi36552 жыл бұрын

    est ce que c'est possible de faire un réseau maille avec 4 noeud LoRa ?.... et tout les noued comunicant entre eux avec LoRa RMF 96 ?

  • @sayanee

    @sayanee

    2 жыл бұрын

    Oui, je pense que c'est possible avec 4 nœuds LoRa. Je n'ai jamais essayé, mais regardez Meshtastic meshtastic.org/ Une ressource vidéo : kzread.info/dash/bejne/ho1qz5ifg5vIqLg.html

  • @ramimehyar481
    @ramimehyar4812 жыл бұрын

    Would adapting this library work with the SX126x module?

  • @sayanee

    @sayanee

    2 жыл бұрын

    I have never done that. But seems possible as indicated in the readme of arduino-lora library un the "Compatible Hardware" list: github.com/sandeepmistry/arduino-LoRa#compatible-hardware

  • @adirasalsabila28
    @adirasalsabila283 жыл бұрын

    can works in Dragino LoRa Shield 915 MHz?

  • @sayanee

    @sayanee

    3 жыл бұрын

    Yes, seems like the Arduino LoRa firmware listed the Dragino LoRa as one of the compatible hardware: github.com/sandeepmistry/arduino-LoRa#compatible-hardware

  • @anonymousx4509
    @anonymousx4509 Жыл бұрын

    I am using Ra-02 SX1278 and Arduino Uno, When I use the example sender and receiver, I have constant communication but whenever I use the codes here, I always get "Sending data..." on one node and "Error: Message length does not match length" on the other node. Why is that so? I am planning to use this to connect 4 LoRa but I can't even connect 2 of them.

  • @sayanee

    @sayanee

    Жыл бұрын

    Try this issue if you are also using arduino-lora library: github.com/sandeepmistry/arduino-LoRa/issues/351

  • @anonymousx4509

    @anonymousx4509

    Жыл бұрын

    @@sayanee Thank you so much for this. I already resolve the issue I am having. My problem right now is that the Arduino seemed to stop after several minutes (sometimes hours). I need to reopen serial monitor or reset the arduino (using the button) to make it working again. You have any idea how to fix it? Thank you so much for your response!

  • @sayanee

    @sayanee

    Жыл бұрын

    @@anonymousx4509 Uh! I wouldn't keep my serial monitor running for hours. There might be some timeout or connection dropped issues. I suggest looking into other ways of "capturing" the data if that's what you are trying to do. For example, record it on some memory on the board or send it off to a gateway to be stored in the cloud. It all depends on what you are trying to do.

  • @shwetasharma8635
    @shwetasharma86352 жыл бұрын

    hello, i unable to send and receive more than 150 character using these code

  • @sayanee

    @sayanee

    2 жыл бұрын

    Probably because LoRa is a low bandwidth protocol. You need a higher-level application-based framework with LoRaWAN to help you with this. Try Meshtastic maybe: meshtastic.org/

  • @kashifshad3265
    @kashifshad32653 жыл бұрын

    Could you tell me how much distance I can cover ?

  • @sayanee

    @sayanee

    3 жыл бұрын

    I tested this exact setup and it was about 500m line of sight without any optimization in the firmware or the antenna. In my latest video, with the LilyGO T-Beam, it was about 1km: kzread.info/dash/bejne/fZus2pmjmdm5ldY.html

  • @kashifshad3265

    @kashifshad3265

    3 жыл бұрын

    @@sayanee Thank you for your reply. Can I extend this till 2kms by doing something?

  • @sayanee

    @sayanee

    3 жыл бұрын

    @@kashifshad3265 Yes I'm sure you could. Optimization in the firmware or antenna or more power or higher altitude and a clear line of sight. See this video from Andreas Spiess for more ideas: kzread.info/dash/bejne/k5icuauoXZrNopc.html

  • @kashifshad3265

    @kashifshad3265

    3 жыл бұрын

    @@sayanee Sorry m asking you one more question. So basically what my requirement is that I need 2 GPS location of two automobiles and basis on the difference I need to tell the car ahead to slow down or speed up. Can I use Lora shield, arduino uno, GPS module without the lora gateway? and the thing is we don't want to use internet.

  • @sayanee

    @sayanee

    3 жыл бұрын

    @@kashifshad3265 Yes you can. I did exactly that - no internet, just GPS + LoRa (not LoRaWAN) and then calculate the Haversine distance. The cars need to be in a fairly open space, but you need to test them out in your preferred environment. You might just need to be aware of the accuracy of the GPS. Depending on the speed of the cars, you will need to test the response time, I guess. Check out my last video here I used 2 LoRa nodes with GPS and no Internet to calculate their distance kzread.info/dash/bejne/fZus2pmjmdm5ldY.html

  • @farahalshammari8576
    @farahalshammari85763 жыл бұрын

    can we use something instead to loRa ?

  • @sayanee

    @sayanee

    3 жыл бұрын

    Sure! If you want to use another wireless protocol, BLE, WiFi, SigFox, NFC, 4G are all possible. With all wireless protocols, there are constraints on power usage, bandwidth, and range. Which wireless we chose, in the end, will all depend on the particular application we are building for.

  • @farahalshammari8576

    @farahalshammari8576

    3 жыл бұрын

    @@sayanee Thank you for answering my question 💕

  • @amirahfakhirah3236
    @amirahfakhirah32364 жыл бұрын

    May i know how to download the code?

  • @sayanee

    @sayanee

    4 жыл бұрын

    You can download the 2 examples from here: hutscape.com/tutorials/lora-duplex-a hutscape.com/tutorials/lora-duplex-b

  • @mohamadhabibhomeidi5634
    @mohamadhabibhomeidi56343 жыл бұрын

    What about range of connection?

  • @sayanee

    @sayanee

    3 жыл бұрын

    With this exact setup and no other optimization with antenna or firmware, it was about 500m line of sight.

  • @josephmathew5151
    @josephmathew51513 жыл бұрын

    Can you help me with email for guiding my code

  • @alleksandrs
    @alleksandrs4 жыл бұрын

    Good tutorial, but it's a pity that you say "go ahead" all the time. E. g. 5 times during 35 seconds: ...Let's GO AHEAD and detect whether the ports are available right now. I haven't linked any of the nodes, so let me GO AHEAD and link node "A". Similarly I will GO AHEAD and plug-in the node "B". And now if I GO AHEAD and query the ports - two ports are available. So let's GO AHEAD and just copy it. ...

  • @sayanee

    @sayanee

    4 жыл бұрын

    Thanks for the feedback! Bad pause filler for saying "go ahead" :)

Келесі