washcroft / HttpGarageDoorController

A project for an Arduino based WiFi-enabled controller, IoT/M2M enabling an ordinary garage door operator.
MIT License
11 stars 4 forks source link

Error compiling - Secret.h #2

Closed jeylites closed 6 years ago

jeylites commented 6 years ago

Is my secret.h file correct?

Secret.h

const char WIFI_SSID[] = "HELLO"; const char WIFI_PASSWORD[] = "12345678"; const char OTA_UPDATER_PASSWORD[] = "12345678";

const char HTTP_SERVER_APIKEY_HEADER[] = "12345678";

const char HTTP_SERVER_OAUTH_CONSUMER_KEY[] = "HELLO"; const char HTTP_SERVER_OAUTH_CONSUMER_SECRET[] = "ROUTER";

ERROR MESSAGE `Arduino: 1.8.3 (Mac OS X), Board: "Generic ESP8266 Module, Serial, 80 MHz, 40MHz, DOUT, 115200, 1M (no SPIFFS), ck, Disabled, None"

In file included from sketch/GarageDoorController.h:14:0, from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:46: secret.h:1: error: redefinition of 'const char WIFI_SSID []' const char WIFI_SSID[] = "HELLO"; ^ In file included from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:44:0: secret.h:1: error: 'const char WIFI_SSID [6]' previously defined here const char WIFI_SSID[] = "HELLO"; ^ In file included from sketch/GarageDoorController.h:14:0, from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:46: secret.h:2: error: redefinition of 'const char WIFI_PASSWORD []' const char WIFI_PASSWORD[] = "12345678"; ^ In file included from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:44:0: secret.h:2: error: 'const char WIFI_PASSWORD [9]' previously defined here const char WIFI_PASSWORD[] = "12345678"; ^ In file included from sketch/GarageDoorController.h:14:0, from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:46: secret.h:3: error: redefinition of 'const char OTA_UPDATER_PASSWORD []' const char OTA_UPDATER_PASSWORD[] = "12345678"; ^ In file included from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:44:0: secret.h:3: error: 'const char OTA_UPDATER_PASSWORD [9]' previously defined here const char OTA_UPDATER_PASSWORD[] = "12345678"; ^ In file included from sketch/GarageDoorController.h:14:0, from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:46: secret.h:5: error: redefinition of 'const char HTTP_SERVER_APIKEY_HEADER []' const char HTTP_SERVER_APIKEY_HEADER[] = "12345678"; ^ In file included from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:44:0: secret.h:5: error: 'const char HTTP_SERVER_APIKEY_HEADER [9]' previously defined here const char HTTP_SERVER_APIKEY_HEADER[] = "12345678"; ^ In file included from sketch/GarageDoorController.h:14:0, from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:46: secret.h:7: error: redefinition of 'const char HTTP_SERVER_OAUTH_CONSUMER_KEY []' const char HTTP_SERVER_OAUTH_CONSUMER_KEY[] = "HELLO"; ^ In file included from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:44:0: secret.h:7: error: 'const char HTTP_SERVER_OAUTH_CONSUMER_KEY [6]' previously defined here const char HTTP_SERVER_OAUTH_CONSUMER_KEY[] = "HELLO"; ^ In file included from sketch/GarageDoorController.h:14:0, from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:46: secret.h:8: error: redefinition of 'const char HTTP_SERVER_OAUTH_CONSUMER_SECRET []' const char HTTP_SERVER_OAUTH_CONSUMER_SECRET[] = "ROUTER"; ^ In file included from /Users/J/Documents/Arduino/Portable/HttpGarageDoorController/HttpGarageDoorController.ino:44:0: secret.h:8: error: 'const char HTTP_SERVER_OAUTH_CONSUMER_SECRET [7]' previously defined here const char HTTP_SERVER_OAUTH_CONSUMER_SECRET[] = "ROUTER"; ^ exit status 1 redefinition of 'const char WIFI_SSID []'

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. `

washcroft commented 6 years ago

This was caused by the secret.h file being included twice within the project, this is now fixed.

jeylites commented 6 years ago

Will test it again. Thank you :)