loraFiles.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // 1-channel LoRa Gateway for ESP8266
  2. // Copyright (c) 2016, 2017, 2018, 2019 Maarten Westenberg version for ESP8266
  3. // Version 6.1.0
  4. // Date: 2019-10-20
  5. //
  6. // based on work done by Thomas Telkamp for Raspberry PI 1ch gateway
  7. // and many others.
  8. //
  9. // All rights reserved. This program and the accompanying materials
  10. // are made available under the terms of the MIT License
  11. // which accompanies this distribution, and is available at
  12. // https://opensource.org/licenses/mit-license.php
  13. //
  14. // NO WARRANTY OF ANY KIND IS PROVIDED
  15. //
  16. // Author: Maarten Westenberg (mw12554@hotmail.com)
  17. //
  18. // This file contains a number of compile-time settings that can be set on (=1) or off (=0)
  19. // The disadvantage of compile time is minor compared to the memory gain of not having
  20. // too much code compiled and loaded on your ESP8266.
  21. //
  22. // ----------------------------------------------------------------------------------------
  23. // At this moment there is only one record written to the ESP8266
  24. // filesystem. We can add more info, which makes the gateway even more usable,
  25. // however for large data we should only append to the existing file used.
  26. // This also means we'll have to check for available space so we won't run out of
  27. // storage space to quickly.
  28. // One way would be to use let's say 10 files of each 10000 lines and when full
  29. // delete the first file and start writing on a new one (for example)
  30. //
  31. // Define Pattern debug settings, this allows debugging per
  32. // module rather than per level. See also pdebug.
  33. //
  34. #define P_SCAN 0x01
  35. #define P_CAD 0x02
  36. #define P_RX 0x04
  37. #define P_TX 0x08
  38. #define P_PRE 0x10
  39. #define P_MAIN 0x20
  40. #define P_GUI 0x40
  41. #define P_RADIO 0x80
  42. // Definition of the configuration record that is read at startup and written
  43. // when settings are changed.
  44. struct espGwayConfig {
  45. uint16_t fcnt; // =0 as init value XXX Could be 32 bit in size
  46. uint16_t boots; // Number of restarts made by the gateway after reset
  47. uint16_t resets; // Number of statistics resets
  48. uint16_t views; // Number of sendWebPage() calls
  49. uint16_t wifis; // Number of WiFi Setups
  50. uint16_t reents; // Number of re-entrant interrupt handler calls
  51. uint16_t ntpErr; // Number of UTP requests that failed
  52. uint16_t ntps;
  53. uint32_t ntpErrTime; // Record the time of the last NTP error
  54. uint8_t ch; // index to freqs array, freqs[ifreq]=868100000 default
  55. uint8_t sf; // range from SF7 to SF12
  56. uint8_t debug; // range 0 to 4
  57. uint8_t pdebug; // pattern debug,
  58. uint16_t logFileRec; // Logging File Record number
  59. uint16_t logFileNo; // Logging File Number
  60. uint16_t logFileNum; // Number of log files
  61. bool cad; // is CAD enabled?
  62. bool hop; // Is HOP enabled (Note: default be disabled)
  63. bool isNode; // Is gateway node enabled
  64. bool refresh; // Is WWW browser refresh enabled
  65. bool expert;
  66. String ssid; // SSID of the last connected WiFi Network
  67. String pass; // Password of WiFi network
  68. } gwayConfig;
  69. // Define a log record to be written to the log file
  70. // Keep logfiles SHORT in name! to save memory
  71. #if STAT_LOG == 1
  72. // We do keep admin of logfiles by number
  73. //
  74. //uint32_t logFileNo = 1; // Included in struct espGwayConfig LogFile number
  75. //uint32_t logFileRec = 0; // Number of records in a single logfile
  76. //uint32_t logFileNum = 1; // Number of log files
  77. #define LOGFILEMAX 10
  78. #define LOGFILEREC 100
  79. #endif