mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
642 stars 210 forks source link

This library should NOT set a default frequency range! #833

Open zl3ag opened 2 years ago

zl3ag commented 2 years ago

Discussed in https://github.com/mcci-catena/arduino-lmic/discussions/832

Originally posted by **zl3ag** December 18, 2021 This library is being used globally by lots of different apps. It is currently defaulting to certain frequency ranges, and to change those, the person compiling an app has to go digging around in the library documentation and make changes to files within the library. If they have trouble doing that, this library may cause them to transmit on frequencies that are illegal to do so in their country, and often not even know that this is happening as there is no easy way to actually ascertain what frequency is being used. The library needs to be changed so that the frequency plan HAS to be defined within the calling app. If it isn't, then the library should error out and refuse to transmit.
terrillmoore commented 2 years ago

The library needs to be changed so that the frequency plan HAS to be defined within the calling app. If it isn't, then the library should error out and refuse to transmit.

I am always open to pull requests. If you can figure out how to make this work in the Arduino environment, please send a change set. Since the frequency plan and so forth are set at compile time, and the Arduino sketch can't directly influence the compile environment for libraries, it's not clear to me how this could be done.

MCCI uses this with our BSPs, and those have menus for controlling the region. So the user sets the region at compile time.

It is in any case the user's responsibility to comply with regulations. For example, the radio cannot have a linear amplifier that would allow it to exceed the local regulations. The library can't enforce that. Similarly, the user must use an antenna that complies with regulations (if high gain, the user must adjust the output power). The library can't enforce that, either.