External Links

Creative Science Centre

 

IoT Wi-Fi Discovery Kit

This text is now obsolete, the ESP8266 now uses ByVac firmware which does not use the AT commands and so the functions used in this text will not work. The updated text is here.

Getting Started

IoT (Internet of Things). This text describes the use and how to use the kit and how it works so that all or part of it can be incorporated into other projects.

The kit comes with the software already pre-loaded and works with a ByPic Microcontroller. (if you have an existing BV502 (MX170 version), download the software is here.

http://www.byvac.com/mBlib/flb/Library/wifi/ESP8266_DHT.script (details)

These controllers talk to the outside world via the 5 pin serial interface and so the first thing to do is to download the IDE on this page.

Because the software is pre-loaded you should see the menu. ** If you see a slightly different menu then simply clear the flash (flclear(0)) and reload the script above using CRTL+SHIFT+R **

Remove the jumpers as described in the kit instructions for S1,S2 and S3 to get to this screen. The jumpers simply tell ByPic to start running the client or server immediately, we don't want that as we need to get to this menu.

Setting up a Server (1)

A server is used in this context to provide a web page for a browser, so the kit will effectively be a HTTP server providing (all be it one) a web page to any browser that is connected. A server is useful for controlling things such as lights and heating as it can be contacted by any browser (potentially anywhere) and will respond straight away.

Select 3 to run info:

The important bits have been highlighted in white. This tells us that the current mode of operation is as an access point and if we were to scan on another device (laptop, phone etc.) we would see 'LINK3' as an open (the last 0) access point that we could connect to. We can communicate with it via the IP address as shown. This is 192.168.4.1 and cannot currently be changed.

If Wi_Fi mode is not 2 then press 4 as we need the module to be an Access Point (AP). Scanning for lINK3 (in this example) will not work until theESP8266 is in AP mode.

Now press 9 to run the HTTP server. Go to the laptop or other device and connect to the SSID as shown in info, in this case LINK3. Because of the way the kit is set up you will also need to place a shorting link between C9 on the Mini-Max and ground. Removing the link enables you to get out of the continuous server loop.

This is a dongle device on Windows XP, windows 7 and laptops normally have an icon bottom right. Use setting for Android devices.

Troubleshooting:

  1. The ESP8266 is quite slow at giving out an IP addresses and so it may take more than a minute, you can't brows until this happens.
  2. Some devices (Android) have a habit of reverting back to the original Wi-Fi network. If this is causing problems, temporarily disable (forget) the one you normally use.

All being well you should be able to brows to something like this:

Clicking the links should show results. This is an example of being able to control something - turning the LED on and off and being able to monitor something, getting the temperature and RH.

The serial terminal will show something like this when the browser is clicked:

To stop the server running remove the link from C9 and ground.

Setting Up a Client

A client will require an existing Access Point SSID and password. This will definitely NOT be set for your home network, it only needs doing once as the ESP8266 will remember it.

Set the SSID and password using option 6

Now set to be a station by using option 5

Use option 3 to check that it is in mode 1

Here we can see that it is in mode 1 and the IP address has been given to the ESP8266 by the home access point, in this case 192.168.11.54.

To test this use option 8 or get the current date, option 11. Option 8 will contact google and google will in turn send back information from its server. The information will be in the form of an HTTP 'head' and so will not be very meaningful but you should be able to make out details such as the server name etc.

Need a Server

The hard part about using this mode is that a server is required and this is not a standard option on any Windows platform, possibly on Linux. so to make thing easier initially you can use a public server that has been set up for this purpose.

With C9 connected to ground Use option 10

The serial connection will show something like:

In a browser navigate to  http://www.byvac.com/wifi/wfdemo.php

And you should get a page that looks similar to this: