Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 271 forks source link

MultiSF channels ignores implicit header mode for RX #101

Closed nsforth closed 10 months ago

nsforth commented 1 year ago

Hi!

I recently tried to use SF6 with station based on SX1302. There is a problem with SX1276 based devices that require implicit header mode for SF6. SF6 and implicit header only work for LoraStd modem, 8x8 multiSF channels simply ignore implicit header settings in ifcfg struct. Any packets sent by sx1276 with implicit header received by LoraStd, multiSF channels never seen SF6 packets.

Is it really possible to use multiSF 8x8 channels with implicit header mode?

mcoracin commented 1 year ago

Hello, Implicit header is not supported by multiSF channels, only the LoRaStd (called lora_service in sx1302 HAL) supports implicit header.

It is indicated in the HAL here: https://github.com/Lora-net/sx1302_hal/blob/4b42025d1751e04632c0b04160e0d29dbbb222a5/libloragw/inc/loragw_hal.h#L203

Best regards, Michael

nsforth commented 1 year ago

Many thanks for fast answer!

Ok, but for what purpose exist registers in loragw_reg.h like SX1302_REG_RX_TOP_TXRX_CFG2_IMPLICIT_HEADER and similar registers there: https://github.com/Lora-net/sx1302_hal/blob/4b42025d1751e04632c0b04160e0d29dbbb222a5/libloragw/inc/loragw_reg.h#L602 Registers names looks like something useful for RX implicit header configuration. :/

mcoracin commented 1 year ago

Indeed, you're right. It is possible, but it has never been tested. Also not sure about compatibility with sx1276 SF6.

But you can give it a try, for this you'll need to set the following registers:

You may need to disable the fine sync for SF6 also by setting the following register to false:

So you realize that the packet length is fixed for all channels in this case.

Again, it has never been tested, and it is not officially supported, so we may not be able to provide much more support than this.

sx1261 radio provides a better SF5/SF6 support.

nsforth commented 1 year ago

It's okay for me. Should i disable fine sync before packet send or it must be also disable on multisf modems configuration somewhere in lgw_start stage?

mcoracin commented 1 year ago

For receiving SF6 packets emitted by a sx1276 on the gateway, you can disable the fine sync in the sx1302_lora_correlator_configure() function of the sx1302_hal.

For sending SF6 packets from the gateway to the sx1276, I think you'll need to keep the SX1302_REG_TX_TOP_TXRX_CFG0_2_FINE_SYNCH_EN register set to 0. Currently it is set to 1 for SF5 and SF6.

But again, never tested.

nsforth commented 10 months ago

Even with your last recommendations it doesn't work. Anyway, thanks a lot!