WiFi Setup Current Version
Previous version is here
The following is for the ESP firmware supplied by ByVac (free).
When the ESP is used within an unknown network it will revert to an access point and will be accessible from a browser using the ip address 192.168.4.1.
This will happen of course when the device if fist purchased / programmed or when moved to another network.
The procedure for setting up the device is:
- Set the laptop, phone, tablet to connect to the ESP device
- Browse to 192.168.4.1
- Apply your settings.
In detail the following assumes a Windows machine.
Connect to the ESP device using the Wi-Fi settings. Exactly how this is done will of course vary from device to device. The screen shot here is from a Windows 7 machine.
The SSID normally start ESP but could be anything, just look for the open AP or one you haven't seen before.
Using a browser enter 192.168.4.1 in the browser address bar. ** You may have to wait for the ESP to give your PC an IP address.
- Change the mode to be a station.
- Enter your wifi router name and its password
- Set an IP address, you can put 0 for one assigned by the router, the gateway is the address of the wifi router.
- Pressing save and reboot will disconnect the ESP and apply the settings - expect the browser to stop responding after pressing this button as it no longer has the 192.168.4.1 network.
This text will give help on the settings that are available.
Firmware: This shows the current firmware installed on the ESP device.
Baud Rate: (Default 115200). The ESP device communicates essentially through serial access, the Baud rate can be changed here. For other aspects of communication, data bits etc. then serial communication will be needed to access the command set.
SSID: This is the name of the router you wish to connect to in station mode (mode 1). Set this to the same name as your home router and all communication will be via that router. This is the most common method of using the device. [More detailed Information]
Password: This is the (wifi code) password of the home router. The ESP will figure out the type of security used and once correctly set it will enable communication vie the router.
Port: A socket consists of an IP address and a port number, the default is 80 so that it can easily communicate with a browser.
The following is only applicable to mode 1
IP Address: This has 2 options. If set to 0, which is not a valid ip address, the home router will give the ESP device an address in the correct range for your network. The down side to this is that to communicate with the ESP device you need to know the address and so you will have to login to the home router and find out what address it has been given. This is called a dynamic IP address. [More detailed information]
An alternative is for you to choose a fixed IP address so that any communication is via a known IP address. When choosing an address consider the following:
- The first 3 numbers must match your network (router) address.
- It must not have the same address as any other device on the network.
Gateway: This is the IP address of your home router
Netmask: Just set this to 255.255.255.0
Mode: This is important, there are 2 possible modes that the ESP device can work in, by default this is mode 2 and the ESP device behaves as an Access Point, exactly the same way that your home router does. It is set to this by default so that a browser can be used for setting the device up. Mode 1 is station mode that is more likely to be used, in this mode it will connect and become part of your home network.
The following is only applicable to mode 2
SSID: This sets the name of the ESP device, just as the home router has a name. It is this name that appears in the wifi list on the host when connecting to it.
Password: This can be left blank for an open, unsecured AP otherwise it needs setting, use at least 10 characters.
Auth Mode: This determines the security: 0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK
Channel: This is the radio channel that the device uses.
A socket consists of an IP address and a port number and as an example is specified as say 192.168.20.5:900. In this case the port is 900. Port numbers can range from 1 to 65535. The lower port numbers are usually set aside for special uses. On a private network this doesn't matter so much.
The socket in this case is equivalent to the COM port, so instead of say COM3 we use 192.168.20.11:8008
Normally an IP address is given to a device that connects to an AP by the AP. So for example if the AP had an IP address of say 192.168.20.1 then it is likely that the AP will give the connecting client an address in the region 192.168.20.2 to 192.168.20.250. This is done by a program (DHCP) within the access point. It ensures that the connecting client, normally a laptop or PC will be able to communicate with other devices that use the same AP, and the internet of course. This is called a dynamic address as it may change each time the client connects.
This is fine for most circumstances as the IP address is not needed for most applications, however if a socket is going to be specified then a static address is needed, how would you know what IP address to use otherwise? A static address can be set up in the BV107.
The command list will change depending on the firmware installed. For an up to date list see the Details link on the ESP firmware page.
The ESP will revert to being an access point in the following circumstances.
No Network: If the network (SSID and password) cannot be found. This could be because the network has gone down or you have moved the device to a different location. If it is temporary then when the known network is established again, resetting the ESP will re-connect to the known network.
The button: Most ByVac devices that use the ESP have either a button or shorting link that will connect GPIO-0 to ground. If this is momentarily pressed the ESP will revert to an access point with the IP address as given in the set up. If pressed and held for 10 seconds it will revert to an access point with an IP address of 192.168.4.1
Browser will not connect
1) Perform a factory reset to make sure you are at a known starting point.
2) After connecting to the ESP device, wait at least one minute for the ESP to give the host (your laptop or PC) an IP address.
3) Before browsing check again that you are still connected to the ESP device, some wifi hosts have a habit of reverting back to the most used wifi SSID.
Not Working when trying to telnet
1) Check that you have connected to the ESP8266, the wi-fi device on the host (PC or tablet) hardware should say that it is connected.
2) Use the command window and type icconfig.
Here the Wireless LAN adapter (which may be at the top of the page, so scroll) has the default Gateway correct at 192.168.4.1. This is the IP address of the ESP device.
3) The port must be 23 for telnet. The only way you can check and set the port is by using the serial end setup method.