Configure the Android App

Before you follow the steps of this page, you have to connect the temperature sensor and the relay to your Arduino Yun.

Overview

  • Prepare the Yun to receive the software.
  • Configure the Wifi connection of you Yun
  • Download the app from the play store and install it
  • Use the wizard to install the software on the Yun.
  • Fine tuning the configuration

Prepare the Yun to receive the software.

We recommend you to start to start with a factory reseted Arduino Yun, and to format the microsd card in a computer with the Fat32 format.

To reset the Yun to the factory image, you have to possibilities:

1.- Press the WLAN RST switch on the board, 30sg or more, until the blue led “Wlan” blinks. After the blue led has blinked, the yun is performing the factory reset. Yo will have to wait two minutes more or less until it is ready.

2.- Open a ssh session with the yun, login as root, and perform the following commands in the shell:
[crayon-5c13b3da91157854520372/]
Again, after two minutes the Yun will be factory reseted.

Insert the formatted micro sd card in the Yun (fat 32), and go ahead to the next step.

Configure the Wifi of your arduino Yun.

After a factory reset, or when you first power the  Yun it starts in AP (Access Point) mode and will create a network called ArduinoYun-XXXXXXXXXXXX. Connect your computer to this network.

Once you’ve obtained an IP address, open a web browser, and enter 192.168.240.1 in the address bar. After a few moments, a web page will appear asking for a password. The default password is “arduino”. Enter it and click the login button.

The next page will show your some diagnostic information about the current network connections. Press the configuration button to proceed.

In this new page, you will configure your Yun, identifying what network you want to connect to.

Choose a password for your Arduino, and after that select the network you want to connect to and enter the password of the network. When finished, press “configure & restart”.

The Yun will restart, and after a couple of minutes will be connected to the network you selected.

Advice: we recommend to use a static ip for your arduino yun. This way, the chances that you have communication problems between the app and your arduino is minimal.

Download the Android App from the play store

 

You can download the Android App from the link below:

Get it on Google Play

After  connecting the temperature sensor and the relay to the arduino Yun, you can install the app and deploy the sketch and the other scripts to the Yun. The first time that the app is started after the installation, it starts in Demo mode. In this mode you don’t need and arduino Yun to see how the app looks like. But if you have a Yun, you can configure it with the wizard.

Install the software on the Yun with the Wizard.

You will find the wizard in the left menu:

Configuration with the Wizard, step 1/2:

The configuration of the you is now a lot easier as before. The requisites are:

  • The Yun has to be powered on, and needs a valid Ip address in the same network as your Android device. That means that both devices must be connected to the same network.
  • The Yun needs to have access to the internet (to download packages).
  • You have to write the root’s password in the text box, and tap on “Start”.

A few seconds later, the App should have detected the Arduino Yun, and shows it IP and some other info:

La app ha encontrado al Yun y muestra su Ip.

Now, you have to options:

  1. If this is the first time that you configure the you, that is, the yun has not the software deployed and configured, or you are updating the software on the yun, then tap con the “Configure Yun” button and go to the step 2 below.
  2. If the yun is already configured and working, but you want to add more devices to access to it and control your boiler, then all is done: click on “save and exit” and start using the app.

Configuration, step 2/2:

This step deploys all the needed scripts to the sd card inserted in the Yun, and the sketch to the Arduino side. You only have configure two things:

  1. If you want to password protect the web services of the yun, then check the checkbox, and
  2. Select your appropriate Time Zone. The app tries to do this for you, but if the app selects a wrong timezone,  then select it yourself:

Then click “start”, and the app will deploy the php scripts and the sketch to the Yun. The process can take up to three minutes. It is recommended to prevent the android device from going into sleep mode while it deploys the software to the yun.

If the deployment finishes successfully, the you are taken to the main screen, and you can start to use the app:

Screenshot_20151219-172141

Adjusting the configuration

In the settings screen you can adjust some parameters of the configuration yourself:

  • User name: The name of your device. This name will be showed in the main screen.
  • External Ip of the Yun: the public Ip of the yun, used to access the yun when you are not connected to the same network. You need to do a port forwarding in your home router, to forward the requests done to your external ip to the arduino yun.
  • External Ip port: If you are using a different port for the external ip as the 80, you can set up it here.
  • The root password of the yun.
  • The name of the network used at home, when your arduino yun and your android device are on the same network.

Using the app:

Pantalla principal

  1. Open here the left menu.
  2. Some other less used options.
  3. The remote nodes are showed here. Read the tutorial to add remote notes to the project.
  4. Lock / Unlock the thermostat: if you want to modify the desired temperature, first you have to unlock the thermostat. Then, swipe you finger around the circle to set the temperature.
  5. Information from the master node: it is divided in two sections: above, the current temperature of the master node. Below, in orange, the desired temperature and the last user that has done an action on the arduino yun.
  6. Button on/off: in manual mode, you can turn the system on or off by pressing this button. In auto mode, this button is disabled.
  7. Switch “auto mode” / “manual mode”: here you can activate the auto mode. Then the arduino will follow the configured programs.

Programs

With Smart Thermostat you can work y manual mode (you decide when the system is heating), or you can configure a weekly program, and customized heat period for each day of the week. You can configure as much programs as you wish, but only one program can be active at a certain moment.

You will find the screen to configure the programs under the “Programs” option in the navigation menu:

  1. The name of the program that is showing on the screen. If this program is the active program, it will showed too.
  2. With this button, you can change the program you are seeing on the screen, if you have created more than one.
  3. Press this button to configure the program you are viewing as default program.
  4. Deletes the program you are viewing. If the program was the active program, another program is automatically selected.
  5. Adds a new program. You can configure so many program as you wish.
  6. Saves all the changes made to the programs and exits. If you exit this screen pressing back, without saving the changes, all changes will be lost.
  7. With this buttons you can select the day of the week, you wish to configure heat periods for.
Create heat periods

For each day of the week you can configure as much heat periods you want with only a limit: the smallest heat period allowed is 5 minutes. By default, each day of the week has one heat period, that covers all the day, from 00:00 to 23:59.

To create more periods, press the button labeled with the number 12. This will split the current period in two, and automatically adjust the finish time of the old period, and the start time of the new period. For example, if you split the default period covering all the day, two periods will be showed: the first covering from 00:00 to 12:00, and the next covering from 12:01 to 23:59.

Customizing the start and end times for a period.

To customize the start and end times of a period, use the buttons labeled with the numbers 8 and 14. You can specify the time with the following dialog, with a precision of  one minute.

Once you specified the start/end time of a period, the start/end time of the adjacent periods will be automatically adjusted.

The text labelled with the number 9 will show the duration of this period in format hours:minutes.

The text labelled with a 10, shows the wished temperature for this period. By pressing on it, you can adjust the desired temperature.

The maximum and minimum temperatures are determined by the configuration you established in the configuration screen.

The toggle button labeled with the number 11, deactivates or activates a period. A deactivated period, will not trigger your heating system.

Button nº 13 deletes a period. The start and end times of the adjacent periods will be automatically adjusted.