Home > Projects > LED Projects > Control your MKR1000 with aREST Framework

Control your MKR1000 with aREST Framework

Summary of Control your MKR1000 with aREST Framework


This article demonstrates how to control an Arduino MKR1000 remotely using the aREST framework and a RESTful interface. The project connects two LEDs to the board, allowing users to toggle them via web browser commands by sending specific HTTP requests to the device's IP address. It details the necessary software installations, code modifications for compatibility, and the sketch logic required to expose functions and handle incoming WiFi connections.

Parts used in MKR1000 Remote Control Project:

  • Arduino MKR1000
  • LED (generic)
  • Resistor 220 ohm
  • Jumper wires (generic)
  • Arduino IDE
  • Wifi101 library
  • aREST library

You can control your MKR1000 remotely with a RESTFUL interface.

mkr1000_arest

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000
× 1
LED (generic)
LED (generic)
× 2
Resistor 220 ohm
Resistor 220 ohm
× 2
Jumper wires (generic)
Jumper wires (generic)
× 5

Software apps and online services

Arduino IDE
Arduino IDE

Story

Source : Control your MKR1000 with aREST Framework

Quick Solutions to Questions related to MKR1000 Remote Control Project:

  • How do I setup the development environment for this project?
    You must setup the MKR1000 using the Getting Started guide, install the Wifi101 library version 0.9.0, and install the aREST library version 2.1.1.
  • What changes need to be made to the aREST.h file?
    You must change WiFi_h to WIFI_H and replace the dtostrf function with sprintf in the addToBuffer method.
  • How can I turn on pin 5 of the MKR1000?
    Type http:///digital/5/1 into your web browser to turn on pin 5.
  • Does the project support turning off the LED via API?
    Yes, you can type http:///digital/5/0 into the web browser to turn off the LED.
  • What is the best way to use the exposed ledControl function?
    Type http:///led?params=1 into the web browser to turn on the LED using the exposed function.
  • How do I find the IP address needed for the API calls?
    Open the Serial Monitor using the Tools > Serial Monitor menu and note down the IP address shown there.
  • Can I customize the device name and ID in the sketch?
    Yes, you can set the device ID and name using rest.set_id("008") and rest.set_name("mighty_cat").
  • Which port does the WiFiServer listen to for REST calls?
    The WiFiServer instance listens to port 80 as defined by WiFiServer restServer(80).

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top