Control home appliances through internet

Thread Starter

Parth786

Joined Jun 19, 2017
642
I am trying to understand basic of internet of things. I have been reading a lot but reading a lot about internet of things create more confusen.I thought its batter to start with some practical example.

Example: Let's suppose there is a person who lives in US. His house is in India. He wants to control his home appliances through internet. it will monitor the home appliance placed in his home india using the web browser. I think he'll open Google first using web browser, after that he'll open web page. He will send information using web page. In receiver side, Raspberry will receive instruction and it will control home appliance.

I have tried to explain my question with the help of diagram.

upload_2017-11-20_23-28-40.png

I bought Raspberry board. I can design the hardware for the project but I have some issues with programming. I am looking help with programming.
I want you to help me on specific problem.

What software tools do I need to complete this project ?Which programming language do I need to complete project?
 
Last edited:

LesJones

Joined Jan 8, 2017
4,174
If you Google "ESP8266" then you should find lots of information about doing what you want. They can connect to your network via Wi Fi and switch relaus on and off. They can also transmit data (Such as temperature and humidity.) back over the internet. You comunicate with then using a web browser running on a PC or tablet.

Les.
 

Thread Starter

Parth786

Joined Jun 19, 2017
642
If you Google "ESP8266" then you should find lots of information about doing what you want. They can connect to your network via Wi Fi and switch relaus on and off.
Les.
I already followed many articles, web sites. As you told me I spent more time on google but I am really getting very confused. as I mentioned in the post #1 I have issues on programming . Please look at the example I took and tell me what I should do to make complete project
  1. Which language will be used in the project. Python, java , PHP, Embedded C ?
  2. I have to run web server on Raspberry Pi?
  3. Do I need to make web site ? Will it have to spend money for it?
These are all the questions that I do not understand. I want to understand once procedure How can control any device with the help of internet?
 

LesJones

Joined Jan 8, 2017
4,174
I have very limited knowledge on the subject. I have used ESP8266s but they have behaved as the web server and I have just accessed the webpage they have served out using a browser such as firefox. I have used code I have found on the web (With slight modifications.) but I don't fully understand it. I think it is a version of "C" with HTML for the web page itself. If you must use a Raspberry Pi as the web server then you will probably not use ESP8266s. You will probably get replies from people with a greater knowledge of the subject.

Les.
 

Thread Starter

Parth786

Joined Jun 19, 2017
642
You need to look here: https://atmosphere.anaren.com/platform/development#cloud-development and here https://aws.amazon.com/iot/

Running a web-server at home can likely cause issues with your ISP.
I understand that I have to run web server on Raspberry. I am sending instruction through web page. I think I have to make web page or web site. I can use any language (java, php html) to make web site. I do not understand which language to use complete project I can not decide which programs I have to make and which language use in my project.

It will be very helpful if you can tell me which programs I have to write and which language i should use in my project.
 
I wish I had better answers for you. I don't. Embedded web servers are different.

Let's ask.... How do you obtain the IP address of the home in India and then access the web server of the Pi?
Finally, will your India ISP get upset that your running a web server at home?

Since I've done some research, there are a fair amount of not well understood options. This http://www.coridiumcorp.com/prod-specs8.html is something else to check out.

I know nothing about these https://opensource.com/life/16/3/5-open-source-home-automation-tools

There's a big one that I can't remember.
 

Thread Starter

Parth786

Joined Jun 19, 2017
642
I wish I had better answers for you. I don't. Embedded web servers are different.

Let's ask.... How do you obtain the IP address of the home in India and then access the web server of the Pi?
Finally, will your India ISP get upset that your running a web server at home?
I am not able to answer your question because still I am confuse . Now you think that you are in office and you want to control light bulb that is in your house. You have connected light bulb with relay to Raspberry. How do you control your light bulb from your office ?

I know we can do it. I have read it but I don't understand how to do it. Now a question for you, How will you control your light bulb from your office ?

Note : I am just asking you question for basic understanding because I have already searched a lot on internet but still confuse. That's why I want to know how will you do it with Raspberry. don't use another chip like esp2866
 
I'm no expert at this game, but what I can tell you is that with a non-business customer in the US, you don't get a STATIC PUBLIC IP ADDRESS. If you go to www.whatismyip.com, that website will reveal your public IP address. The problem is, it keeps changing.

Your network internally uses a PRIVATE IP ADDRESS, typically 192.168,x,x or 10.x.x.x and one other range.

Your ROUTER gets configured so that it knows that say port 80 (http) goes to some STATIC PRIVATE IP address on your network. Port 80 is a "Well known port" for http. There are 65535 ports You can use a URL such as http://<some IP address>:100 to use port 100 for the http protocol.

Look up "DYNAMIC DNS" or even www.dyndns.org as one such provider. This is a method that keeps modifying the INTERNET NAME SERVERS, so it can find you and your Pi. e.g. Fredshome.dyndns.org.

Operating a mail server gets much more complicated because, the I address and the name has the be able to be reverse resolved. e.g IP address to name and name to IP address. "Certificates" further authenticate mail servers and the protocol https. They make sure you are who you say you are.

In order to get around this problem dyndns.org offers some solutions if you meet certain creteria.

To solve this in another way, Amazon offers AWS or Amazon Web Services where a web server interacts with a cloud or an ALWAYS ON computer. The cloud knows the light is ON and the cloud can tell the webpage that you want to turn the light on or off. I've not done enough research to fully grasp this.

ATMOSPHERE also offers phone interfaces and even stand-alone apps for phones.

Some HTML development tools also try to fix the browser differences.

The embedded web server may not have the ability to send TXT messages to a phone as part of an alarm. I have a NAS (Networked Attached Storage) server at home and I had to reduce my email security so that the server can notify me via email of issues.
 

Thread Starter

Parth786

Joined Jun 19, 2017
642
You will probably get replies from people with a greater knowledge of the subject.
Les.
I also think somebody has to work on this project in forum. I'm still waiting for someone to guide me in right direction. I have heard many time that with the help of internet, We can operate any device from anywhere via internet but when I am trying to make it, I do not understand how to do it. I did not think that this is such a difficult task. Where I am thinking wrong.

If this can happen then how it will happen. how someone will control his home device from his office. if this can't happen so why it can't happen ?
 
Last edited:

Thread Starter

Parth786

Joined Jun 19, 2017
642
Sure you can control just about anything by using the correct software on a publically accessible computer. For a Raspberry and a light it might just a 120vac relay board connected to a gpio pin.
http://www.instructables.com/id/Simple-and-intuitive-web-interface-for-your-Raspbe/

Just remember, the S in IoT is for security. ;)
I did an experiment. I had two laptop's and one WIFI router. I had installed the server in one laptop and another laptop was working as client
I could access the data from the server laptop using client laptop. I was able to access a website from server laptop This could be possible because the both laptop's was connected to the same router.

I mean we can control device when all device connected on same wifi. if My laptop and Raspberry connected with same Wifi in home this is case when I can control light bulb from my laptop. I think this has been done in a project given in the link. but if I am in office and I want to control home bulb then I am finding difficulty to do it. I am not finding correct program or software both devices are connected to different routers. office laptop is connected with offices router and RPI connected with home router

Have you worked on internet of things project? I am sure you ave done it. What project did you make? Have you made a project for long distance?

Note : I am not debating, This is a common question that comes in the mind of any common person. Everyone want's to control device from long over internet because This makes life easier
 
Last edited:
You have to be able to access the Pi outside of your home network. One very simple way of accessing the Pi is through SSH or Telnet. Telnet puts the password in the clear, SSH does not. It does give you access to the Pi shell from your subnet.

You have to set up and SSH server in the Pi and have an SSH client on the PC.

You can use password authentication or certificate authentication between two machines.

SSH automatically sets up SCP or Secure Copy, so you can transfer files to and from the PC.

You can, if you want set up an SSH server on the PC too.

Now you can configure your router to use non-standard ports for SSH,one points to the PI and one points to the PC if you have any hope of accessing either from the US.

Now, you need Dynamic DNS to get the IP address of your home network.

So, you can use "Python" to turn bits of an I/O port ON and OFF thus you have rudimentary control over something at home from afar. It's not a webpage and you won;t have access from your cell phone browser/

But it does give you the ability to access files from the Pi and the PC from somewhere else.

One time I set up a man in the middle "attack" to a server I had access to, but not direct access too. I used Cygwin to setup the SSH server on the PC. So, SSH from outside "thought" I was accessing the network from the internal network until the IT department required a reverse DNS.
 

ebeowulf17

Joined Aug 12, 2014
3,307
I've never done these projects, but I've read a variety of articles in Make magazine and online.

Every solution I've seen utilized a 3rd party service. There would be a professional hosted website that your device connected to through your home internet connection. Then you would access that website from your remote location through web browser and toggle or check whatever parameters you had set up. The key was always the 3rd party website at a real domain with a static IP. I'm sure there are other solutions, but this seems to be the easy one that the "maker" movement is taking advantage of most often.
 

Thread Starter

Parth786

Joined Jun 19, 2017
642
Every solution I've seen utilized a 3rd party service. There would be a professional hosted website that your device connected to through your home internet connection.The key was always the 3rd party website at a real domain with a static IP..
Do I have to pay for this ?
 

Alec_t

Joined Sep 17, 2013
14,280
Could you use Google Drive, or Microsoft OneDrive, as a cloud 3rd party service? From your remote location run an app to incorporate home appliance commands into a file which you upload to the cloud. Have a browser on the Pi to download and parse the file periodically.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Do I have to pay for this ?
I tried just a little searching, but I'm not going to do the leg-work for a project I'm not interested in. Try googling with keywords like iot, smart home, home automation, hosting, server, web app, etc.

Microsoft Azure seems to offer some free stuff, but I'm not sure how far you get for free:
https://azure.microsoft.com/en-us/?v=17.44

The were lots of others that are free up to a point. Without knowing how much functionality you need, I don't know if their free products are enough.

Make magazine and Adafruit, among others, have written extensively about this stuff over the years. Try searching their articles.

Good luck.
 
Top