Go Down

Topic: Wifi101: Client reading data from the (MKR1000) server (Read 1 time) previous topic - next topic


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.

Code: [Select]
void sendWifi(String txString){
    Serial.print("Send:  ");
    server.print(txString); // send to all clients

sendWifi on "Server" MKR side.

Code: [Select]
void receiveWifi(){
   if (client.connect(server, port)) {
          Serial.println("client is connected to server");
            c = client.read();
            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!


You need to attach all the code used not "snippets"
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.


There are the entire codes.


I'm having the same problem... Please update if this problem is solved.
By the way, most of the code I read online on the communication between server and client is using the "HTTP GET request". I'm wondering if this is a must? I just need to send some data from my sensor to another MKR1000 through wifi and don't need to use a web page to control it.

Go Up