Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Guide to WiFi101
description: 'Find examples & utilities for using the WiFi101 library, designed for the MKR 1000 WiFi and WiFi 101 Shield (retired).'
description: 'Find examples & utilities for using the WiFi101 library, designed for the MKR 1000 WiFi and WiFi Shield 101 (retired).'
tags: [Wi-Fi]
author: Arduino
---
Expand Down Expand Up @@ -50,7 +50,7 @@ When you load the sketch on the board, it will wait for a serial monitor console

* Circuit:

* - WiFi101 Shield attached
* - WiFi Shield 101 attached

*

Expand Down Expand Up @@ -83,7 +83,7 @@ void setup() {

// Check for the presence of the shield

Serial.print("WiFi101 shield: ");
Serial.print("WiFi Shield 101: ");

if (WiFi.status() == WL_NO_SHIELD) {

Expand Down Expand Up @@ -154,7 +154,7 @@ void loop() {

### Update Firmware / Load Certificates

The 19.6.1 firmware is only available for model B of the WINC1500, this is used in the MKR1000 board. Unfortunately, the WiFi101 shield uses model A, which Atmel has stopped supporting, so there is no 19.6.1 firmware release for it, 19.4.4 will be the latest firmware version that is compatible.
The 19.6.1 firmware is only available for model B of the WINC1500, this is used in the MKR1000 board. Unfortunately, the WiFi shield 101 uses model A, which Atmel has stopped supporting, so there is no 19.6.1 firmware release for it, 19.4.4 will be the latest firmware version that is compatible.

To simplify the process, we have prepared a specific sketch - this **FirmwareUpdater** - that you must load on the host board (either the one with the shield plugged in, or the MKR1000 itself) and an easy to use plug-in available in Arduino Software (IDE) 1.6.10 onwards.

Expand All @@ -163,7 +163,7 @@ The `FirmwareUpdater.ino` sketch is available in **Examples > WiFi101**

![Select the "FirmwareUpdater" example.](assets/firmware_updater_sketch_101.png)

***When you load the sketch on the board, it prepares the communication between the plug-in and the WiFi chip. It opens up the communication through the serial port to the WiFi module hosted on the board. It is necessary to perform all the procedures managed by the Firmware Upgrader Plugin. Everything will be managed by the plug-in, but it is important to upload this sketch first.***
***When you load the sketch on the board, it prepares the communication between the plug-in and the Wi-Fi chip. It opens up the communication through the serial port to the Wi-Fi module hosted on the board. It is necessary to perform all the procedures managed by the Firmware Upgrader Plugin. Everything will be managed by the plug-in, but it is important to upload this sketch first.***

Upload the sketch and keep the board (either the one with the shield plugged in, or the MKR1000 itself) connected to the computer.

Expand All @@ -176,7 +176,7 @@ Once done, open the plug-in that is available in the tools menu.
Your board should be in the list of the available serial ports.
If not, please check that it is properly configured in the Tools menu.

To update the firmware you should choose the right typer of board. You can find your model looking at the WiFi module: the first line in the sticker or the last line of the silk print on the right side of the PCB shows the microcontroller model. It can be either MR210PA or MR510PB and the last letter shows yor model accordingly.
To update the firmware you should choose the right typer of board. You can find your model looking at the Wi-Fi module: the first line in the sticker or the last line of the silk print on the right side of the PCB shows the microcontroller model. It can be either MR210PA or MR510PB and the last letter shows yor model accordingly.

![Find the model.](assets/MKR1000_RevA_B_20copy.png)

Expand All @@ -186,10 +186,10 @@ Choose in the dropdown list the model corresponding to your unit and proceed cli

#### Certificate Uploading

With the same procedure, you may load root certificates on the WiFi module to access securely specific websites. Your board must be running the **FirmwareUpdater** sketch to work .The root certificates are issued by a limited number of certification authorities, but it is difficult to know which site is using which authority. To ease your life, we allow you to specify directly the URL to which you need to connect securely, leaving to us the task to download the root certificate.
The list you are building is not saved from one session to the next one. It might happen that a few websites share the same root certificate. You don't have to worry about this as we take care of it. The space available on your WiFi module to store the certificates is limited to around 10 certificates that, being issued by a limited number of authorities, should be more than enough for the average projects.
With the same procedure, you may load root certificates on the Wi-Fi module to access securely specific websites. Your board must be running the **FirmwareUpdater** sketch to work .The root certificates are issued by a limited number of certification authorities, but it is difficult to know which site is using which authority. To ease your life, we allow you to specify directly the URL to which you need to connect securely, leaving to us the task to download the root certificate.
The list you are building is not saved from one session to the next one. It might happen that a few websites share the same root certificate. You don't have to worry about this as we take care of it. The space available on your Wi-Fi module to store the certificates is limited to around 10 certificates that, being issued by a limited number of authorities, should be more than enough for the average projects.

The procedure starts connecting your board (either the one with the shield plugged in, or the MKR1000 itself) to your computer and selecting it from the Tools menu of the Arduino Software (IDE). Load the FirmwareUpdater on the board and launch the **WiFi 101 Firmware Updater** from Tools and go to the third section of the interface.
The procedure starts connecting your board (either the one with the shield plugged in, or the MKR1000 itself) to your computer and selecting it from the Tools menu of the Arduino Software (IDE). Load the FirmwareUpdater on the board and launch the **WiFi101 Firmware Updater** from Tools and go to the third section of the interface.

![Adding SSL root certificates.](assets/certificates_upload_101.png)

Expand Down Expand Up @@ -972,7 +972,7 @@ void printMacAddress(byte mac[]) {
}
```

### Wifi101 Simple Web Server WiFi
### Wifi101 Simple Web Server Wi-Fi

In this example, a simple web server lets you blink an LED via the web. This example will print the IP address of your WiFi Shield 101 or MKR1000 board (once connected) to the Arduino Software (IDE) Serial Monitor. Once you know the IP address of our board, you can open that address in a web browser to turn on and off the LED on pin 9.

Expand Down Expand Up @@ -1531,7 +1531,7 @@ void printWiFiStatus() {
}
```

### Wifi101 WiFi Chat Server
### Wifi101 Wi-Fi Chat Server

A simple server that distributes any incoming messages to all connected clients. To use, open a terminal window, telnet to your WiFi shield's or MKR1000's IP address, and type away. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the client's input in your Arduino Software (IDE) serial monitor as well.

Expand Down Expand Up @@ -1704,7 +1704,7 @@ void printWiFiStatus() {
```


### Wifi101 WiFi Udp Send Receive String
### Wifi101 Wi-Fi Udp Send Receive String

This tutorial waits for a UDP packet on a local port. When a valid packet is received, an acknowledge packet is sent back to the client on a specified outgoing port. It relies on a WiFi connection made to your LAN using an Arduino Wifi 101 Shield and Zero Board or the MKR1000 board.

Expand Down Expand Up @@ -1872,7 +1872,7 @@ void printWiFiStatus() {
}
```

### Wifi101 WiFi Web Client
### Wifi101 Wi-Fi Web Client

This example shows you how to make a HTTP request using a WiFi Shield 101 or a MKR1000 board. It returns a [Google search for the term "Arduino"](http://www.google.com/search?q=arduino). The results of this search are viewable as HTML through your Arduino Software (IDE) serial window.

Expand Down Expand Up @@ -2057,7 +2057,7 @@ void printWiFiStatus() {
```


### Wifi101 WiFi Web Client Repeating
### Wifi101 Wi-Fi Web Client Repeating

This example shows you how to make repeated HTTP requests using a WiFi Shield 101 or a MKR1000 board. It connects to [http://www.arduino.cc/latest.txt](/latest.txt). The content of the page is viewable through your Arduino Software (IDE) Serial Monitor window.

Expand Down Expand Up @@ -2262,9 +2262,9 @@ void printWiFiStatus() {
```


### Wifi101 Simple Web Server WiFi
### Wifi101 Simple Web Server Wi-Fi

In this example, you will use your WiFi Shield 101 and your Arduino Zero, or a MKR1000 board, to create a simple Web server. Using the WiFi library, your device will be able to answer a HTTP request received from the WiFI connection. After opening a browser and navigating to your WiFi shield's or MKR1000's IP address, your board will respond with just enough HTML for a browser to display the input values from all six analog pins.
In this example, you will use your WiFi Shield 101 and your Arduino Zero, or a MKR1000 board, to create a simple Web server. Using the Wi-Fi library, your device will be able to answer a HTTP request received from the Wi-FI connection. After opening a browser and navigating to your WiFi shield's or MKR1000's IP address, your board will respond with just enough HTML for a browser to display the input values from all six analog pins.

This example is written for a network using WPA encryption. For WEP or WPA, change the Wifi.begin() call accordingly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: 'WiFi101 OTA with MKR 1000 WiFi'
tags: [WiFi101]
---

This example shows how to use the WiFi101OTA library to update your sketch over the air. No extra hardware is required since the update is applied directly in the upper half of the internal flash. This means that the biggest possible size of the compiled sketch is 120KB.
This example shows how to use the WiFi101OTA library to update your sketch over the air. No extra hardware is required since the update is applied directly in the upper half of the internal flash. This means that the biggest possible size of the compiled sketch is 120 KB.

## Hardware Required

Expand All @@ -29,7 +29,7 @@ Upload the example using the "classic" serial port method

![Step 4.](assets/WiFiOTA4.png)

Your MKR1000 will connect to the WiFi and expose itself as a Network port with the name and password you declared in the sketch with `WiFiOTA.begin` (the defaults name is "Arduino" while the password is "password").
Your MKR1000 will connect to the Wi-Fi and expose itself as a Network port with the name and password you declared in the sketch with `WiFiOTA.begin` (the defaults name is "Arduino" while the password is "password").

At this point you are already able to update the sketch over the air! Open another sketch and make sure to add `WiFiOTA.begin()` in `setup()` and `WiFiOTA.poll()` in your `loop()` . If you forget about this you will lose the ability to upload over the air again (but you can still upload via serial, of course)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The goals of this project are:

## The uBlox SARA-R4 Module

As every other MKR family board, the MKR NB 1500 board has a specific module for connectivity. It is called uBlox SARA-R4, and is designed to communicate over LTE Cat M1 or NB IoT networks with a speed of up to 375 kb/s.
As every other MKR family board, the MKR NB 1500 board has a specific module for connectivity. It is called uBlox SARA-R4, and is designed to communicate over LTE Cat M1 or NB IoT networks with a speed of up to 375 Kbps.

It is designed to operate in temperature conditions between –40 °C to +85 °C, making it quite durable. It also offers low power consumption and coverage enhancement for deeper range into buildings and basements (and underground with NB1).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ software:

In this tutorial, we will set up two Arduino MKR WAN 1300 to host a remote LED control. One board will be set up as a sender with a pushbutton that when it is pressed, an LED on the other board will turn on or off.

We will use the **LoRa®** library for the communication, and we will not use any external service.
We will use the **LoRa** library for the communication, and we will not use any external service.
___

## Hardware & Software Needed

- Arduino IDE ([online](https://create.arduino.cc/) or [offline](https://www.arduino.cc/en/main/software)).
- LoRa® library installed, see the [github repository](https://github.com/sandeepmistry/arduino-LoRa).
- LoRa library installed, see the [github repository](https://github.com/sandeepmistry/arduino-LoRa).
- 2x [Arduino MKR WAN 1300](https://store.arduino.cc/mkr-wan-1300).
- 2x [Antenna](https://store.arduino.cc/antenna).
- 1x Pushbutton.
Expand Down Expand Up @@ -63,7 +63,7 @@ But let's take a look at what we need to include in the code. As we are using tw

**To create the sender sketch, we will have to do the following steps:**

- Initialize the **SPI** and **LoRa®** libraries.
- Initialize the **SPI** and **LoRa** libraries.
- Create a counter variable.
- Set the radio frequency to 868E6 (Europe) or 915E6 (North America).
- Create an if statement that checks if the button is pressed.
Expand All @@ -73,7 +73,7 @@ But let's take a look at what we need to include in the code. As we are using tw

**To create the receiver sketch, we will have to do the following steps:**

- Initialize the **SPI** and **LoRa®** libraries.
- Initialize the **SPI** and **LoRa** libraries.
- Create a string with the message "button pressed" stored.
- Set the radio frequency to 868E6 (Europe) or 915E6 (North America).
- Create a function to parse incoming packet.
Expand All @@ -85,11 +85,11 @@ But let's take a look at what we need to include in the code. As we are using tw

**1.** First, let's make sure we have the drivers installed. If we are using the Web Editor, we do not need to install anything. If we are using an offline editor, we need to install it manually. This can be done by navigating to **Tools > Board > Board Manager...**. Here we need to look for the **Arduino SAMD boards (32-bits ARM Cortex M0+)** and install it.

**2.** Now we need to download the **LoRa®** library from [this repository](https://github.com/sandeepmistry/arduino-LoRa), where you can install it by navigating to **Sketch > Include Library > Add .ZIP Library...** in the offline IDE.
**2.** Now we need to download the **LoRa** library from [this repository](https://github.com/sandeepmistry/arduino-LoRa), where you can install it by navigating to **Sketch > Include Library > Add .ZIP Library...** in the offline IDE.

### Programming the Sender

In the initialization we will include the **SPI** and **LoRa®** libraries. We will then create the `counter` variable to track how many times we have pressed the button. Next, we will create the `button` and `buttonState` variables, used to assign the pushbutton to pin 2, and to read the state of it.
In the initialization we will include the **SPI** and **LoRa** libraries. We will then create the `counter` variable to track how many times we have pressed the button. Next, we will create the `button` and `buttonState` variables, used to assign the pushbutton to pin 2, and to read the state of it.

```arduino
#include <SPI.h>
Expand All @@ -102,7 +102,7 @@ int buttonState;

In the `setup()` we will first define the `button` pin as an `INPUT_PULLUP`. We will then begin serial communication, where we will use the command `while(!Serial);` to prevent the program from running until we open the Serial Monitor.

We will then initialize the **LoRa®** library, where we will set the radio frequency to 868E6, which is used in Europe for LoRa® communication. If we are located in North America, we need to change this to 915E6.
We will then initialize the **LoRa** library, where we will set the radio frequency to 868E6, which is used in Europe for LoRa® communication. If we are located in North America, we need to change this to 915E6.

```arduino
void setup() {
Expand Down Expand Up @@ -146,7 +146,7 @@ void loop() {

### Programming the Receiver

In the initialization we will first include the **SPI** and **LoRa®** libraries. Then we will create two strings: one empty, and one with the message "button pressed" stored. The `contents` string will be used to store incoming data, and the `buttonPress` string will be used to compare the contents with the incoming data.
In the initialization we will first include the **SPI** and **LoRa** libraries. Then we will create two strings: one empty, and one with the message "button pressed" stored. The `contents` string will be used to store incoming data, and the `buttonPress` string will be used to compare the contents with the incoming data.

We then create the boolean `x`, which will switch from true to false each time `buttonPress` matches `contents`. We will also assign the `led` variable to pin 2.

Expand All @@ -164,7 +164,7 @@ int led = 2;

In the `setup()` we will first define the `led` pin as an output. We will then begin serial communication, where we will use the command `while(!Serial);` to prevent the program from running until we open the Serial Monitor.

We will then initialize the **LoRa®** library, where we will set the radio frequency to 868E6, which is used in Europe for LoRa® communication. If we are located in North America, we need to change this to 915E6.
We will then initialize the **LoRa** library, where we will set the radio frequency to 868E6, which is used in Europe for LoRa® communication. If we are located in North America, we need to change this to 915E6.

```arduino
void setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ software:

In this tutorial, we will use two MKR WAN 1300's to set up a simple message service over the LoRa® network. This communication will be achieved through the Serial Monitor, where you can send and receive messages directly.

We will use the **LoRa®** library to for the communication, and we will not use any external services. Additionally, we will also create specific addresses for each board. This will help ensure that the messages that we send and receive are only displayed on the corresponding devices.
We will use the **LoRa** library to for the communication, and we will not use any external services. Additionally, we will also create specific addresses for each board. This will help ensure that the messages that we send and receive are only displayed on the corresponding devices.

Special thanks to [Sandeep Mistry](https://github.com/sandeepmistry) for creating the [LoRa® library](https://github.com/sandeepmistry/arduino-LoRa).
Special thanks to [Sandeep Mistry](https://github.com/sandeepmistry) for creating the [LoRa library](https://github.com/sandeepmistry/arduino-LoRa).

___

Expand Down Expand Up @@ -54,7 +54,7 @@ To do this, we basically only need to create one sketch that we will upload to e

In the code, we will have to do the following to make it work:

- Initialize the **SPI** and **LoRa®** libraries.
- Initialize the **SPI** and **LoRa** libraries.
- Create a string to store outgoing messages.
- Create two bytes: one for local address, one for the destination address.
- Set the radio frequency to 868E6 (Europe) or 915E6 (North America).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int counter = 0;

In the `setup()` we will first begin serial communication, where we will use the command `while(!Serial);` to prevent the program from running until we open the Serial Monitor.

We will then initialize the **LoRa®** library, where we will set the radio frequency to 868E6, which is used in Europe for LoRa® communication. If we are located in North America, we need to change this to 915E6.
We will then initialize the **LoRa** library, where we will set the radio frequency to 868E6, which is used in Europe for LoRa® communication. If we are located in North America, we need to change this to 915E6.


```arduino
Expand Down
Loading