Hi everybody,
I am trying to make bidirectionnal wifi communication between two MKR1000. One MKR1000 creates the wifi network and the server and the other MKR1000 is a client. The two MKR have ATSAMW25... atmel wifi module and its firmware are 19.4.4 version (I read there that the latest firmware for this module is 19.4.4 and not 19.5.2, is it true?).
I am able to send data from the "Client" MKR to the "Server" MKR like it is shown in all WIFI101 examples but I never saw how to send data to ALL clients (using server.print("") ).
My problem is that i don't know how to send data from the "Server" MKR to the server or, how to read data from the server to the "Client" MKR. My code below shows you my two functions for reading and sending.
void sendWifi(String txString){
Serial.print("Send: ");
Serial.println(txString);
server.print(txString); // send to all clients
server.print("\n");
}
sendWifi on "Server" MKR side.
void receiveWifi(){
client.stop();
if (client.connect(server, port)) {
Serial.println("client is connected to server");
do{
c = client.read();
Serial.print(c);
Serial.println(":char is still not a new line");
} while (c != '\n');
Serial.println("char is now a newline");
}
}
receiveWifi on "Client" MKR side,
and i'm getting nothing to read on the "Client" serial port, it outputs:
client is connected to server
⸮:char is still not a new line <-- endlessly
Is my sent string on the server?
How can I make my "Server" to "Client" communication work with server.print() ?
Best regards!