Skip to content
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

Fix channel selection for AU915-928 US902-928 #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gonzabrusco
Copy link

When selecting the channel to transmit, the library is omitting that not all channels can use all SF. That is the case for AU915-928 and US902-928. I noticed that TTN was forcing a SF7 (with ADR) but something my device was transmitting at SF8BW500 (channel 65). Immediately after that TX, TTN was sending a new ADR command to use SF7 again.

After debugging the library, I've found out that the selectChannel function was selecting any available channel, regardless if the desired data rate was obtainable or not (the function requiredRate was approximating the closest data rate, which I'm not sure if it's valid, at least TTN didn't like it). I've added a new parameter (desired_rate) to the function isAvailable to check if the required channel index is compatible with the desired SF. Probably the selectChannel function needs a refactoring. But for now I think this works fine.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant