Menu

Displaying the alternate SSID on the text or graphic display

Ray Owen
2022-11-18
2022-11-23
  • Ray Owen

    Ray Owen - 2022-11-18

    I recently updated mySQM+ device (built around a Wemos R32) to v132. I routinely switch between a home wifi network and a portable access point built into my OnStep controller, and noticed that while the SQM easily shifts between both networks on startup, the page 5 display always shows mySSID (the default network) and never mySSID_1 (the alternate network), even when the alternate is in use.

    After reviewing the code, I made a few small modifications to mysqmplusf_132.ino, display_graphic.cpp, and display_text.cpp. This is to define a new integer variable "mySSIDused", which is set to 0 if mySSID is the network in use, and set to 1 if mySSID_1 is the network in use. When the graphic or text display is generated, mySSID or mySSID_1 is displayed based on this variable.

    I have attached the three files with these mods. I'm sure to have neglected some coding standards, but wanted to provide the code in the hope that this functionality could be integrated into a future release.

    Thanks!

     
    • brownrb

      brownrb - 2022-11-23

      Hi Ray
      Thanks for the code. I have taken a slightly different approcach which I had used in the new myFP2ESP32 code base, where only 1 change is necessary in one file.

      This is in the upcoming release 133 which is not yet released for testing (it is waiting on the remote esp32db example code which is nearly done).

      This is the snippet of code I am talking about

          // check if connected after using first set of credentials - if not connected try second pair of credentials
          if (WiFi.status() != WL_CONNECTED) {
            // try again with 2nd set of credentials then reboot after 10 failed attempts to log on
            // the 2nd pair of credentials and reboot after 10 unsuccessful attempts to log on
            memset( mySSID, 0, 64);
            memset( myPASSWORD, 0, 64);
            memcpy( mySSID, mySSID_1, (sizeof(mySSID_1) / sizeof(mySSID_1[0]) ));
            memcpy( myPASSWORD, myPASSWORD_1, (sizeof(myPASSWORD_1) / sizeof(myPASSWORD_1[0])) );
            // attempt to start the WiFi with 2nd set alternative credentials
            WiFi.begin(mySSID, myPASSWORD);
            WiFi.setSleep(false);
      

      In no way does this detract from your code, and I am grateful that you took the time to post it here so that it can assist others. Thanks, it is very much appreciated, and I am sure that it will be taken up by others.

      If you would like to be on the test team drop me an email on gmail.

      Regards
      Robert

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.