user_config.h 1.7 KB

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