user_config.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 STA_SSID_1 "SSID"
  9. #define STA_PASS_1 "PASS"
  10. #define STA_PASS_2 "SSID"
  11. #define STA_SSID_2 "PASS"
  12. #define MAX_APS 5 // number of stored Wi-Fi accesspoint credientials (1 - 5)
  13. #define STORED_APS 1;
  14. /* MQTT DEFAULT CONFIGURATIONS */
  15. #define MQTT_HOST "192.168.0.101" //or "mqtt.yourdomain.com"
  16. #define MQTT_PORT 1883
  17. #define MQTT_BUF_SIZE 1024
  18. #define QUEUE_BUFFER_SIZE 2048
  19. #define MQTT_RECONNECT_TIMEOUT 5 /*second*/
  20. #define DEFAULT_SECURITY 0
  21. #define PROTOCOL_NAMEv31 //MQTT version 3.1 compatible with Mosquitto v0.15
  22. //PROTOCOL_NAMEv311 //MQTT version 3.11 compatible with https://eclipse.org/paho/clients/testing/
  23. #define MQTT_SSL_ENABLE
  24. #define MQTT_CLIENT_ID "CLIENT_1234"
  25. #define MQTT_USER "USER"
  26. #define MQTT_PASS "PASS"
  27. #define MQTT_CLEAN_SESSION 1
  28. /* OTA SETTINGS */
  29. #define OTA_HOST "fphx.duckdns.org"
  30. #define OTA_PORT 2000
  31. #define OTA_ROM0 "rom0.bin"
  32. #define OTA_ROM1 "rom1.bin"
  33. // OTA_FILE is not required, but is part of the example
  34. // code for writing arbitrary files to flash
  35. #define OTA_FILE "file.bin"
  36. // general http header
  37. #define HTTP_HEADER "Connection: keep-alive\r\n\
  38. Cache-Control: no-cache\r\n\
  39. User-Agent: rBoot-Sample/1.0\r\n\
  40. Accept: */*\r\n\r\n"
  41. // timeout for the initial connect and each recv (in ms)
  42. #define OTA_NETWORK_TIMEOUT 10000
  43. // This needs to be changed to support a logging library
  44. #if defined(DEBUG_ON)
  45. #define INFO( format, ... ) os_printf( format, ## __VA_ARGS__ )
  46. #else
  47. #define INFO( format, ... )
  48. #endif
  49. #endif