2019-06-12 19:18:37 +00:00
# pragma once
2019-06-24 13:27:22 +00:00
# include <lmic.h>
# include <hal/hal.h>
# include <SPI.h>
# include "settings.custom.h"
/*
* This is the main settings file - customise it to match your setup .
2019-06-24 13:47:14 +00:00
* Don ' t forget that you need to take a copy of settings . custom . cpp . example as
* settings . custom . cpp , and fill in the private keys the program needs to talk
2019-06-24 13:27:22 +00:00
* over LORaWAN .
*/
2019-06-24 12:52:33 +00:00
2019-06-12 19:18:37 +00:00
//////////////////////////////////
////////////// Main //////////////
//////////////////////////////////
// The speed at which we should talk over our main hardware serial connection.
2019-06-20 11:23:09 +00:00
# define BAUD_PC 115200
2019-06-12 19:18:37 +00:00
2019-06-24 12:52:33 +00:00
// Multiple devices can use the same SPI data pin AFAIKT, but some libraries
// *cough* SD *cough* are too stupid to figure out which pin it is on their own.
2019-06-20 11:23:09 +00:00
# define PIN_SPI_DATA 9
2019-06-24 12:52:33 +00:00
// The 'done' pin to pulse to signal to the TPL5111
2019-07-08 13:48:09 +00:00
# define PIN_TPL_DONE A0
2019-06-12 19:18:37 +00:00
2019-06-28 13:02:44 +00:00
// Uncomment to print RAM diagnostics at regular intervals.
//#define ENABLE_MEMORY_DIAGNOSTICS
2019-06-24 12:52:33 +00:00
/////////////
/// RFM95 ///
/////////////
2019-06-26 14:46:07 +00:00
// Whether to actually enable LMIC-based transmission or not.
# define ENABLE_RADIO
2019-06-24 13:27:22 +00:00
// The SPI chip-select pin for the RFM 95
# define PIN_SPI_CS_RFM95 10
2019-06-24 13:47:14 +00:00
// Pin mapping - see settings.custom.cpp
2019-06-24 12:52:33 +00:00
2019-06-12 19:18:37 +00:00
/////////////////////////////////
////////////// GPS //////////////
/////////////////////////////////
// The *TX* gin of the GPS device.
2019-06-24 12:52:33 +00:00
// This is swapped because we receive the GPS device's message on our side on
// the RX pin, and the GPS device transmits messages on the TX.
2019-06-13 14:10:12 +00:00
# define PIN_GPS_RX 5
2019-06-12 19:18:37 +00:00
// The *RX* pin on the GPS device.
2019-07-15 14:25:51 +00:00
// This is swapped because where the GPS device is receiving, we aresending and
2019-06-24 12:52:33 +00:00
// vice versa.
2019-06-12 19:18:37 +00:00
// The TX / RX here are according to *our* side, not the GPS device's side.
2019-06-13 14:10:12 +00:00
# define PIN_GPS_TX 4
2019-06-24 12:52:33 +00:00
// The speed at which we should talk to the GPS device. Some GPS devices
// require a certain speed in order to use certain commands, so it's important
// that you check the datasheets for the device you're using.
2019-06-12 19:18:37 +00:00
// 9600 is the correct speed for a NEO-6M.
# define BAUD_GPS 9600
2019-07-15 14:25:51 +00:00
// Uncomment to cause the system to check the newest GPS value against the last one, and only transmit a reading if they differ by more than (0.0003, 0.0002) - ~(20m, 14m).
// Unhelpful for debugging, but useful in production to reduce the number of messages sent when stationary.
# define GPS_DELTA_CHECK
# define GPS_DELTA_MIN_LAT 0.0003
# define GPS_DELTA_MIN_LNG 0.0002
2019-06-12 19:18:37 +00:00
//////////////////////////////////
////////// microSD Card //////////
//////////////////////////////////
2019-06-13 13:13:03 +00:00
// The chip select pin that activates the connection to the microSD card over SPI.
2019-06-24 12:52:33 +00:00
# define PIN_SPI_CS_SD 3
2019-06-13 13:13:03 +00:00
2019-06-20 12:56:08 +00:00
// The filename on the microSD card to store data in.
2019-07-11 12:17:01 +00:00
# define SD_FILENAME "DATA.TSV"
2019-06-26 14:46:07 +00:00
// Whether to write debug information to the filename below. This could compromise privacy, so it should be commented out for production.
2019-06-28 13:04:21 +00:00
// #define SD_DEBUG_ENABLED
2019-06-20 12:56:08 +00:00
// The filename on the microSD card to store debug information in
2019-07-11 12:17:01 +00:00
# define SD_FILENAME_DEBUG "DEBUG.LOG"