User avatar
liudr
Posts: 672
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Can someone recommend a popular GSM modem?

Sat Jun 18, 2016 10:34 pm

I have a potential project that needs a GSM modem to upload data. I've done this sort of work on Arduino and can find a number of sources with Arduino shield form factor. On the other hand, I couldn't find information on any popular GSM pi hat. Am I missing something obvious?

Here is one module I'm interested in using. Adafruit seems to be placing this model at #1 or #2 in their list of GSM devices:

https://www.adafruit.com/products/2542

Didn't find RPI library though. Any advice?
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

User avatar
liudr
Posts: 672
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Can someone recommend a popular GSM modem?

Sun Jun 19, 2016 3:39 am

Did I post on the wrong forum? Anyway, I found some readings regarding this module made by Adafruit. It's probably going to work. I thought there were some popular GSM modems for raspberry pi, like a gert board or hat. On a second thought, most PIs just stay indoors with networking readily available. Not much need for cell connection. If I get this project going, I'm sure I'll post something back.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

User avatar
buja
Posts: 496
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: Can someone recommend a popular GSM modem?

Sun Jun 19, 2016 8:18 am

I have a Huawei E173 GSM USB modem. I haven't done much with it, but I managed to send SMS messages from the Pi with it, using the Gammu package.

More info: http://www.mattiasnorell.com/send-sms-f ... pberry-pi/

So not a Pi specific GPIO device, but a general GSM modem, which you can also use on any PC with a USB port.

User avatar
liudr
Posts: 672
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Can someone recommend a popular GSM modem?

Mon Jun 20, 2016 2:53 am

Hey,

Thank you for the info. So if I understand correctly, your Huawei modem is a ttyUSB device on the RPI so it doesn't need any "driver". I've since looked at several USB 3G modems online, and they all seem to behave like serial ports. I'll grab one and start testing with my RPI. No point spending 2X or 3X for a bare module at adafruit if I can get a USB device at $15 that works seamlessly on all operating systems.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

medicdude
Posts: 11
Joined: Sun Jun 19, 2016 4:35 am

Re: Can someone recommend a popular GSM modem?

Mon Jun 20, 2016 5:14 am

Just did a cursory glance through Amazon and it looks like all "new" GSM usb dongles are around the 40$+ range. If anyone can find a decent new/used product for cheaper, please post it here.

Note that your wireless provider may be able to offer you a deal for a 'free' dongle as a new device with contract, they were fairly popular several years ago but I suspect the smartphone market has cut down on their popularity.

User avatar
buja
Posts: 496
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: Can someone recommend a popular GSM modem?

Mon Jun 20, 2016 5:20 am

liudr wrote:Hey,

Thank you for the info. So if I understand correctly, your Huawei modem is a ttyUSB device on the RPI so it doesn't need any "driver". I've since looked at several USB 3G modems online, and they all seem to behave like serial ports. I'll grab one and start testing with my RPI. No point spending 2X or 3X for a bare module at adafruit if I can get a USB device at $15 that works seamlessly on all operating systems.
Yes, you understand correctly (port is /dev/ttyUSB0). Gammu knows the Huawei E173 (and a lot of others).
I paid 40 euros for it, say 45 dollars, in a Dutch webshop. Cheaper is possible (http://nl.aliexpress.com/w/wholesale-huawei-e173.html).

edo1
Posts: 136
Joined: Sun Jun 15, 2014 3:33 pm
Location: Russia

Re: Can someone recommend a popular GSM modem?

Mon Jun 20, 2016 6:32 am

liudr wrote:So if I understand correctly, your Huawei modem is a ttyUSB device on the RPI so it doesn't need any "driver".
If you need internet connection only, you could use "NIC mode". You do not need any additional software tuning, only few lines in /etc/network/interfaces

Code: Select all

allow-hotplug usb0
iface usb0 inet dhcp
Many of present modems work this way out of box, some need additional (very simple) configuration.
I use Megafon M100-3 4G modem (rebranded ZTE MF823), to enable autoconnect I ran

Code: Select all

[email protected] ~ $ curl "http://192.168.0.1/goform/goform_set_cmd_process?goformId=SET_BEARER_PREFERENCE&BearerPreference=NETWORK_auto"
{"result":"success"}
It is all!

And 4G is awesome!

Code: Select all

[email protected] ~ $ ping 8.8.8.8 -c 3
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=47 time=46.8 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=47 time=42.8 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=47 time=41.7 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 41.765/43.828/46.897/2.212 ms
[email protected] ~ $ curl https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/patch-4.7-rc4.xz > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 5394k  100 5394k    0     0  2399k      0  0:00:02  0:00:02 --:--:-- 2511k

User avatar
liudr
Posts: 672
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Can someone recommend a popular GSM modem?

Mon Jun 20, 2016 6:11 pm

Thank you edo1! What I'm trying to do is a data logger that uploads occasionally with small amount of data, sometimes over regions with only 2G coverage.

If I use your method, how do I hang up the modem to save bandwidth?

I've read about some scripts that do "pon and poff" to turn on and off ppp over the modem. Everything is in the mail but I expect to do some testing within a week.

I remember that sometime in the past you had to pay to do a phone tether to have your phone act as USB modem. I wonder if this works the same way as USB 3G dongles on linux.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

edo1
Posts: 136
Joined: Sun Jun 15, 2014 3:33 pm
Location: Russia

Re: Can someone recommend a popular GSM modem?

Mon Jun 20, 2016 8:32 pm

liudr wrote:If I use your method, how do I hang up the modem to save bandwidth?

I've read about some scripts that do "pon and poff" to turn on and off ppp over the modem.
there are a lot of ways, e.g. you could use "ifdown usb0", "ifup usb0".

but I'm pretty sure you shouldn't hangup modem, linux system doesn't produce traffic by himself (raspbian has ntpd running by default, but it consume a very little amount of traffic and you could stop it if you want).

Code: Select all

[email protected]:~# ifconfig usb0; uptime
usb0      Link encap:Ethernet  HWaddr 36:4b:50:b7:ef:2d  
          inet addr:192.168.0.182  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:195952 errors:12 dropped:0 overruns:0 frame:0
          TX packets:189498 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12593870 (12.0 MiB)  TX bytes:15747704 (15.0 MiB)

 22:21:03 up 18 days,  9:46,  3 users,  load average: 0.00, 0.01, 0.05
this host has openvpn running in 24/7 mode and it consume 1-2Mb per day.
without openvpn traffic should be about zero.

User avatar
liudr
Posts: 672
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Can someone recommend a popular GSM modem?

Thu Jun 30, 2016 6:22 am

medicdude wrote:Just did a cursory glance through Amazon and it looks like all "new" GSM usb dongles are around the 40$+ range. If anyone can find a decent new/used product for cheaper, please post it here.

Note that your wireless provider may be able to offer you a deal for a 'free' dongle as a new device with contract, they were fairly popular several years ago but I suspect the smartphone market has cut down on their popularity.
I got my Huawei E173 a few days ago from ebay.com The seller sold out the one I got (<$20) but other sellers are selling for ~$20.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: Can someone recommend a popular GSM modem?

Thu Jun 30, 2016 7:07 am

I use a huawei E156G and it works a treat. I use WVDial to make the connection. You can even set the interfaces file to keep the connection alive and dial as soon as the device is plugged in.

Here is my wvdial.conf
[Dialer giffgaff]
Init2 = ATZ
Init3 = ATQ0 V1 &D2 &C1 S0=0 +IFC=2,2
;Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB0
username = giffgaff
Password = password
Dial Command = ATDT
Baud =466600
;Baud = 9600
Init4 = AT+CGDCONT=1,"IP","giffgaff.com"
And here is the entry from my interfaces file:

Code: Select all

iface ppp0 inet wvdial
    provider giffgaff
You can programatically turn the connection on and off with:

Code: Select all

sudo ifdown ppp0
sudo ifup ppp0

User avatar
liudr
Posts: 672
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Can someone recommend a popular GSM modem?

Fri Jul 01, 2016 12:15 am

kghunt,

Thanks.

Is the "provider giffgaff" on the same line as the iface or on the next line? Will these lines auto start the connection upon startup?

Mine is:

auto ppp0
iface ppp0 inet wvdial

and it doesn't auto connect upon startup.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: Can someone recommend a popular GSM modem?

Fri Jul 01, 2016 4:59 am

Provider is underneath. It tells wvdial which config to dial.

maciek
Posts: 1
Joined: Thu Dec 29, 2016 11:50 pm

Re: Can someone recommend a popular GSM modem?

Thu Dec 29, 2016 11:54 pm

Hi,

Anybody had any success with USB GPRS sticks with USA carriers specifically? if so could you please recommend a specific modem and a provider,

I tried with a generic stick from ebay with TMobile, ATT and Verizon - no luck so far.

cheers
maciek

Return to “Automation, sensing and robotics”