An ESP32-based Redis-watcher and info-displayer https://rpjios.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

  1. #ifndef __ZW_PROVISION__H__
  2. #define __ZW_PROVISION__H__
  3. #include <EEPROM.h>
  4. // provisioning definitions
  5. #define ZEROWATCH_PROVISIONING_MODE 0
  6. #if ZEROWATCH_PROVISIONING_MODE
  7. #define ZEROWATCH_PROVISIONING_OPTION_FUNCTIONAL_VERIFICATION 1
  8. #define ZEROWATCH_PROVISIONING_OPTION_REGISTER_DEVICE 1
  9. #if ZEROWATCH_PROVISIONING_OPTION_FUNCTIONAL_VERIFICATION && \
  10. ZEROWATCH_PROVISIONING_OPTION_REGISTER_DEVICE
  11. #define ZWPROV_FUNCTIONAL_VERIFICATION_REGISTRY_DEVICE_IN "rpjios.__meta.hostreg"
  12. #else
  13. #define ZWPROV_FUNCTIONAL_VERIFICATION_REGISTRY_DEVICE_IN NULL
  14. #endif
  15. // these will be written to EEPROM
  16. #define ZWPROV_HOSTNAME ""
  17. #define ZWPROV_WIFI_SSID ""
  18. #define ZWPROV_WIFI_PASSWORD ""
  19. #define ZWPROV_REDIS_HOST ""
  20. #define ZWPROV_REDIS_PASSWORD ""
  21. #define ZWPROV_REDIS_PORT 6379
  22. #define ZWPROV_OTA_HOST ""
  23. #endif
  24. #define ZW_EEPROM_SIZE 32
  25. #define ZW_EEPROM_HOSTNAME_ADDR 0
  26. #define CFG_EEPROM_SIZE 3192
  27. #define CFG_EEPROM_ADDR ZW_EEPROM_SIZE
  28. #define EEPROM_SIZE ZW_EEPROM_SIZE + CFG_EEPROM_SIZE
  29. #define ZWPROV_MODE_WRITE_DELAY 30
  30. // dangerous!
  31. #define ZEROWATCH_DEL_PROVISIONS 0
  32. extern char *EEPROMCFG_WiFiSSID;
  33. extern char *EEPROMCFG_WiFiPass;
  34. extern char *EEPROMCFG_RedisHost;
  35. extern char *EEPROMCFG_RedisPass;
  36. extern char *EEPROMCFG_OTAHost;
  37. extern uint16_t EEPROMCFG_RedisPort;
  38. extern String gHostname;
  39. void verifyProvisioning();
  40. #endif