|
Post by bonnette on Jun 7, 2017 3:56:17 GMT -8
Hi I need the ability to set a static IP address on the weatherboard. Is there a way to do this ?
Thanks Larry
|
|
|
Post by bonnette on Jun 7, 2017 9:44:10 GMT -8
OK, while I was waiting for a reply I investigated the issue and I have a solution (although it is not the best).
Switchdoc provides all of the code for the 8266 based weather card on "GitHub". I down loaded the code and set up the Arduino IDE so that I could make modifications.
I searched the internet and found that there is 8266 code that specifically lets you make changes to the addressing scheme. It turns out that Switchdoc already has this code built into their weather card. So here is how to take advantage of it.
In the Arduino IDE edit the "SDL_ESO8266_WeatherPlus" file. Scroll down to: //WiFiManager and just before the line "//reset saved settings" add a line: "wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,220), IPAddress(192,168,0,1), IPAddress(255,255,255,0)); "
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wifiManager;
wifiManager.setDebugOutput(true);
wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,220), IPAddress(192,168,0,1), IPAddress(255,255,255,0));
//reset saved settings
//wifiManager.resetSettings();
The red text is the IP address you would like to use. The green text is your gateway and the blue text is your subnet mask.
Write the modified code to your weather card and your card will now use the static address you just configured.
Now, is this a little HACKEY ? Yes... but it works.
What I would like to see is a way to access the address from a web page so I can change it.
I would do it myself but I haven't figured out how Switchdoc presents the web pages to the user. (yet)
Larry
|
|
|
Post by SDL on Jun 7, 2017 14:09:11 GMT -8
Not too hacky! I think you did it right.
BP
|
|