I am building an IoT device that needs to be deployed at a remote location. There is no fixed line accessibility having me resort to a 3G/4G wifi dongle for connectivity. Are there any alternatives here?

The device needs to supply real-time sensor data and video footage on demand. I need a way to connect to the device from the internet. Following are the options that come to mind:

  1. Open a port on the dongle, setup DDNS and receive external requests. I have heard that this is not possible to setup using 3G/4G dongles.
  2. Establish a connection from the device to a server with a public address and recieve reverse requests through the established connection as a tunnel. The server can then act as proxy to the device.
  3. I have heard of some kind of VPN based solutions but am unaware of the details

Would you know if any of the above options are feasible or of a better approach? Apart from feasibility and security, I'm particularly interested in the approach with minimum transmission overheads, as the device needs to communicate a good quantity of real-time data.

  • Could you consider LoRa? What distance is involved? Is the sensor in or out doors? If indoors, could you run a cable to an antenna? I think that more info would help. For instance, I am currently considering flying a drone over remote sensors, to collect data by BLE. Jan 8 '20 at 6:39
  • 1
    @mawg LoRA doesn't have anywhere near the bandwidth to transmit video.
    – hardillb
    Jan 8 '20 at 7:55
  • Oops, I missed that. You could try to get fancy with compression, transmitting only deltas in the image, etc, but I agree with you. Thanks for pointing that out. Jan 8 '20 at 7:57

All 3 of the options you have described are valid options, but they all depend on what infrastructure you already have or are prepared to deploy and how much you want to spend.

  1. DDNS - this will very much depend on the cellular network you are using and they type of contract you have with them. Most cellular data providers use something called Carrier Grade NAT (CNAT), this means that devices get issued IPv4 addresses from the RFC1918 ranges which are not directly routable to/from the internet. All traffic goes through a NAT gateway which maps traffic to a single public IP address. This means that there is no direct way to connect to the device from the internet. Some Cellular providers do offer contracts (sometimes called Machine 2 Machine) which include a fully routed IPv4 address that would mean you could access the device, but these days contracts tend to be a LOT more expensive than the normal sort and with the world running out of public IPv4 addresses only likely to get more so. If your cellular provider supports IPv6 then it may be possible to access the device that way.

  2. Device initiated outbound connection - This solves most/all the problems I described in option 1. It requires you to have a central server hosted on a public accessable IP address (these days normally on a cloud hosting provider). Once a TCP connection is created any data you want can be sent back and forward over that connection. Examples of protocols that use this technique include things like MQTT which is a pub/sub messaging protocol.

  3. VPN - This is just a special case version of option 2. In this case the public server just encapsulates other protocols and sends them over the connection the device made to the public VPN endpoint. They also tend to add a layer of encryption that helps hide the data you are sending from the other networks that it crosses.

Both options 2 & 3 will add a little bit of overhead, but a modern implementation shouldn't impact performance too much.

  • This is great. Thanks. Jan 9 '20 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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