1
\$\begingroup\$

I can see that ATMEL has this WiFi module - ATWINC1500. I know that modules such as the ESP8266 are not capable to listen to requests outside the network ( which means I am not at home and I want to control it from my iPhone).

I am trying to understand what keyword should I look for in the data sheet, to understand if I can set it as a station that listen to HTTP requests all the time.

Why for example with ESP you have to set a port forwarding to do this, and when you buy a smart coffee machine it can be done without any hassle ? what is the difference in the hardware that enables these companies to make smart device that are accssesible without all this port forwarding dirty technical hassle ? How is that my computer is accessible from anywhere and these modules are not?

\$\endgroup\$
16
  • 1
    \$\begingroup\$ It depends on how you program it. Its just a wifi module, if you have a tcp/ip stack with full http server running constantly on it there is no reason it can't serve http requests. \$\endgroup\$
    – PlasmaHH
    Commented Mar 16, 2017 at 9:25
  • 6
    \$\begingroup\$ A Wifi module by itself (no application software running on it) doesn't care about HTTP, a Wifi module cannot even "see" if you're doing HTTP, FTP, SSH or whatever. That's because a WiFi module concerns itself with the connection and not the data being transported over that connection. To understand this better, familiarize yourself with the OSI model: en.wikipedia.org/wiki/OSI_model and see how it is layered. The Wifi module is part of the one or 2 bottom layers. HTTP is much higher up (layer 5 if I'm not mistaking). \$\endgroup\$ Commented Mar 16, 2017 at 9:26
  • 5
    \$\begingroup\$ To listen to HTTP requests you need: an IP Address, a TCP/IP Stack and an HTTP Server. To implement an HTTP server, you need a fair amount of ROM and RAM. The TCP/IP stack is already integrated in the ESP8266. It should be possible to implement an HTTP server with the ESP8266. But maybe you are mixing things up, if you want to control it from outside of your home (over the Internet) you need access to your public IP address and set up some sort of port forwarding to get external request to your internal HTTP server. \$\endgroup\$
    – Arsenal
    Commented Mar 16, 2017 at 9:29
  • 3
    \$\begingroup\$ Because port forwarding can be a hassle to setup, these products don't use that ! Instead they connect to the manufacturer's server. So the connection is initiated from the client side, the client logs in, the data connection is present and the server can communicate with the client. \$\endgroup\$ Commented Mar 16, 2017 at 9:41
  • 2
    \$\begingroup\$ Remember that the S in IoT stands for Security. Now, this has turned into a pretty off-topic question, it seems. \$\endgroup\$
    – pipe
    Commented Mar 16, 2017 at 9:50

1 Answer 1

4
\$\begingroup\$

This is not going to be a complete answer, because this whole issue dominates IoT development and is too big to fit here. Instead it's going to be a list of places to start finding the solutions. Put words in bold into your search engine.

The key issue is NAT. This normally makes it impossible to initiate connections into an end-user network, only outbound connections are possible. UDP is supported via "pseudo-connections" which must pass a certain amount of traffic to be kept open. NAT is widely deployed due to shortage of IPV4 addresses.

NAT may apply to Wifi (for devices on consumer premises) or GSM. It's very rare to get a GSM network configured to allow inbound TCP with public IP addresses.

So there are various workarounds. HTTP long polling, where the device connects to a server and leaves the connection open. Systems for opening ports through NAT such as STUN and UPnP.

Lots of IoT systems seem to use MQTT, which wraps some of this stuff up for you.

Another alternative is to deploy IPv6 and get your devices proper publicly routable IPv6 addresses to which inbound connections can be made. However this depends on getting your clients to upgrade their networks.

It's worth looking for teardown or reverse engineering of existing devices, such as a coffee machine (LAN only, not available from work - so it doesn't address the inbound connection issue of your question at all) or lightbulbs (disastrously insecure).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.