<commit_before>[![Build Status](https://travis-ci.org/things-nyc/mapthethings-arduino.svg?branch=master)](https://travis-ci.org/things-nyc/mapthethings-arduino)

This is a fork of a section of [**The Things Network New York's**](https://github.com/things-nyc) **Map The Things app** that was developed primarily by [<NAME>](https://github.com/frankleonrose). Huge thanks to **Frank** for his hard work and ongoing patience, as well as to [<NAME>](https://github.com/terrillmoore), [<NAME>](https://github.com/chrismerck), [<NAME>](https://github.com/mimiflynn), and [<NAME>](https://github.com/etsarnas) for their ongoing efforts with the software and harware components. Please fork the [master repos](https://github.com/things-nyc) and lend a hand. This and the other related **Map The Things** repos are under active development.

# MapTheThings-Arduino

The Arduino app portion of [MapTheThings](http://map.thethings.nyc), the
global coverage map for The Things Network (TTN).

## Hardware Wiring

### Using [RFM95 LoRa Breakout](https://www.adafruit.com/product/3072) and [Feather M0 Bluefruit](https://www.adafruit.com/product/2995)
- [LoRa transceiver pins are defined in software here](https://github.com/things-nyc/mapthethings-arduino/blob/b47e33881d88afeec336cf7f758cd791c54c9a01/MapTheThings-Arduino/Lora.cpp#L49)


RFM95 | Feather
----- | -------
VIN   | 3V
GND   | GND
G0    | A2
CS    | A4
RST   | A5
SCK   | SCK
MOSI  | MOSI
MISO  | MISO
G2    | 6
G1    | 5

( You can connect either to a [li-poly battery](https://www.adafruit.com/products/2750) or power via [USB cable](https://www.adafruit.com/products/2008) )


![alt text](https://github.com/forrestfiller/mapthethings-arduino/blob/master/images/assembled-on-breadboard-web.jpg "assembled map the things node")

---

In lieu of the above breakout board, you could alternatively use the [LoRa Radio Featherwing](https://www.adafruit.com/products/3231) in conjunction with the above Bluefruit. You'll want to solder up the connections like so:


![alt text](https://github.com/forrestfiller/mapthethings-arduino/blob/master/images/feather-radioWing-front-web.jpg "image showing front of a lora radio featherwing")



![alt text](https://github.com/forrestfiller/mapthethings-arduino/blob/master/images/feather-radioWing-rear-web.jpg "image showing rear of a lora radio featherwing")


## Using the code
### Using with platformIO
- Inside the root level directory of your copy of this repo run the following commands:

- ```platformio run``` (to install libraries and build code)
- ```platformio upload``` (to install code on a device)

### Using with Arduino IDE
- Install [Adafruit's Adafruit_BluefruitLE_nRF51 library](https://github.com/adafruit/Adafruit_BluefruitLE_nRF51) Arduino library
- Install [The Things Network New York's version of the IBM LMIC library](https://github.com/things-nyc/arduino-lmic)
- Install [Frank's enhanced Arduino logging library that supports redirection](https://github.com/frankleonrose/Arduino-logging-library)
- Verify and Upload code

## Node Responsibilities
- Advertise capabilities via BLE
- Respond to scan from a BLE Center (the MapTheThings-iOS app)
- Serve LoRa configuration, status, and responses as BLE characteristics
- Accept LoRa configuration and transmission commands as BLE characteristic
- Store device EUI and sequence number in NVRAM

## License
Source code for Map The Things is released under the MIT License,
which can be found in the [LICENSE](LICENSE) file.
<commit_msg>Updated Forrests pinouts and removed fork header<commit_after>[![Build Status](https://travis-ci.org/things-nyc/mapthethings-arduino.svg?branch=master)](https://travis-ci.org/things-nyc/mapthethings-arduino)

# MapTheThings-Arduino

The Arduino app portion of [MapTheThings](http://map.thethings.nyc), the
global coverage map for The Things Network (TTN).

**Map The Things app** that was developed primarily by [<NAME>](https://github.com/frankleonrose).
Thanks to the rest of the Thing New York team, especially [<NAME>](https://github.com/terrillmoore) and [Forrest Filler](https://github.com/forrestfiller) for their contributions to this repo. 

Please fork the [master repos](https://github.com/things-nyc) and lend a hand. This and the other related **Map The Things** repos are under active development.

## Hardware Wiring

### Using [RFM95 LoRa Breakout](https://www.adafruit.com/product/3072) and [Feather M0 Bluefruit](https://www.adafruit.com/product/2995)
- [LoRa transceiver pins are defined in software here](https://github.com/things-nyc/mapthethings-arduino/blob/b47e33881d88afeec336cf7f758cd791c54c9a01/MapTheThings-Arduino/Lora.cpp#L49)


RFM95 | Feather
----- | -------
VIN   | 3V
GND   | GND
G0    | A2
CS    | A5
RST   | A4
SCK   | SCK
MOSI  | MOSI
MISO  | MISO
G2    | 6
G1    | 5

( You can connect either to a [li-poly battery](https://www.adafruit.com/products/2750) or power via [USB cable](https://www.adafruit.com/products/2008) )


![alt text](https://github.com/forrestfiller/mapthethings-arduino/blob/master/images/assembled-on-breadboard-web.jpg "assembled map the things node")

---

In lieu of the above breakout board, you could alternatively use the [LoRa Radio Featherwing](https://www.adafruit.com/products/3231) in conjunction with the above Bluefruit. You'll want to solder up the connections like so:


![alt text](https://github.com/forrestfiller/mapthethings-arduino/blob/master/images/feather-radioWing-front-web.jpg "image showing front of a lora radio featherwing")



![alt text](https://github.com/forrestfiller/mapthethings-arduino/blob/master/images/feather-radioWing-rear-web.jpg "image showing rear of a lora radio featherwing")


## Using the code
### Using with platformIO
- Inside the root level directory of your copy of this repo run the following commands:

- ```platformio run``` (to install libraries and build code)
- ```platformio upload``` (to install code on a device)

### Using with Arduino IDE
- Install [Adafruit's Adafruit_BluefruitLE_nRF51 library](https://github.com/adafruit/Adafruit_BluefruitLE_nRF51) Arduino library
- Install [The Things Network New York's version of the IBM LMIC library](https://github.com/things-nyc/arduino-lmic)
- Install [Frank's enhanced Arduino logging library that supports redirection](https://github.com/frankleonrose/Arduino-logging-library)
- Verify and Upload code

## Node Responsibilities
- Advertise capabilities via BLE
- Respond to scan from a BLE Center (the MapTheThings-iOS app)
- Serve LoRa configuration, status, and responses as BLE characteristics
- Accept LoRa configuration and transmission commands as BLE characteristic
- Store device EUI and sequence number in NVRAM

## License
Source code for Map The Things is released under the MIT License,
which can be found in the [LICENSE](LICENSE) file.

{'fraction_non_alphanumeric': 0.11549171918510918, 'fraction_numerical': 0.018760076212809614, 'mean_word_length': 4.677204658901831, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 39, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6041408', 'n_tokens_mistral': 2318, 'n_tokens_neox': 2119, 'n_words': 660}