mPCIe modems

mPCIe modems

RB350 has one PCI Express Mini Card connector for 3G/LTE modules. mPCIe has USB 2.0 and Mini-SIM card support. It is also worth mentioning that the mPCIe card is supported by built-in UPS. The GSM LED indicates the state of a connection. The power supply of the mPCIe card is controlled by GPIO. Cable U.FL to SMA female connector for an external antenna is included for easy connection.

Linux has support for a lot of the mPCIe modems so usually no additional drivers are needed. mPCIe modems usually provide a few serial ports (appears as /dev/ttyACMx or /dev/ttyUSBx) for communicating with the modem via AT commands. For example for F3507g modem:

pi@pigeon:~$ ls /dev/ttyAC*
/dev/ttyACM0  /dev/ttyACM1  /dev/ttyACM2

Example AT-Commands

Accessing the modem with picocom:

apt-get install -y picocom       
picocom -b 115200 /dev/ttyACM0       

Example at commands:

at+gmi       
Dell         
OK       
at+gmm       
D5530        
OK       
at+cpin?         
+CPIN: READY         
OK       
at+cfun=1        
OK       
at+csq       
+CSQ: 17,99      
OK       
at+cfun=4        
OK       

To exit use Ctrl-a, Ctrl-x.

Connecting to the net

There are a few ways to connect to the net. The first one is to use the CDC Ethernet interface. The other way is to use pppd daemon on one of serial port (/dev/ttyACM*). To check the possible way you can use command:

for n in `ls /sys/class/*/*{ACM,wdm,wwan}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done

For example F3507g modem returns:

wwan0 : Dell Wireless 5530 HSPA Mobile Broadband Minicard NetworkAdapter
ttyACM0 : Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem
ttyACM1 : Dell Wireless 5530 HSPA Mobile Broadband Minicard Modem 2
ttyACM2 : Dell Wireless 5530 HSPA Mobile Broadband Minicard GPS Port
cdc-wdm0 : Dell Wireless 5530 HSPA Mobile Broadband Minicard
cdc-wdm1 : Dell Wireless 5530 HSPA Mobile Broadband Minicard PC SC Port

as you can see, both ways are available in this case.

Connecting to the net via CDC Ethernet interface

In the beginning, create a script:

nano /etc/chatscripts/3g.on      

Example configuration for F3507g modem:

ABORT BUSY       
ABORT 'NO CARRIER'       
ABORT ERROR      
TIMEOUT 30       
'' AT+CFUN=1 PACSP0
AT+CPIN? READY \c OK
AT+CGDCONT=1,"IP","virgin-internet" OK       
\d\d\d\d\d\d\dAT*ENAP=1,1 OK         

Example configuration for F3607gw modem::

ABORT BUSY       
ABORT 'NO CARRIER'       
ABORT ERROR
TIMEOUT 30       
'' AT+CFUN=1 OK
AT+CPIN? READY \c OK
AT+CGDCONT=1,"IP","virgin-internet" OK       
\d\d\d\d\d\d\dAT*ENAP=1,1 OK         

Replace "virgin-internet" with your APN. Then run this command:

/usr/sbin/chat -V -v -f /etc/chatscripts/3g.on >/dev/ttyACM0 </dev/ttyACM0       

After that, the GSM LED should turn on.
Launch dhclient:

dhclient wwan0       

The connection is ready:

pi@pigeon:~# ifconfig wwan0
wwan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.203.38.218  netmask 255.255.255.248  broadcast 10.203.38.223
        ether 02:80:37:ec:02:00  txqueuelen 1000  (Ethernet)
        RX packets 33  bytes 15553 (15.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35  bytes 3438 (3.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Turn off script:

nano /etc/chatscripts/3g.off         

The content of the script:

ABORT ERROR      
TIMEOUT 5        
'' AT+CFUN=4 OK      

Running the script:

/usr/sbin/chat -V -v -f /etc/chatscripts/3g.off >/dev/ttyACM0 </dev/ttyACM0      

the GSM LED should turn off.

Connecting to the net via pppd

For the pppd, the easiest way is to use wvdial.

apt-get install wvdial

Next step is edit config file /etc/wvdial.conf

nano /etc/wvdial.conf

Example config for F3507g modem:

[Dialer on]
Modem = /dev/ttyACM0
Init1 = AT+CFUN=1

[Dialer off]
Modem = /dev/ttyACM0
Init1 = AT+CFUN=4

[Dialer connect]
New PPPD = yes
Stupid Mode = 1
Modem Type = USB Modem
Modem = /dev/ttyACM0
Init1 = AT 
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","virgin-internet"
Baud = 460800
ISDN = 0
Phone = *99#
Password = { }
Username = { } 

You have to check a manual of your modem and change accordingly Init1 command in sections [Dialer on] and [Dialer off]. Replace "virgin-internet" with your APN. To turn on module use command:

wvdial on

the GSM LED should turn off.

To connect use command:

wvdial connect &

If everything goes correctly you should see a new connection:

pi@pigeon:~# ifconfig ppp0
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.201.28.240  netmask 255.255.255.255  destination 10.64.64.64
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 4  bytes 58 (58.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5  bytes 85 (85.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The connection is ready.

SMS with gammu

Install gammu:

apt-get install gammu        
gammu-config         

Configuration:

"port=/dev/ttyACM0"      
"connection=at"      

Example coomands:

gammu --identify         
echo "Test" | gammu sendsms TEXT _destination_number_
gammu getallsms      

Power supply control

The mPCIe power supply is controlled using GPIO1.

GPIO1 = 0 turns on the power supply.

gpio write 1 0

GPI1 = 1 turns off the power supply.

gpio write 1 1

Links

Back to Top