-
Notifications
You must be signed in to change notification settings - Fork 350
Implement token bucket duty cycle enforcement #1297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Implement token bucket duty cycle enforcement #1297
Conversation
|
We had a discussion in the Dutch community today. Some people didn't care much, others wanted a proper implementation. I'm neutral either way (not even sure if I enabled it myself). Perhaps this could start a broader discussion to decide it once and for all. |
|
how does this work for USA where there is no duty cycle limit? |
The same as it is currently, airtime factor already limits it to the same amount, just less reliable. So both now and with this method, they would need to disable it. (set af 0) |
|
whatever the change is, it should not limit duty cycle at any percentage for regions that don't have duty cycle limit. |
Its probably higher than the current cap you guys have. But a valid point for another issue on if and what the default should be. Perhaps it should be set with the region or something. |
| return 2.0; | ||
| } | ||
|
|
||
| void Dispatcher::updateTxBudget() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is race potential here. Are we sure this is always called from an Arduino single loop context? Or can this also be called by timers, callbacks or interrupts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch on thinking about thread safety! However, this is not a concern in this case. The updateTxBudget() method is only called from within the Dispatcher::loop() context, which is always executed from the Arduino single-threaded loop() function.
|
@ViezeVingertjes I welcome proper implemetation of hourly duty cycle for europe, but this needs to be set to 0 by default. we don't want US, AU, NZ and other countries be limited to 10% by default. |
Hmm, but default AF was 1.0 right? So i feel 10% would reflect the original 'duty cycle' more than 0%? In practice it should already transmit more than with the original AF, so if anything, it shouldn't be less after this change. |
yes, you are right. AF=0 can be dangerous.. AF=1 is optimal, sorry for that. |
Haha check! thought maybe my thought train was wrong, reverted it -> 1b959a9 |
you reverted it to 9 tho? we need it at 1 |
00de1a2 to
a43b0e5
Compare
|
@ViezeVingertjes You can simply drop the last two commits, right? First you change it from 1 to 9 and then back from 9 to 1. Except for the |
a43b0e5 to
eb4fa03
Compare
Done. |
|
how does a user know when they exceed the air time factor limit? just a failed send on the radio? any return error code to the clients so the clients can put up error messages to let the users know? |
Replaces per-transmission delay with a rolling window token bucket for better regulatory compliance.
Sets default to 10% duty cycle (airtime factor 9.0), the highest common legal limit worldwide(?)
Resolves #817.