How are you? I always appreciate your advice and guide.
I’m trying to send wifi credentials from web browser to ESP32.
I followed Mini Web Server example provided by Zerynth.
I updated the response web page using form as follows.
str = "<html><body>" str = str + "<h2>WiFi Credentials</h2><p>Enter your local WiFi network credentials in the form below.</p>" str = str + "<form action = '/result' method='POST'>" str = str + "<label for='ssid'>Ssid:</label><br>" str = str + "<input type='text' id='ssid' name='ssid' value=''><br>" str = str + "<label for='password'>Password:</label><br>" str = str + "<input type='text' id='password' name='password' value=''><br><br>" str = str + "<input type='submit' value='Submit'>" str = str + "</form>" str = str + "<p>Click Submit button to send the credentials to the Dtects Pi server.</p>" str = str + "</body><html>"
When I typed the server IP on web browser, the following page appears.
What I want right now is to get SSID and password entered in the form in Zerynth code.
When I click “submit” button, how can I get the them in the code? Or is it not possible to implement it using a TCP socket like in mini web server example? I think I need to make APIs for get and post requests, but I’m not sure how to do that in Zerynth.
My final goal is to send wifi credentials to ESP32 working as an AP using pc or phone web browser. Google has many similar illustrative codes and applications that use ArduinoIDE or microPython. However, I want to implement it in Zerynth.
Could you please let me know the best solution for it? I want you to provide similar cases or guidelines to do that.
Thanks in advance.