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

Should verify whether non-EU868 regions work #8

Open
matthijskooijman opened this issue Apr 16, 2020 · 4 comments
Open

Should verify whether non-EU868 regions work #8

matthijskooijman opened this issue Apr 16, 2020 · 4 comments

Comments

@matthijskooijman
Copy link
Contributor

So far, I've only tested EU868. In #5, some issues with US915 were reported, but maybe the 2.2 update that occurred after that issue fixes these issues?

Anyway, this just needs some testing. If you have hardware for other regions and want to give this a spin, please report your findings here :-)

@ricaun
Copy link

ricaun commented Apr 16, 2020

Hello,
I gonna try mix some code from version 2.2, to try to fix the join.

I noticed de the library does not have a good way to select a subband
like LMIC_selectSubBand.

I created this dump function to do the job.

void LMIC_selectSubBand(int sub)
{
  if (REG_IS_FIX()) {
    for (int i = 0; i < MAX_FIX_CHNLS_125; i++)
    {
      if ((sub * 8 - 1) < i && i < (sub + 1) * 8)
      {
        Serial.print("LMIC_enableChannel : ");
        Serial.println(i);
      }
      else
      {
        LMIC_disableChannel(i);
      }
    }

    for (int i = 0; i < MAX_FIX_CHNLS_500; i++)
    {
      if (sub == i)
      {
        Serial.print("LMIC_enableChannel : ");
        Serial.println(MAX_FIX_CHNLS_125 + i);
      }
      else
      {
        LMIC_disableChannel(MAX_FIX_CHNLS_125 + i);
      }
    }
  }
}

It's not pretty but do the job.

@matthijskooijman
Copy link
Contributor Author

Another thing to test is whether enabling multiple regions and selecting one at runtime actually works.

@ricaun With your suggested LMIC_selectSubBand(), were you able to test US915? If that works, I'm inclined to just reinstate that function (using your suggested version, or maybe something slightly more internal).

matthijskooijman added a commit that referenced this issue Jul 15, 2020
This removes the hardcoded EU868 region from examples by just querying
BasicMac for the first enabled region instead (thanks to Luiz Henrique
Cassettari for suggesting this in #9).

Additionally, this puts examples of all regional defines in
target-config.h and documents that multiple can be defined at the same
time (though multiple regions and other regions than EU868 have not been
tested yet, see #8).
@ricaun
Copy link

ricaun commented Jul 15, 2020

@ricaun With your suggested LMIC_selectSubBand(), were you able to test US915? If that works, I'm inclined to just reinstate that function (using your suggested version, or maybe something slightly more internal).

Yes, I have US915 and AU915 gateways in my lab, I already test each region. Works fine! (Downlink is not working, probably TTN server is buggy).

I didn't test both regions at the same time, I need to define both regions on the target-config and to select the region on the code using some like this???

u1_t code = 0; // 0 or 1
u1_t os_getRegion (void) { return LMIC_regionCode(code); }

That's it? If I change the code I can select the first (code = 0;) or second (code = 1;) region?

I supposed that's the way to select the region on the code...

@matthijskooijman
Copy link
Contributor Author

That's it? If I change the code I can select the first (code = 0;) or second (code = 1;) region?

Yup, I think that should be enough. You can also just return e.g. REGCODE_US915 from os_getRegion(), then you don't have to rely on the order of regions (but for a quick test, either is fine).

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

No branches or pull requests

2 participants