2018-04-19 15:17:23 +02:00
|
|
|
// ----- Paxcounter user config file ------
|
|
|
|
//
|
|
|
|
// --> adapt to your needs and use case <--
|
2018-06-16 20:25:49 +02:00
|
|
|
//
|
|
|
|
// Note: After editing, before "build", use "clean" button in PlatformIO!
|
2018-04-19 15:17:23 +02:00
|
|
|
|
2018-09-17 17:23:02 +02:00
|
|
|
#define PRODUCTNAME "PAXCNT"
|
|
|
|
|
2018-04-19 15:17:23 +02:00
|
|
|
// Verbose enables serial output
|
|
|
|
#define VERBOSE 1 // comment out to silence the device, for mute use build option
|
|
|
|
|
2018-07-21 17:14:27 +02:00
|
|
|
// Payload send cycle and encoding
|
2018-07-22 20:27:58 +02:00
|
|
|
#define SEND_SECS 30 // payload send cycle [seconds/2] -> 60 sec.
|
2018-11-27 11:21:20 +01:00
|
|
|
#define PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed
|
2018-07-21 17:14:27 +02:00
|
|
|
|
|
|
|
// Set this to include BLE counting and vendor filter functions
|
2018-08-04 18:29:44 +02:00
|
|
|
#define VENDORFILTER 1 // comment out if you want to count things, not people
|
2018-12-09 13:48:03 +01:00
|
|
|
#define BLECOUNTER 1 // activate if you want to use BLE count, at expense of memory
|
2018-04-19 15:17:23 +02:00
|
|
|
|
|
|
|
// BLE scan parameters
|
2018-05-19 16:55:18 +02:00
|
|
|
#define BLESCANTIME 0 // [seconds] scan duration, 0 means infinite [default], see note below
|
2018-05-20 21:21:47 +02:00
|
|
|
#define BLESCANWINDOW 80 // [milliseconds] scan window, see below, 3 .. 10240, default 80ms
|
|
|
|
#define BLESCANINTERVAL 80 // [illiseconds] scan interval, see below, 3 .. 10240, default 80ms = 100% duty cycle
|
2018-04-19 15:17:23 +02:00
|
|
|
|
|
|
|
/* Note: guide for setting bluetooth parameters
|
|
|
|
*
|
2018-05-19 16:55:18 +02:00
|
|
|
* |< Scan Window > |< Scan Window > | ... |< Scan Window > |
|
|
|
|
* |< Scan Interval >|< Scan Interval >| ... |< Scan Interval >|
|
|
|
|
* |< Scan duration >|
|
2018-04-19 15:17:23 +02:00
|
|
|
*
|
2018-05-19 16:55:18 +02:00
|
|
|
* Scan duration sets how long scanning should be going on, before starting a new scan cycle. 0 means infinite (default).
|
|
|
|
* Scan window sets how much of the interval should be occupied by scanning. Should be >= BLESCANINTERVAL.
|
2018-04-19 15:17:23 +02:00
|
|
|
* Scan interval is how long scanning should be done on each channel. BLE uses 3 channels for advertising.
|
|
|
|
* -> Adjust these values with power consumption in mind if power is limited.
|
2018-05-20 13:50:00 +02:00
|
|
|
* -> Scan interval can be changed during runtime by remote comammand.
|
2018-04-19 15:17:23 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
// WiFi scan parameters
|
|
|
|
#define WIFI_CHANNEL_MIN 1 // start channel number where scan begings
|
|
|
|
#define WIFI_CHANNEL_MAX 13 // total channel number to scan
|
|
|
|
#define WIFI_MY_COUNTRY "EU" // select locale for Wifi RF settings
|
|
|
|
#define WIFI_CHANNEL_SWITCH_INTERVAL 50 // [seconds/100] -> 0,5 sec.
|
|
|
|
|
2018-07-14 19:12:20 +02:00
|
|
|
// LoRa payload default parameters
|
2018-04-28 14:33:27 +02:00
|
|
|
#define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle
|
2018-06-08 22:41:37 +02:00
|
|
|
#define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results
|
2018-06-16 19:50:36 +02:00
|
|
|
#define PAYLOAD_BUFFER_SIZE 51 // maximum size of payload block per transmit
|
2018-04-19 15:17:23 +02:00
|
|
|
#define LORASFDEFAULT 9 // 7 ... 12 SF, according to LoRaWAN specs
|
|
|
|
#define MAXLORARETRY 500 // maximum count of TX retries if LoRa busy
|
2019-02-03 14:12:21 +01:00
|
|
|
#define SEND_QUEUE_SIZE 10 // maximum number of messages in payload send queue [1 = no queue]
|
2018-07-15 19:08:18 +02:00
|
|
|
|
|
|
|
// Ports on which the device sends and listenes on LoRaWAN and SPI
|
2018-07-21 18:25:03 +02:00
|
|
|
#define COUNTERPORT 1 // Port on which device sends counts
|
2018-07-15 19:08:18 +02:00
|
|
|
#define RCMDPORT 2 // Port on which device listenes for remote commands
|
|
|
|
#define STATUSPORT 2 // Port on which device sends remote command results
|
2018-10-16 08:48:09 +02:00
|
|
|
#define CONFIGPORT 3 // Port on which device sends config query results
|
2018-11-27 11:21:20 +01:00
|
|
|
#define GPSPORT 4 // Port on which device sends gps data
|
2018-07-21 18:25:03 +02:00
|
|
|
#define BUTTONPORT 5 // Port on which device sends button pressed signal
|
2018-07-22 18:13:21 +02:00
|
|
|
#define LPP1PORT 1 // Port for Cayenne LPP 1.0 dynamic sensor encoding
|
|
|
|
#define LPP2PORT 2 // Port for Cayenne LPP 2.0 packed sensor encoding
|
2018-07-24 18:44:13 +02:00
|
|
|
#define BEACONPORT 6 // Port on which device sends beacon alarms
|
2018-11-17 18:30:19 +01:00
|
|
|
#define BMEPORT 7 // Port on which device sends BME680 sensor data
|
2018-11-27 11:21:20 +01:00
|
|
|
#define BATTPORT 8 // Port on which device sends battery voltage data
|
2018-11-20 15:02:37 +01:00
|
|
|
#define SENSOR1PORT 10 // Port on which device sends User sensor #1 data
|
|
|
|
#define SENSOR2PORT 11 // Port on which device sends User sensor #2 data
|
|
|
|
#define SENSOR3PORT 12 // Port on which device sends User sensor #3 data
|
2018-04-19 15:17:23 +02:00
|
|
|
|
2018-07-22 11:08:55 +02:00
|
|
|
// Some hardware settings
|
|
|
|
#define RGBLUMINOSITY 30 // RGB LED luminosity [default = 30%]
|
|
|
|
#define DISPLAYREFRESH_MS 40 // OLED refresh cycle in ms [default = 40] -> 1000/40 = 25 frames per second
|
2018-07-25 00:17:31 +02:00
|
|
|
#define HOMECYCLE 30 // house keeping cycle in seconds [default = 30 secs]
|
2018-04-19 15:17:23 +02:00
|
|
|
|
2018-11-26 16:12:41 +01:00
|
|
|
// Settings for BME680 environmental sensor (if present)
|
|
|
|
#define BME_TEMP_OFFSET 5.0f // Offset sensor on chip temp <-> ambient temp [default = 5°C]
|
2018-12-31 11:26:05 +01:00
|
|
|
#define STATE_SAVE_PERIOD UINT32_C(360 * 60 * 1000) // update every 360 minutes = 4 times a day
|
2018-11-26 16:12:41 +01:00
|
|
|
|
2018-09-16 12:18:11 +02:00
|
|
|
// OTA settings
|
2018-12-02 14:08:50 +01:00
|
|
|
#define USE_OTA 1 // Comment out to disable OTA update
|
2018-11-04 15:12:39 +01:00
|
|
|
#define WIFI_MAX_TRY 5 // maximum number of wifi connect attempts for OTA update [default = 20]
|
2018-11-05 00:03:47 +01:00
|
|
|
#define OTA_MAX_TRY 5 // maximum number of attempts for OTA download and write to flash [default = 3]
|
2018-11-05 21:40:07 +01:00
|
|
|
#define OTA_MIN_BATT 3600 // minimum battery level for OTA [millivolt]
|
2018-11-05 13:13:31 +01:00
|
|
|
#define RESPONSE_TIMEOUT_MS 60000 // firmware binary server connection timeout [milliseconds]
|
2018-09-16 12:18:11 +02:00
|
|
|
|
2019-01-27 18:19:25 +01:00
|
|
|
// settings for syncing time of node and external time sources
|
2019-02-21 23:17:01 +01:00
|
|
|
#define TIME_SYNC_INTERVAL 10 // sync time each .. minutes from external time source (GPS/LORA) [default = 10], comment out means off
|
|
|
|
#define TIME_SYNC_TIMEOUT 30 // fallback to rtc for timesync after .. minutes no sync with external time source
|
|
|
|
//#define TIME_SYNC_LORA 1 // use LORA network for timesync, comment out means off [default = off]
|
2019-01-28 23:59:52 +01:00
|
|
|
|
2019-01-28 00:38:31 +01:00
|
|
|
// time zone, see https://github.com/JChristensen/Timezone/blob/master/examples/WorldClock/WorldClock.ino
|
|
|
|
#define DAYLIGHT_TIME {"CEST", Last, Sun, Mar, 2, 120} // Central European Summer Time
|
|
|
|
#define STANDARD_TIME {"CET ", Last, Sun, Oct, 3, 60} // Central European Standard Time
|
2018-11-16 09:43:47 +01:00
|
|
|
|
2018-04-19 15:17:23 +02:00
|
|
|
// LMIC settings
|
2019-01-27 18:19:25 +01:00
|
|
|
// moved to src/lmic_config.h
|