sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.61k stars 621 forks source link

Examples with Addresses of just one Byte #593

Closed ruiseixasm closed 1 year ago

ruiseixasm commented 1 year ago

Hi,

I would like some examples with a full 16bits integer, 2 bytes for the address instead of just 1 byte as stated on your examples:

byte localAddress = 0xBB;     // address of this device
byte destination = 0xFF;      // destination to send to

The LoRa specs state:

AT+ADDRESS=<Address>
<Address>=0~65535(default 0)

One byte is too little, just 256 possible addresses!

Thanks

morganrallen commented 1 year ago

Those AT commands have nothing to do with the LoRa spec, they are just provided by that devices default firmware.

This LoRa driver send arbitrary binary data and does not actually have a concept of addressing. Therefore you can set your 'address' to any size you want and the receiving devices should just pull a value of the right size from the right position. You can read through that example more to see how the address is extracted.

Kongduino commented 1 year ago

This module you link to is a managed module: you can see on the photo it has an MCU between the UART pins and the LoRa chip. The document you link to has nothing to do with the LoRa specs... There are no AT commands in LoRa. This is the AT firmware of this specific company for this specific MCU. And of course it has nothing to do with this library...