Tag Archive: IOT


In the previous post PART 1  we explored the ways to make the local IP address of PC/ESP8266 STATIC.

In this part 2 we shall see how to make your Dynamic Public IP as STATIC using NO-IP account & then Port forward to the server started on port 350 of ESP.

PORT FORWARDING

First let us do the PORT FORWARD  settings.

For this , type in your Router’s Gateway IP in the browser & log in to Router’s Settings.Here my Router’s gateway is 192.168.1.1

The PORT Forwarding is done under VIRTUAL SERVER.

For different Router , you can check out this excellent link which guides settings for almost all types of Routers in the World.

https://portforward.com/router.htm

In my case the VIRTUAL SERVER is under ADVANCED —> NAT

 

image1

Under Virtual Server feed in the WAN & LAN ports as 350.

Under LAN IP feed in the static IP of our ESP8266.Here it is 192.168.1.10 which we made static as described in part 1.

Once the APPLY CHANGES button is clicked , the entry appears under Forwarding Table.

Image 2

 

WINDOWS FIREWALL SETTINGS

 

Next is the Windows firewall settings to allow communication through port 350.

Open Windows Firewall with Advanced Security.

Click on Inbound Rules & then New Rule.

 

Image 3

 

Select Rule Type as PORT.

protocol as TCP.

 

Image 4

Under Action select “Allow the Connection”

& tick mark all under the Profile.

Provide a Name for the Rule & save it.

Image 5

 

START SERVER ON ESP8266

Now open the Putty window where you’ve connected ESP8266 ( refer part 1 for details)

Before starting server , issue the command

AT+CIPMUX=1

Then start the server on port 350 using

AT+CIPSERVER=1,350

Image 111

Now the Server starts listening on PORT 350.

 

Convert Public IP to STATIC

The external world communicates with your ESP server using the Public IP of your Network.This IP is generally DYNAMIC which means it changes on every boot of your Router.

To make it STATIC we shall use a service called NO-IP which converts your public IP to a Domain name & follows the changes.

Visit www.noip.com

Sign up by providing your EMAIL.

Image 6

LOG IN  your NO-IP account.

Under Dynamic DNS click on ADD HOSTNAME.

Image 7

Enter the host name, for e.g , as   testmyiot  & from the dropdown select a domain , say, ddns.net.

Now your new host name is

testmyiot.ddns.net

 

Image 8

Next , click on Device Configuration Assistant.

Image 9

 

Under the dropdown select the host name we created , testmyiot.ddns.net

 

Image 10

Next step is to fill in the Device details.

Device type is SERVER

Device Brand is WEB SERVER

Router make – select your router name .If not found in list then select other

& then enter Router type as Home.

Image 12

On the Next window answer NO

We shall come back to this window shortly after setting the Router for NO-IP.

Image 13

 

On the next window , before clicking YES to log in device, go to the Router settings in browser where you typed in 192.168.1.1

Image 14

 

Click on SERVICE & then DDNS.

Most of the Routers support NO-IP & is listed on the drop down.

Select NO-IP

Image 15

Feed in the Host Name as testmyiot.ddns.net

Provide the email & password you used to create the NO-IP account.

Image 17

Click on ADD to save to DDNS Table of Router.

Now go back to your NO-IP account window.

Click YES to log in device.

Image 18

On next window click on TEST CONNECTION

Image 19

After a short time you should see SUCCESS.

Now you’re done with DDNS settings.You need not go further to Port forward tab, as we’ve already done it.

Image 20

 

Following is the procedure , in case your Router doesn’t support NO-IP .

If you do not see NO-IP under drop down of DDNS settings of Router,

go back to your NO-IP account & click YES to the question “Is there a computer always running on your Network?”.

 

Image 22

 

You’ll be taken to next window to download DUC.

DUC- Dynamic Update Client is a software which runs in the background of your PC to follow your public IP.

Download it & install.

Image 23

Before FINISH ensure to tick mark “Run DUC in the background”

Image 24

Now you’ll be asked to login your NO-IP account again

Image 25

Once you log in, the following windows appear.

Select the host name you created & click save.

Image 26

Now you can see all TICK marks in the DUC window.

DUC runs in the background & follows your public IP to the domain name you created.

Image 28

 

You can test the access to ESP server now from a distant PC.

From anywhere in the world , make open a PUTTY window.

Select RAW & feed in the host name testmyiot.ddns.net & port as 350.

Image 29

You get CONNECTED to the ESP server

 

Watch this demo video :

 

 

 

cooltext753793315   cooltext753790696

Advertisements

 

Image 2

 

Image 1

 

Introducing a new ESP8266 Development Board with an ESP-12, a 3x AA battery holder, a voltage regulator, an RGB LED, several red LEDs, and a light sensor LDR on the ADC input all on one board.

The board can be controlled by an open source Android App which is available from the AI-THINKER Website.

GPIO pins are extended with berg pins for easy external connections. RXD,TXD & GND pins are provided for programming / firmware upgrading. A yellow jumper is provided to pull GPIO0 pin to GND during programming. During normal operation this jumper must be removed.

The board is powered by 3 nos AA batteries , for which a battery box is already wired. On board 3.3v regulator is provided for a stable power supply.

No power switch or Reset switch is provided. To switch off you need to pull out one of the batteries.

The board comes pre-loaded with a demo which does actually seem to work.  If you have an Android based phone or tablet you can download AI-Thinker’s app to control and mix the color balance on the RGB LED and to switch the other LEDs on and off.

The Android Application can be downloaded from :

https://play.google.com/store/apps/details?id=com.duvallsoftware.iotdemoapp

 

There are also 6 red LEDs fixed with the necessary resistors connected to GPIO16, GPIO14, GPIO5, GPIO4, GPIO0 and GPIO2. A BLUE LED is always ON if the board is powered.

The GPIO13, GPIO12 and GPIO15 are connected to a RGB LED which allows you color mixing using PWM.

ADC

The analog-digital converter is also available on a pin & connected to a light resistor. This lets you quickly test the ADC and you still can clip the resistor off if you want to measure another analog source.Remember the range of ADC is max 1v & not 0 to 3.3v

If you don’t want to use the light sensor or the LEDs you can simply clip them off. Then you’ll just have an  ESP8266 with 3xAA power supply, 9 available GPIO pins and one ADC.

On the playstore of your Android device search for  IOT DEMO App & install it.

Open the Settings & enable WIFI of the Android phone.Now power on the ESP board to see the AI-THINKER SSID on your mobile.

PAIR this with the ESP board using password ai-thinker

Now open the app & touch on LED 1 to 6 , to see the corresponding light glowing on the ESP board.On the top you can see 3 icons with sliders in the App. Use this to mix colors on the 3 color LED of ESP board.

Once the functioning of board is verified , you can proceed to connect the GPIO pins of ESP board with a 4 channel Relay board.

The 4 channel relay board used requires a separate power source of 5V, 1amp.For demo 2 of the GPIO pins are connected to relay 1 & relay 3.The GND pins of both ESP & the Relay. board to be made common.

You can watch this video to learn the home automation basics with ESP board :

 

 

 

cooltext753793315    cooltext753790696