Skip to main content
added 395 characters in body
Source Link
Juraj
  • 18.2k
  • 4
  • 30
  • 49

ItProblem is simplethat you set to toCharArray the length of the String. You copyBut the newlinesecond parameter is the maximum allowed length of the output and there is then no space for the terminating zero and string is cut at last character.

The function toCharArray knows the size of the String. The second parameter should be the size of the char array buffer_ssid.toCharArray(ssid, sizeof(ssid));

And next problem could be that you copy the CR/LF characters from input into ssid and paasswordpassword. You can see it in debug printouts.

It is simple. You copy the newline character from input into ssid and paassword. You can see it in debug printouts.

Problem is that you set to toCharArray the length of the String. But the second parameter is the maximum allowed length of the output and there is then no space for the terminating zero and string is cut at last character.

The function toCharArray knows the size of the String. The second parameter should be the size of the char array buffer_ssid.toCharArray(ssid, sizeof(ssid));

And next problem could be that you copy the CR/LF characters from input into ssid and password. You can see it in debug printouts.

Source Link
Juraj
  • 18.2k
  • 4
  • 30
  • 49

It is simple. You copy the newline character from input into ssid and paassword. You can see it in debug printouts.