Arduino and Xbee wireless control for long distances?

dendad

Joined Feb 20, 2016
3,528
You can set up a VPN and log into your home network over the internet.
That can be handy to look at security cameras too.
I had a small PC running Linux and OpenVPN here until the hard drive crashed. One day I'll get it going again. It was very handy as I also could log into my home telephone exchange and make calls from "home" from anywhere in the world.
I'm in Australia and it was kinda fun to make home calls from Prague. I used a cafe's WiFi there and could see what was going on at home. And also surf the net via my home internet. A bit redundant but for on line banking when away from home, a little more secure.
 

Thread Starter

zazas321

Joined Nov 29, 2015
473
Thanks for reply. I was looking into Esp8266 module or Xbee internet gateway. Im not sure what are the differences. Would i need to create my own website if i wanted to use wifi module such as 8266? Also, could you tell me a little bit more about setting up VPN
 

dendad

Joined Feb 20, 2016
3,528
Have a look at https://openvpn.net/
I'm assuming you have an internet connection at home.
Then set up a Raspberry Pi or other small PC with the OpenVPN on it. I had an EEEBox as mine.
Have whatever you want to control, like an ESP8266 based Sonoff https://www.seeedstudio.com/Sonoff-Basic-Wi-Fi-Wireless-Switch-Kit-p-3047.html connected to that network.
When it is all set up, you can control the things at home via your network, or from a remote location using OpenVPN and the internet.
 

Thread Starter

zazas321

Joined Nov 29, 2015
473
Thank you for this information it is very usefull! So if I understand sonof has a built in esp8266? Also, would I need acess to internet router? Is it possible to connect it to network wiresly without connecting to the router?
 

djsfantasi

Joined Apr 11, 2010
6,425
Without a VPN, you could sign up for a dynamic DNS service. This will give you a fixed IP address to communicate with, which is then forwarded to your variable home IP address. I used this to control my animatronic over the public internet.
 

dendad

Joined Feb 20, 2016
3,528
So if I understand sonof has a built in esp8266?
Yes. The SonOff has an ESP8266 and there are lots of sites refering to hacking them. For example...
https://hackaday.com/2018/02/06/hacking-a-sonoff-wifi-switch/
And I really like Rui Santos' series of tutorials. Well worth looking at.
https://randomnerdtutorials.com/reprogram-sonoff-smart-switch-with-web-server/

Also, would I need acess to internet router? Is it possible to connect it to network wiresly without connecting to the router?
You will need to connect via a router I think. An existing WiFi network will have a router already so you don't have to supply one if there is a network there. Do you already have a network connected to the Internet?
 

Thread Starter

zazas321

Joined Nov 29, 2015
473
I am a little bit confused when we talk about access to router. I thought that I would need to have wired connection from my router to sonoff or network shield for arduino. I have access to router at home but I would prefer not having any wired connections from my controller circuit and router.
 

dendad

Joined Feb 20, 2016
3,528
You are showing too many parts I think.
Something like this??
Smartphone-Sonoff.jpg
The Sonoff is connected via WiFi, not wired. And connects to your existing router' WiFi.
 

Thread Starter

zazas321

Joined Nov 29, 2015
473
Okay I see. The reason why I am showing more parts is because I have to implement solar panel into the system that would notify me if we have enough energy to turn ON/OFF the appliance. But it makes sense now. Also, could you tell me a little bit more about working principle of ESP8266. When we establish the connection to home network using ESP8266 does it remain connected to the network as long as it have power supplied or it only connects to the network when I want to turn on device?
 

dendad

Joined Feb 20, 2016
3,528
The ESP8266 normally connects to your WiFi and it stays there as long as it is powered. But a software mod could change that if you like.

Go to https://sonoff.itead.cc/en/ and look through the "products" drop down menu.
There is quite a range of SonOff models. For example,
https://sonoff.itead.cc/en/products/sonoff/sonoff-basic
https://sonoff.itead.cc/en/products/sonoff/sonoff-4ch-pro

They can be driven stand alone directly from your phone, or added to the WiFi network. Grab on and have a play.
There are also a lot of "Arduino" like ESP8266 and ESP32 parts on Ebay.
 

PhilTilson

Joined Nov 29, 2009
81
From your original post, it's not clear just how experienced you are at programming.

If the answer is 'not very', then you might like to look at http://www.esp8266.com/mmiscool which offers a (free) BASIC interpreter which runs on the ESP8266. It enables you to set up a web server on the ESP which is then accessible from anywhere if you port-forward through your router.
 

Thread Starter

zazas321

Joined Nov 29, 2015
473
Im not very experienced in programming yes. Okay that is exactly what I was thinking about. Do you suggest me just look through the posts on the forum till I find something usefull? I have recently bought my esp8266 and will try to program it with my Arduino UNO
 

Thread Starter

zazas321

Joined Nov 29, 2015
473
Im also doing a bit of research on 3.3v voltage regulators cause it seems like arduino supply cannot keep up with current draw of esp8266 module even though most tutorials I have looked online connect it straight to arduino without worrying too much
 

Phil-S

Joined Dec 4, 2015
142
You do need to take heed of power requirements when you attach things to the Arduino.
Pins and on-board voltage regulators can only supply so much - digital pins for instance will supply a maximum each of 40-mA and not a lot more in total.
It's better when prototyping to supply motors and transmitters and the like from an external power supply. If you get the volts and amps wrong, you might destroy the Arduino. You need to worry about "without worrying too much"
 
Top