user_config.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __USER_CONFIG_H__
  2. #define __USER_CONFIG_H__
  3. #define USE_OPTIMIZE_PRINTF
  4. /* FLASH CONFIGURATION SETTINGS */
  5. #define CFG_HOLDER 0x4171134
  6. #define CFG_LOCATION 0x2 // this needs to be relocated to end of flash
  7. /* DEFAULT Wi-Fi SETTINGS */
  8. #define WIFI_TIMEOUT 30000
  9. #define MAX_APS 5 // number of stored Wi-Fi accesspoint credientials (1 - 5)
  10. #define STORED_APS 1
  11. /* MQTT DEFAULT CONFIGURATIONS */
  12. #define MQTT_HOST_DEFAULT "ideasx-cloud.duckdns.org" //or "mqtt.yourdomain.com"
  13. #define MQTT_PORT_DEFAULT 1883
  14. #define MQTT_BUF_SIZE 1024
  15. #define MQTT_KEEPALIVE_DEFAULT 20 // seconds
  16. #define MQTT_CLEAN_SESSION 1
  17. #define QUEUE_BUFFER_SIZE 2048
  18. #define MQTT_RECONNECT_TIMEOUT 5 // seconds
  19. #define DEFAULT_SECURITY 0
  20. //#define PROTOCOL_NAMEv31
  21. #define PROTOCOL_NAMEv311
  22. //#define MQTT_SSL_ENABLE
  23. //#define MQTT_USER_DEFAULT "USER"
  24. //#define MQTT_PASS_DEFAULT "PASS"
  25. /* OTA SETTINGS */
  26. #define OTA_HOST_DEFAULT "fphx.duckdns.org"
  27. #define OTA_PORT_DEFAULT 2000
  28. #define OTA_ROM0 "rom0.bin"
  29. #define OTA_ROM1 "rom1.bin"
  30. #define OTA_FILE "file.bin"
  31. #define HTTP_HEADER "Connection: keep-alive\r\n\
  32. Cache-Control: no-cache\r\n\
  33. User-Agent: rBoot-Sample/1.0\r\n\
  34. Accept: */*\r\n\r\n"
  35. #define OTA_NETWORK_TIMEOUT 10000 // ms
  36. #define BATTERY_CHECK_INTERVAL 600000
  37. // This needs to be changed to support a logging library
  38. #if defined(DEBUG_ON)
  39. #define INFO( format, ... ) os_printf( format, ## __VA_ARGS__ )
  40. #else
  41. #define INFO( format, ... )
  42. #endif
  43. #endif