How to shorten the classBScheduleMargin ?

Hi @brocaar

there is a classBScheduleMargin (5 senconds) in networkserver.go

It will delay the class B downlink.

The question
1、what is the margin time protect for?
2、why 5 sencond? not 3 sencond …etc
3、I want to shorten the margin time,can you please give me some advise?

thanks!

1、what is the margin time protect for?

// classBScheduleMargin contains a Class-B scheduling margin to make sure
// there is enough time between scheduling and the actual Class-B ping-slot.
const classBScheduleMargin = 5 * time.Second

:slight_smile: Note that the enqueuing and the scheduler (reading from the DB and sending to the gateway) are two processes. So if you lower this margin, it could mean that the downlink is enqueued for a ping-slot before the scheduler is able to send it to the gateway on that slot.

3、I want to shorten the margin time,can you please give me some advise?

Feel free to create a pull-request to make this config variable adjustable. I think it makes sense to add this margin under the [network_server.network_settings.class_b] config section.

1、“ under the [network_server.network_settings.class_b] config section”

could you please show a screenshot about the “config section”? I cannot find it

2、Do you mean I can change the margin value without modifying and building the go project sourcecode?

3、for 5 seconds,is it a test result? or a Theoretical value?

No, the config value is currently defined as a constant. In case you would like to make it adjustable, I suggest you create a pull-request with the code modification to make this a configuration option :slight_smile: See https://www.loraserver.io/loraserver/install/config/ for the loraserver.toml configuration.

Get that!

For the third question
for 5 seconds,is it a test result? or a Theoretical value?

This value is a pessimistic value to make sure that there is plenty of time for the scheduler to pick this up :slight_smile: Probably 4 seconds could have worked too, or maybe even 3. Therefore I think it is good to make this in a config value, so people are free to tweak this to their needs. If you would like to make this value configurable, that would be much appreciated!

Hi brocaar,Thank you very much!

It is my pleasure that you invite me to create a pull-request

But I am new to Go and docker :sweat_smile:

I will try.

Hello, how do you deal with this problem? Now my device can’t receive the downlink of ClassB. It can’t work normally