hi can someone please help im trying to connect my mkr 1010 to the wifi and just for the moment im trying to display hello in the serial monitor but i keep on getting an endless list of it trying to connect to my wifi and im not sure why . #include <ArduinoHttpClient.h>
#include <WiFiNINA.h>
#include "arduino_secrets.h"
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
char serverAddress[] = "echo.websocket.org";
int port = 80;
WiFiClient wifi;
WebSocketClient client = WebSocketClient(wifi, serverAddress,port);
int status = WL_IDLE_STATUS;
int count = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while( status != WL_CONNECTED){
Serial.print("Attempting to connect to Network named: ");
Serial.println(ssid);
status = WiFi.begin(ssid,pass);
}
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("starting WebSocket client");
client.begin();
while(client.connected()){
Serial.print("Sending hello");
Serial.println(count);
client.beginMessage(TYPE_TEXT);
client.print("hello");
client.print(count);
client.endMessage();
count++;
int messageSiz e = client.parseMessage();
if(messageSize > 0){
Serial.println("Received a message:");
}
}
} (edited)
[7:10 PM]
and this is my arduino_secrets.h file with my wifis name and password #define SECRET_SSID "AndroidHotspot2652"
#define SECRET_PASS "12345667"