Arduino Forum

Products => MKR Boards => MKR1000 => Topic started by: John41234 on May 23, 2019, 09:46 am

Title: Arduino mkr1000 does not Serial print upon GET using aRest library
Post by: John41234 on May 23, 2019, 09:46 am
I'm trying to create a REST server on an arduino mkr1000. upon searching google i came upon the aRest library which handles most of the stuff i need.

aRest library documentation (

So i created a sample sketch based on the guides. Here is the code:

   #include < SPI.h >
   #include < WiFi101.h >
   #include < aREST.h >
   aREST rest = aREST();
   int status = WL_IDLE_STATUS;
   WiFiServer restServer(80);
   char ssid[] = "user";  // not actual username
   char pass[] = "pass";  // not actual password
   int clapMode(String data){
     Serial.println("Request Recieved: " + data);
   void setup() {
    while ( status != WL_CONNECTED) {
      Serial.print("Attempting to connect to SSID: ");
      // Connect to WPA/WPA2 network. Change this line if using open or WEP
      status = WiFi.begin(ssid, pass);
      // wait 10 seconds for connection:
    // you're connected now, so print out the status:
    // Start server
    Serial.println(F("Listening for connections..."));
   void loop() {
     WiFiClient client = restServer.available();
       if (!client) {
   void printWifiStatus() {
     // print the SSID of the network you're attached to:
     Serial.print("SSID: ");
     // print your WiFi shield's IP address:
     IPAddress ip = WiFi.localIP();
     Serial.print("IP Address: ");
     IPAddress subnet = WiFi.subnetMask();
     Serial.print("Netmask: ");
     IPAddress gateway = WiFi.gatewayIP();
     Serial.print("Gateway: ");
     // print the received signal strength:
     long rssi = WiFi.RSSI();
     Serial.print("signal strength (RSSI):");
     Serial.println(" dBm");

The code works mostly. Upon using POSTMAN to perform a GET the arduino is able to give the appropriate response.

Now for the part that is not working is the endpoint i just have created using this code


upon performing a GET in postman, the arduino is able to give a response, but it should perform this code

   int clapMode(String data){
     Serial.println("Request Recieved: " + data);

but on my serial Monitor i am not getting anything.



Also i could not find on how to tailor the response of the arduino from the request. How do i it ?

Thank you very much

Title: Re: Arduino mkr1000 does not Serial print upon GET using aRest library
Post by: John41234 on May 23, 2019, 10:30 am
My bad. I named the endpoint to "test" so it should be