nopnop2002 / esp-idf-sx127x

SX1276/77/78/79 Low Power Long Range Transceiver driver for esp-idf
MIT License
67 stars 13 forks source link

Is possible communicate p2p? #8

Closed julioj4pa closed 1 year ago

julioj4pa commented 1 year ago

Hello, awesome code. Thank you for sharing. I'm already using Wifi of ESP-IDF to communication. I'm so newbie, I read library but I can't find how to communicate peer to peer... Is it possible? If is how can I do it? I'm really thankful for attention.

nopnop2002 commented 1 year ago

P2P is possible. Requires 2 ESP32s and 2 LoRa modules. Please try this.

https://github.com/nopnop2002/esp-idf-sx127x/tree/main/basic

git clone https://github.com/nopnop2002/esp-idf-sx127x
cd esp-idf-sx127x/basic/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c3}
idf.py menuconfig
idf.py flash
julioj4pa commented 1 year ago

I have multiple nodes in network. I want to address each node like multicast and send message to specific node. How to put address each one to direct communication? If not possible I'll send messages as broadcast and process message at each node...

nopnop2002 commented 1 year ago

You can communicate only with the other party whose SyncWord matches.

lora_set_sync_word(int sw)

The syncword can be used to isolate networks of LoRa devices. A receiver using one syncword will not (mostly) receive packets from a transmitter using a different Syncword. The initial value of Sync Word for SX127X is 0x12.

However, it is not 100% certain.

Pls read this. https://forum.arduino.cc/t/question-about-lora-setsyncword-option/869247 https://forum.arduino.cc/t/what-is-sync-word-lora/629624/5

There is a lot of discussion on the internet about LoRa's Sync Word. It seems better to send the message as a broadcast and process the message on each node.