Go Down

Topic: configuting wifi via serial monitor(ssid and password) (Read 35 times) previous topic - next topic


So, i'm using NodeMCU v1.0, and i wonder if i can change the SSID of the wifi via serial monitor..
I was expecting this similar output from serial monitor :

Code: [Select]
Input your SSID
Input your Password
Configure complete

This is what i'e tried so far, using different source
Code: [Select]

#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
SoftwareSerial BTserial(13, 15); // RX, TX

String ssid = "indeed"; //nama SSID
String password = "11111111";
void(* resetFunc) (void) = 0;
int x = 0;
int counter = 1;
const long baudRate = 9600;
boolean NL = true;
void setup()
  WiFi.softAP(ssid, password);
void loop()
  while (x < 1)
  String s1 = Serial.readString();// s1 is String type variable.
  Serial.print("Received Data => ");
  Serial.println(s1);//display same received Data back in serial monitor.
  if (BTserial.available())
    String b = BTserial.readString();

    if (b.indexOf("reboot") >= 0)
      x = 0;
      goto awal;
    else if (b.indexOf("ping") >= 0)
    else if (b.indexOf("ssid") >=0)//this is what i've tried changing ssid
      ssid = b;
// i seriously have no idea about Wifi and stuff

i hope it's clear enough..
if it's not i will reply ASAP
Thank you


Code: [Select]
     goto awal;

setup() is where the set up is done. Keep the loop for what needs to happen all the time.

I would suggest to study Serial Input Basics to handle this
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

Go Up