-->
Page 1 of 1

8266 <- -> data, connect to internet (not just LAN)

PostPosted: Sun Oct 25, 2015 1:12 am
by danielchow
Hello everyone,

I would call myself a pretty "techy" person, lots of coding experience from old microPICs back in the day to some heavier PHP/SQL stuff.

I have an ESP8266 and looking to do several things:
1. Push a button on a cell phone app and have the ESP8266 turn on / off a LED all through wifi / mobile data
2. Send analog data from a temp sensor LM35 Arduino Uno / Micro > ESP8266 > the same cell phone app.

I'm not new to this wold of microcontrollers. I've tried a number of tutorials, learned a lot, but haven't really found a good one. Looking to make this as simple as possible for now. Any suggestions?

Here is what I've found so far:

This is good, but doesn't show you how to do it
https://www.youtube.com/watch?v=V_w_DzaPCLQ

Souliss IoT app
http://souliss.net/welcome/

EVOThings IoT app
https://evothings.com/

This topic on this forum
viewtopic.php?f=12&t=1524&start=10

LAN only, no good
https://www.youtube.com/watch?v=VvIoBFLj2Xo

Re: 8266 <- -> data, connect to internet (not just LAN)

PostPosted: Mon Oct 26, 2015 3:15 am
by eduperez
If you manage to make it working inside your LAN, then you just need to follow some steps to make it work from outside:
* Configure your router's DHCP server so your device always gets the same IP address.
* Configure your router to forward one of the external ports (does not have to be port 80) to port 80 on the device.

Now, try to access your device from outside your network, using your external IP address. If that works, you will probably want to assign a name to your (dynamic) external IP address; you will need a DDNS service, such as http://www.duckdns.org/ (there are many others).

Re: 8266 <- -> data, connect to internet (not just LAN)

PostPosted: Wed Oct 28, 2015 4:36 am
by bluegiraffe
The problem with websockets on mobile devices is that will drain your battery in no time, since it keeps the connection alive, even with no activity.

This is the reason that push protocols, like GCM - Google Cloud Messaging and the equivalents for iPhone and W10 exists.

So, in my opinion, from the phone side, receiving events from your devices should be done through one of these Push protocols. It will work even with your phone sleeping and the battery draining will be minimal.

For controlling a simple web site, without web sockets will do.