|
| 1 | +# The Things Network Arduino Library |
| 2 | + |
| 3 | +[](https://slack.thethingsnetwork.org/) |
| 4 | + |
| 5 | +## Introduction |
| 6 | + |
| 7 | +This is an [Arduino Library](https://www.arduino.cc/en/Guide/Libraries) for Arduino-compatible devices like [The Things Uno](https://shop.thethingsnetwork.com/index.php/product/the-things-uno/) and [Node](https://shop.thethingsnetwork.com/index.php/product/the-things-node/) to communicate with [The Things Network](https://www.thethingsnetwork.org). |
| 8 | + |
| 9 | +At the moment this library requires devices to feature a [Microchip RN2xx3 module](http://www.microchip.com/design-centers/wireless-connectivity/embedded-wireless/lora-technology). |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +1. Download the ZIP file of the latest [release on GitHub](https://github.com/TheThingsNetwork/arduino-library/releases). |
| 14 | +2. Follow [Importing a .zip Library](https://www.arduino.cc/en/Guide/Libraries#toc4) to install the library using the ZIP file. |
| 15 | +3. Restart the Arduino IDE. |
| 16 | + |
| 17 | +**NOTE:** Examples for the library will not be exposed in the *File > Examples > TheThingsNetwork* until after the IDE has restarted. |
| 18 | + |
| 19 | +## Examples |
| 20 | +The library comes with several [examples](examples) that can be loaded via *File > Eamples > TheThingsNetwork* once you've installed the library and restarted the IDE. |
| 21 | + |
| 22 | +## API |
| 23 | + |
| 24 | +TheThingsNetwork class features the following [public methods](https://github.com/TheThingsNetwork/arduino-library/blob/master/src/TheThingsNetwork.h#L39): |
| 25 | + |
| 26 | +```C++ |
| 27 | + public: |
| 28 | + void init(Stream& modemStream, Stream& debugStream); |
| 29 | + void reset(bool adr = true, int sf = DEFAULT_SF, int fsb = DEFAULT_FSB); |
| 30 | + bool personalize(const byte devAddr[4], const byte nwkSKey[16], const byte appSKey[16]); |
| 31 | + bool join(const byte appEui[8], const byte appKey[16]); |
| 32 | + void sendBytes(const byte* buffer, int length, int port = 1, bool confirm = false); |
| 33 | + void sendString(String message, int port = 1, bool confirm = false); |
| 34 | + void showStatus(); |
| 35 | +``` |
| 36 | +
|
| 37 | +## Contributing |
| 38 | +
|
| 39 | +Source code for The Things Network is MIT licensed. We encourage users to make contributions on [Github](https://github.com/TheThingsNetwork/arduino-library) and to participate in discussions on [Slack](https://slack.thethingsnetwork.org). |
| 40 | +
|
| 41 | +If you find bugs or documentation mistakes, please check [open issues](https://github.com/TheThingsNetwork/arduino-library/issues) before [creating a new issue](https://github.com/TheThingsNetwork/arduino-library/issues/new). Please be specific and give a detailed description of the issue. Explain the steps to reproduce the problem. If you're able to fix the issue yourself, please help the community by forking the repository and submitting a pull request with your fix. |
| 42 | +
|
| 43 | +For contributing a feature, please open an issue that explains what you're working on. Work in your own fork of the repository and submit a pull request when you're done. |
| 44 | +
|
| 45 | +If you want to contribute, but don't know where to start, you could have a look at issues with the label [*help wanted*](https://github.com/TheThingsNetwork/arduino-library/labels/help%20wanted) or [*difficulty/easy*](https://github.com/TheThingsNetwork/arduino-library/labels/difficulty%2Feasy). |
| 46 | +
|
| 47 | +## License |
| 48 | +
|
| 49 | +Source code for The Things Network is released under the MIT License, which can be found in the [LICENSE](LICENSE) file. A list of authors can be found in the [AUTHORS](AUTHORS) file. |
0 commit comments