I’m trying to display SSID on my webapp using WiFi.SSID(); but am getting strange characters: A tall hexigon with a question mark inside and a capital “Z”. I suspect this is a datatype issue. I am able to pass a string to my webapp and display it properly. I am also able print the SSID successfully to a terminal over serial. But when I try to pass the SSID value to my web app I get the strange characters. I found in the reference material that WiFi.SSID(); returns a char* datatype and have been trying to convert that to a string before passing it to my webapp but nothing has worked. I found a post on this forum very specific to converting char* to string but couldn’t make it work. Here are snippets of my code that pertain without the datatype conversion attempts.
String SSID = “None”;
void setup() {
Spark.variable(“SSID”, SSID, STRING);
void loop() {
SSID = WiFi.SSID(); // WiFi SSID of connected network
If i print SSID over serial I see the correct value but I figure maybe the print function doesn’t care about the datatype where as maybe the Spark.variable function does.
Anyone see anything obvious I am doing wrong.