3 Replies Latest reply on Feb 25, 2014 8:16 AM by Tuan_Bui

    Arduino IDE overwritten wpa_supplicant.conf

    Tuan_Bui

      Is there a way to prevent this behavior? I've already had my wpa_supplicant.conf file configured for both home and work wireless access. But as soon as I run an Arduino sketch that use WiFi.begin(ssid,pass), the wpa_supplicant.conf file got overwritten with a new one with only the information supplied through ssid and pass.

      Any way to get around this behavior?

        • 1. Re: Arduino IDE overwritten wpa_supplicant.conf
          rmm200

          You may not like the easiest way...

          This behavior is defined in WiFi.h and WiFi.cpp. You could either modify WiFi.cpp to not write out wpa_supplicant.conf from WiFi.begin(ssid,pass), which will just use what is there or create a new begin() that takes no parameters and does the same thing. A new member function is less likely to break something else.

          Reading the code is a beneficial exercise anyway. Dreadfully short on comments, but I guess we should be glad for any.

          • 2. Re: Arduino IDE overwritten wpa_supplicant.conf
            Rod_H

            As rmm200 said, as quick work around comment lines 252, 253, and 254 in the file <arduino-1.5.3>\hardware\arduino\x86\libraries\WiFi\WiFi.cpp, actually commenting line 254 should be enough but to be on the safe side the lines should look like this:

             

            //     sprintf(cmd, "wpa_passphrase %s %s  > /etc/wpa_supplicant.conf",

            //          ssid, passphrase);

            //     system(cmd);

            1 of 1 people found this helpful
            • 3. Re: Arduino IDE overwritten wpa_supplicant.conf
              Tuan_Bui

              Thanks to rmm200 and Rod_H.

              You're right, I don't like the workaround. But may do that anyway.