-
Notifications
You must be signed in to change notification settings - Fork 96
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
Support for IN865_867 #233
Conversation
src/TheThingsNetwork.cpp
Outdated
{ | ||
sendMacSet(MAC_ADR, "off"); // TODO: remove when ADR is implemented for this plan | ||
sendMacSet(MAC_RX2, "2 866550000"); // SF10 | ||
//disable two default LoRaWAN channels |
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.
two
=> three
src/TheThingsNetwork.cpp
Outdated
sendChSet(MAC_CHANNEL_DRRANGE, ch, "0 6"); | ||
sendChSet(MAC_CHANNEL_STATUS, ch, "on"); | ||
switch(ch) | ||
{ |
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.
The indentation is a bit strange here.
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.
Might need a test by a 3rd party, but just looking at the code it looks good to me.
865_867 addition was tested to work on two channels but 865985000 is showing a few issues. I shall debug and update soon. |
@akshaim thanks! Should we wait for your debugging and test results? |
Sure. I am waiting for an SDR to arrive to see exactly what is going on. |
Works now. Uplink and Downlink tested. |
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.
lgtm
It is fine as it is, but I would have written this function differently as there is no need for the loop and switch - they just complicate the algorithm without saving any memory.
|
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.
Duty cycle value is incorrect according to my calculations.
src/TheThingsNetwork.cpp
Outdated
uint8_t ch; | ||
for (ch = 3; ch < 7; ch++) | ||
{ | ||
sendChSet(MAC_CHANNEL_DCYCLE, ch, "799"); |
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.
For 1% duty cycle on 3 channels, this value should be 99
, not 799
.
The <dutyCycle> value that needs to be configured can be
obtained from the actual duty cycle X (in percentage)
using the following formula: <dutyCycle> = (100/X) – 1
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.
I shall try the same and update you soon.
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.
Actually now that I slept on this I doubt it again:
1% duty cycle over 3 channels is 0.333% per channel.
(100/0.333) - 1 = 299
So the value should be 299
.
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.
Thanks. The command reference manual states the same.
Thanks. I have updated the code as per your recommendations and it works! Can you help me implement ADR on the channel? |
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.
LGTM
ADR needs to be done on the core TTN infrastructure, so it is out of our hands. This library is good as it is now. Let's merge.
What is the reason to disable the three default LoRaWAN channels? Regarding the loop; this is consistent with other frequency plans (and it may reduce flash memory). |
Any news @akshaim @jpmeijers ? |
|
Also note that we plan to rewrite the frequency plan logic to save program space. So let's not worry too much about it now as we will rethink and re-implement it later. |
@johanstokking Please see the following snap from the RN2483 command reference manual. Channel 0-2 can be used only on default channels. |
No description provided.