Ask the User for wifi name/pass

Posted on
  • Sorry if this is so obvious but I'm new to Espruino and i can seem to find a solution, Lets say that i want to control some led's from my phone. Following this tutorial­+UI
    I was able to make a the led change the intensity by changing the value in the tutorial. My question is regarding the wifi name/pass. I set it up in code and upload it to the board as shown in the tutorial, But that's not very user friendly. Is there a way to have the webpage either on the phone or computer ask for the wifi name and password stead of hard coding it?


  • @gl5, do not exactly understand what you are looking for... It all depends on your setup. From the example I take that you use your local / home Wifi network and that's where your Espruiono hooks onto and you also connect with you computer/tabled or phone to that Wifi network, from which Espruino Wifi connection gets its ip, the ip you have to enter into the browser on your computer /tablet or phone.

    You could go in a different way and start Espruino as access point first with its own SSID and password - like another Wifi network - its own. After connecting with your your computer /tablet or phone to that Espruino Wifi network, you would serve a (secure - SSL) page that asks for a the SSID and password of you home network, and Espruino would then stop its access point and connect to your local / home Wifi network - as it does now. If user id and password would fail, Espruino would return back as access point with its own SSID and password and you would have to start over.

    One challenge though still remains: you have to have Espruino's IP address so you can connect... (you can look it up on your modem/router). Since the IP address may change - it is DHCP after all - you may give your Wifi node a host name, and you would connect with that name instead of the IP - see­fi_setHostname

  • I will try the Access point route.


  • Check this thread out, I believe this user formalised some code for exactly this and shared it­285086/#comment13000674

  • @Ollie, thanks for catching... great implementation, @Will. - That conversation slipped my watching eyes... or factual: ...sleepy eyes. :/

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Ask the User for wifi name/pass

Posted by Avatar for gl5 @gl5