Need to connect remotely to a device using cellular GPRS gateway.

Device supports RS-232 and USB. It boils done to two options:

1.- Serial Over TCP/IP (Serial to Ethernet - to GPRS, or Serial to GPRS)

2.- USB Over TCP/IP (USB to Ethernet - GPRS, or USB to GPRS)

Note that there are gateways that allow transparent communication from TCP network communications to serial port. Example: Serial to GPRS Gateway.

End goal is to have a virtual serial tty port. Tools like Socat in Linux allows this.

So application programs will think that the device is connected locally to the computer.

Which one should I use? People tell me definitely Serial over IP due to USB latencies issues...

P.S. I'm talking about Virtual Serial Port.

  • \$\begingroup\$ Neither. If at all possible, transmit the payload data over Ethernet, without any overhead important only to the wire interface at the far end. But serial may not have any overhead so on that side there is not a big conceptual difference. In terms of which wire to use, likely the one more available. Ethernet and USB have similar latency concerns, so unless the implementation is poor you probably won't notice the difference between their combination vs. just Ethernet. \$\endgroup\$ – Chris Stratton Aug 2 '14 at 18:01
  • \$\begingroup\$ @ChrisStratton Are you suggesting to use: Serial to Ethernet then Ethernet to GPRS? \$\endgroup\$ – jacktrades Aug 2 '14 at 19:22
  • \$\begingroup\$ Serial most closely resembles a TCP/IP socket connection, so I suppose I would recommend going that route. \$\endgroup\$ – Jay Carlson Aug 3 '14 at 4:43
  • \$\begingroup\$ Why not just compare specs? bb-elec.com/Products/Ethernet-Serial-Servers-Gateways/… ad bb-elec.com/Products/USB-Connectivity/USB-Over-Ethernet.aspx \$\endgroup\$ – Dave Oct 2 '14 at 0:22

I don't know what "Serial over IP" is -- TCP/IP provides a bidirectional socket connection that can carry many different application protocols. I've never seen an off-the-shelf RS-232-to-GPRS box. You'll probably have to build something custom -- either using a GPRS module designed to interface with an MCU (these typically have a built-in TCP/IP stack, so the MCU used can be quite basic), or a USB GPRS modem hooked up to an embedded board (my recommendation). If you're building a one-off prototype, I'd recommend getting something like an OLinuXino imx233 or a Raspberry Pi, and getting a $25 Huwei USB-GPRS modem.

  • \$\begingroup\$ GPRS routers, or 3G routers make TCP to serial forwarding. \$\endgroup\$ – jacktrades Aug 2 '14 at 18:59
  • \$\begingroup\$ I agree with the USB/GPRS approach simply due to the higher bandwidth that USB offers. Especially with 4G connections (if you're pushing streaming content for example.) \$\endgroup\$ – cowboydan Mar 2 '15 at 0:04

The 3G gateway you linked in have a little bit of limitation: it won't work if your cellular carrier don't give you a publicly accessible IP address. Also I think this device will be more expensive than what I am going to suggest, as I use all COTS parts widely available everywhere.

My solution would be a "Whatever-over-IP-over-VPN-over-3G-Internet" and can work fairly well even with carrier-grade NAT in place on the 3G part (as all Chinese cellular carriers do). All you need is your target device, Raspberry Pi, a USB 3G dongle and a publicly accessible server. Connect the device to your Raspberry Pi using either USB or UART, as well as the 3G dongle. You may be able to get one of those cheap dongles when you buy the SIM card with the data plan.

When the Pi boots it dials up to the 3G network and connects to the VPN to your server. This VPN can be anything from PPTP to L2TP/IPSec or even a simpler SSH tunnel. Now you can control your device with whatever protocol you like that is based on IP as the VPN tunnel will carry it. Either simple UART-over-IP or a more elaborate Web-based control interface can be used. The VPN is what penetrates the NAT and make this solution stack work no matter what.


I used this solution with GPRS Gateway - worked, but it is no low cost http://www.eltima.com/serial-over-ip/

P.S. I'm not accosiated with the website, just described the experience I had.

  • 1
    \$\begingroup\$ I'd suggest that you add in the answer that you aren't associated with this website (or if you are, add that too) \$\endgroup\$ – CalvT Mar 27 '17 at 11:03
  • \$\begingroup\$ thanks, I've added. And I am not accosiated with the website somehow. \$\endgroup\$ – Constance Garcia Mar 27 '17 at 11:08

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.