pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
196 stars 167 forks source link

[LoRaWAN] Error in LoRaMacChannelManualAdd #96

Closed quentin-ol closed 6 years ago

quentin-ol commented 6 years ago

Hello,

I've spotted an error in LoRaMac.c:

LoRaMacStatus_t LoRaMacChannelManualAdd( uint8_t id, ChannelParams_t params )
{
  [...]
        if( ValueInRange( params.DrRange.Fields.Max, DR_5, LORAMAC_TX_MAX_DATARATE ) == false )
        {
            datarateInvalid = true;
        }
    }
[....]

DR_5 should be replaced by DR_0.

In the current state, this prevents forcing the LoPy to lower its max data rate.

danicampora commented 6 years ago

Thanks, we will fix it!

dmartauz commented 6 years ago

Does it mean that OTAA join is performed at DR_5 as well?

jmarcelino commented 6 years ago

@dmartauz this was only related to adding channels manually.

The corrections were integrated already in https://github.com/pycom/pycom-micropython-sigfox/commit/eca3b714a11c4b84e740a36b4096a20aac3c9be2

Thanks for the report @quentin-ol

dmartauz commented 6 years ago

@jmarcelino Is there any documentation describing which data rates are used during OTAA join and what is the sequence?