marquee-scroller icon indicating copy to clipboard operation
marquee-scroller copied to clipboard

Suggested code add ins for if IP is not known

Open mickeypop opened this issue 5 years ago • 0 comments

to address 2 minor issues both solve if you don't know the IP, you cant get in to the web page 1 - show IP to get web access 2 - since the config file got corrupted once this clears it for updating

added to marquee.ino

--- at line 40 above #useful macros #define SHOW_IP_BUTTON D4 // pair will show IP on button press int ipBtnStat = HIGH;

#define ClearConfigPin D3 // clear corrupted config, // best to hide this button from accidental use int ClearConfig = HIGH;

--- at begining of loop() // show IP on button press ipBtnStat = digitalRead( SHOW_IP_BUTTON); if( ipBtnStat == LOW ) { // Serial.println( "\n\n\tSHOW_IP_BUTTON pressed to show IP\n" ); scrollMessage( " IP: " + WiFi.localIP().toString() ); }

// best to make this button hard to get to preventing accidental use ClearConfig = digitalRead( ClearConfigPin ); if( ClearConfig == LOW ) { SPIFFS.remove(CONFIG); scrollMessage( "Config Cleared " ); }

--- in setup() just before // Initialize digital pin for LED
pinMode( SHOW_IP_BUTTON, INPUT_PULLUP ); pinMode( ClearConfigPin, INPUT_PULLUP );

mickeypop avatar Jul 31 '20 22:07 mickeypop