0
votes

I am using Arduino UNO and ESP8266 Wifi Module for reading sensor data. I have selected board as "Arduino/Genuino UNO" and using AT command to communicate with ESP8266. My code run very well.

However, how do I avoid hardcoding SSID and Password in my sketch?

I checked WiFi Manager (WiFiManager.h) library but it seems this library is used when ESP8266 is used as primary board. (I used WiFiManager.h and when compiled it asked for "ESP8266WiFi.h". Then I downloaded "SerialESP8266wifi.h" (it seems the "ESP8266WiFi.h" has changed to "SerialESP8266wifi.h"). When compiled, it asked for "ESP8266WebServer.h". After searching online, it seems this ESP8266WebServer.h library is used when using ESP8266 as board (not on a standard Arduino board communicating with an ESP8266 via serial).

Please help. Any way I can make WiFi Manager working when Arduino is selected as primary board?

1

1 Answers

1
votes

You're really posing at least two separate questions here, and I can help you right away with one...

Just write the SSID and password to EEPROM using a different sketch, and then in your working sketch, merely read the values from EEPROM in setup(). That would at least let you publish your software safely. Now, if someone gets hands on your board, of course they can read the EEPROM. But at least these values won't be in plain text or cipher text in your sketch.