Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
2
answers
2164
views
How to assign physical USB modem to NetworkManager connection
I work on dual independent modem device (yocto based). I would like to assign each to a different NM connection. I register them using cmd: ``` nmcli c add type gsm ifname cdc-wdm[0|1] con-name mdm1orange apn internet ``` It works. The problem is, ```cdc-wdm``` suffix comes from device registration/...
I work on dual independent modem device (yocto based). I would like to assign each to a different NM connection. I register them using cmd:
nmcli c add type gsm ifname cdc-wdm[0|1] con-name mdm1orange apn internet
It works. The problem is, -wdm
suffix comes from device registration/turn on order. I would like to associate it with USB port (they will use different operators SIMs APNs, configs etc), so I've created an udev rule:
SUBSYSTEM=="usbmisc", SUBSYSTEMS=="usb", KERNELS=="1-1.3:1.4", SYMLINK+="modem2", TAG+="systemd"
SUBSYSTEM=="usbmisc", SUBSYSTEMS=="usb", KERNELS=="1-1.4:1.4", SYMLINK+="modem1", TAG+="systemd"
It does work, I can see /dev/modem1
and /dev/modem2
being registered, but calling:
nmcli c add type gsm ifname modem[1|2] con-name mdm1orange apn internet
Just fails. NM does not have a clue which device I would like to use in connection.
So how can I assign based-on-usb-port-alias or index (with udev or anything else) to modem network interface, not just the /dev/
symlink? It would be nice to have also a WWAN interface alias created too.
Thanks!
JWZ1996
(51 rep)
Oct 6, 2022, 04:55 PM
• Last activity: Feb 26, 2023, 03:44 AM
0
votes
0
answers
338
views
Multiple USB Modems - Binding cdc-wdmx to symlink
First question here, long story short I have 3 different USB Cellular(GSM) modems and I want to ensure the connection profiles for each SIM (as the APNs differ) always go to the same modem/sim combo. The issue here is that due to the nature of USB the interfaces cdc-wdmx change on reboot and as the...
First question here, long story short I have 3 different USB Cellular(GSM) modems and I want to ensure the connection profiles for each SIM (as the APNs differ) always go to the same modem/sim combo. The issue here is that due to the nature of USB the interfaces cdc-wdmx change on reboot and as the nmcli connection are tied to the interface name the connections dont come up.
So I have created symlinks using udev rules to point to the physical USB ports, the idea being modem 1 will always be the device plugged into the first USB port. This works and the symlinks point correctly however, I cant use the symlinks for the connection profiles for some reason.
To clarify a bit take the following example:
Modem & SIM combo A is vodafone. on boot up modem SIM combo A is assigned cdc-wdm0, this is the name that shows in NMCLI. I create a connection profile for vodafone with the apn 'internet' pointing at cdc-wdm0.The connection works.
Modem and SIM combo B is O2. On boot up medem SIM combo B is assigned cdc-wdm1, this is the name that also shows in NMCLI. I create a connection profile for O2 with the APN 'mobile.o2.co.uk' pointing at cdc-wdm1.The connection works.
But after a system reboot:
- Moden and SIM combo A is now assigned cdc-wdm1
- Modem and SIM combo B is now assigned cdc-wdm0
As a result my connections now don't work as the wrong APN's are configured.
My udev rules for the modems are as below, and these do work:
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-1:1.4", SYMLINK+="3rd-mdm"
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-4.4", SYMLINK+="4th-mdm"
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-2:1.4", SYMLINK+="1st-mdm"
SUBSYSTEM=="usbmisc", ACTION=="add", KERNEL=="cdc-wdm*", KERNELS=="1-4.3", SYMLINK+="2nd-mdm"
and bthe symlink shows under a udevadm info:
[root@localhost rules.d]# udevadm info /dev/cdc-wdm1
P: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.3/1-4.3:1.4/usbmisc/cdc-wdm1
N: cdc-wdm1
**S: 2nd-mdm**
E: DEVLINKS=/dev/2nd-mdm
E: DEVNAME=/dev/cdc-wdm1
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.3/1-4.3:1.4/usbmisc/cdc-wdm1
E: ID_MM_CANDIDATE=1
E: MAJOR=180
E: MINOR=177
E: SUBSYSTEM=usbmisc
E: USEC_INITIALIZED=88077
Can anyone please advise how I can get round this please?
ConchMonster
(1 rep)
Dec 8, 2022, 06:02 PM
• Last activity: Dec 15, 2022, 06:27 AM
3
votes
3
answers
13453
views
getting "bad init string" when dialing with wvdial
I'm trying to dial-up with my Huawei modem EM680 using wvdial. My modem is found properly on `/dev/ttyUSB1` but when I execute wvdial I get this: # wvdial --> WvDial: Internet dialer version 1.61 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending:...
I'm trying to dial-up with my Huawei modem EM680 using wvdial.
My modem is found properly on
/dev/ttyUSB1
but when I execute wvdial I get this:
# wvdial
--> WvDial: Internet dialer version 1.61
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 +FCLASS=0
ATQ0 V1 E1 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","m2mstatic.apn"
AT+CGDCONT=1,"IP","m2mstatic.apn"
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 +FCLASS=0
ATQ0 V1 E1 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","m2mstatic.apn"
AT+CGDCONT=1,"IP","m2mstatic.apn"
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 +FCLASS=0
ATQ0 V1 E1 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","m2mstatic.apn"
AT+CGDCONT=1,"IP","m2mstatic.apn"
ERROR
--> Bad init string.
#
Why does it say bad init string.
?
My /etc/wvdial.conf
looks like this:
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","m2mstatic.apn"
Stupid Mode = yes
Modem Type = Analog Modem
ISDN = 0
New PPPD = yes
Phone = *99#
Modem = /dev/ttyUSB1
Username = ;
Password = ;
Baud = 9600
stdcerr
(2099 rep)
Jan 4, 2014, 09:02 PM
• Last activity: Jun 20, 2022, 10:28 AM
0
votes
1
answers
691
views
Sierra Wireless GSM modem EM7455 + Android Integration Error
EM7455 connect on Single Board Computer(NanoPC-T2) through USB. I have attached AndroidRIL_5.1.11 binary files in my android and kernel source after build it and run on my android device.Below error messages received on android Log: # dmesg | grep sierra [ 1.184000] usbcore: registered new interface...
EM7455 connect on Single Board Computer(NanoPC-T2) through USB.
I have attached AndroidRIL_5.1.11 binary files in my android and kernel source after build it and run on my android device.Below error messages received on android Log:
# dmesg | grep sierra
[ 1.184000] usbcore: registered new interface driver sierra_net
[ 40.552000] usbcore: registered new interface driver sierra
[ 40.564000] sierra: v.1.7.42_android_generic_2:USB Driver for Sierra Wireless USB modems
[ 47.308000] sierra_net: module is already loaded
[ 87.844000] sierra 1-1.1:1.0: Sierra USB modem converter detected
[ 87.872000] sierra_remove_sysfs_attrs
usb_get_serial_port_data(port_tmp) = 0xd8c90000
[ 87.880000] kfree at sierra_remove_sysfs_attrs
[ 87.884000] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
[ 87.892000] sierra 1-1.1:1.0: device disconnected
[ 90.920000] sierra 1-1.1:1.0: Sierra USB modem converter detected
[ 90.948000] sierra_remove_sysfs_attrs
usb_get_serial_port_data(port_tmp) = 0xda6b8d80
[ 90.956000] kfree at sierra_remove_sysfs_attrs
[ 90.960000] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
[ 90.968000] sierra 1-1.1:1.0: device disconnected
127|root@nanopi2:/ # dmesg | grep sierra
[ 1.184000] usbcore: registered new interface driver sierra_net
[ 40.552000] usbcore: registered new interface driver sierra
[ 40.564000] sierra: v.1.7.42_android_generic_2:USB Driver for Sierra Wireless USB modems
[ 47.308000] sierra_net: module is already loaded
[ 87.844000] sierra 1-1.1:1.0: Sierra USB modem converter detected
[ 87.872000] sierra_remove_sysfs_attrs usb_get_serial_port_data(port_tmp) = 0xd8c90000
[ 87.880000] kfree at sierra_remove_sysfs_attrs
[ 87.884000] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
[ 87.892000] sierra 1-1.1:1.0: device disconnected
[ 90.920000] sierra 1-1.1:1.0: Sierra USB modem converter detected
[ 90.948000] sierra_remove_sysfs_attrs
usb_get_serial_port_data(port_tmp) = 0xda6b8d80
[ 90.956000] kfree at sierra_remove_sysfs_attrs
[ 90.960000] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
[ 90.968000] sierra 1-1.1:1.0: device disconnected
Anyone known how to solve this error,help me.
Thanks!
Prasanth S
(3 rep)
Jun 21, 2017, 10:32 AM
• Last activity: Sep 30, 2020, 06:10 PM
2
votes
0
answers
1966
views
GSM connection fails - NetworkManager
I am trying to achieve the gsm connection through my single board computer. I think I set up everything. Below is the output of the modem info: -------------------------------- General | dbus path: /org/freedesktop/ModemManager1/Modem/0 | device id: 10c51b4b5511adedf5c6df0380e7acab4ce64f5a ---------...
I am trying to achieve the gsm connection through my single board computer. I think I set up everything. Below is the output of the modem info:
--------------------------------
General | dbus path: /org/freedesktop/ModemManager1/Modem/0
| device id: 10c51b4b5511adedf5c6df0380e7acab4ce64f5a
--------------------------------
Hardware | manufacturer: QUALCOMM INCORPORATED
| model: QUECTEL Mobile Broadband Module
| firmware revision: EC25AUFAR06A01M4G
| carrier config: default
| h/w revision: 10000
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: 861585041067073
--------------------------------
System | device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2
| drivers: option1, qmi_wwan
| plugin: Quectel
| primary port: cdc-wdm0
| ports: ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net),
| ttyUSB3 (at)
--------------------------------
Numbers | own: 61451690967
--------------------------------
Status | unlock retries: sim-pin (3), sim-pin2 (0), sim-puk (10), sim-puk2 (0)
| state: enabled
| power state: on
| signal quality: 0% (cached)
--------------------------------
Modes | supported: allowed: 2g; preferred: none
| allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 2g, 3g; preferred: 3g
| allowed: 2g, 3g; preferred: 2g
| allowed: 2g, 4g; preferred: 4g
| allowed: 2g, 4g; preferred: 2g
| allowed: 3g, 4g; preferred: 3g
| allowed: 3g, 4g; preferred: 4g
| allowed: 2g, 3g, 4g; preferred: 4g
| allowed: 2g, 3g, 4g; preferred: 3g
| allowed: 2g, 3g, 4g; preferred: 2g
| current: allowed: 2g, 3g, 4g; preferred: 4g
--------------------------------
Bands | supported: egsm, dcs, pcs, g850, utran-1, utran-5, utran-8, utran-2,
| eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
| eutran-28, eutran-40
| current: egsm, dcs, pcs, g850, utran-1, utran-5, utran-8, utran-2,
| eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
| eutran-28, eutran-40
--------------------------------
IP | supported: ipv4, ipv6, ipv4v6
--------------------------------
3GPP | imei: 861585041067073
| registration: idle
--------------------------------
3GPP EPS | ue mode of operation: csps-2
--------------------------------
SIM | dbus path: /org/freedesktop/ModemManager1/SIM/0
It seems like no signal shown on Status section. And the output of the
nmcli con
:
NAME UUID TYPE DEVICE
cellular d811a35a-70fc-3716-84e1-a3578d10cc1e gsm cdc-wdm0
resin-wifi-01 a58e405d-fdc2-3649-9339-5bbaea740c76 wifi wlan0
supervisor0 8148d985-dc90-4f8c-8e38-62f83f4f13ba bridge supervisor0
And the wired thing is that the gsm is always **connecting** (not connected once):
cdc-wdm0: connecting (prepare) to cellular
"cdc-wdm0"
gsm (option1, qmi_wwan), hw
I tried to manually up the cellular:
root@6f5afca:~# nmcli c up cellular
Error: Connection activation failed: Network registration timed out
Up to this point, I tried everything. I tested the SIM with my phone and it worked properly. I have no idea why it is not connected.
tony sasa
(21 rep)
Sep 20, 2020, 12:28 PM
7
votes
1
answers
7438
views
GSM device unavailable in NetworkManager
I've been trying for the last few days to set up a GSM connection on my new ubuntu box. However, I can't seem to get Network Manager to manage it correctly. The box is a compulab fitlet2 and the cell card is a simcom 7100A. $ nmcli d DEVICE TYPE STATE CONNECTION enp2s0 ethernet connected enp2s0 enp3...
I've been trying for the last few days to set up a GSM connection on my new ubuntu box. However, I can't seem to get Network Manager to manage it correctly. The box is a compulab fitlet2 and the cell card is a simcom 7100A.
$ nmcli d
DEVICE TYPE STATE CONNECTION
enp2s0 ethernet connected enp2s0
enp3s0 ethernet connected Wired connection 1
tap0 tun connected tap0
wlp1s0 wifi connected MSI WiFi 2.4Ghz
cdc-wdm1 gsm unavailable --
lo loopback unmanaged --
$ lshw
*-usb:1
description: Generic USB device
product: SimTech, Incorporated
vendor: SimTech, Incorporated
physical id: 2
bus info: usb@1:8.2
version: 2.32
serial: 0123456789ABCDEF
capabilities: usb-2.00
configuration: driver=qmi_wwan maxpower=500mA speed=480Mbit/s
$ lspci
00:00.0 Host bridge: Intel Corporation Device 5af0 (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Device 5a84 (rev 0b)
00:0e.0 Audio device: Intel Corporation Device 5a98 (rev 0b)
00:0f.0 Communication controller: Intel Corporation Device 5a9a (rev 0b)
00:12.0 SATA controller: Intel Corporation Device 5ae3 (rev 0b)
00:13.0 PCI bridge: Intel Corporation Device 5ad8 (rev fb)
00:13.1 PCI bridge: Intel Corporation Device 5ad9 (rev fb)
00:13.2 PCI bridge: Intel Corporation Device 5ada (rev fb)
00:15.0 USB controller: Intel Corporation Device 5aa8 (rev 0b)
00:18.0 Signal processing controller: Intel Corporation Device 5abc (rev 0b)
00:18.1 Signal processing controller: Intel Corporation Device 5abe (rev 0b)
00:18.2 Signal processing controller: Intel Corporation Device 5ac0 (rev 0b)
00:18.3 Signal processing controller: Intel Corporation Device 5aee (rev 0b)
00:19.0 Signal processing controller: Intel Corporation Device 5ac2 (rev 0b)
00:19.1 Signal processing controller: Intel Corporation Device 5ac4 (rev 0b)
00:19.2 Signal processing controller: Intel Corporation Device 5ac6 (rev 0b)
00:1b.0 SD Host controller: Intel Corporation Device 5aca (rev 0b)
00:1c.0 SD Host controller: Intel Corporation Device 5acc (rev 0b)
00:1e.0 SD Host controller: Intel Corporation Device 5ad0 (rev 0b)
00:1f.0 ISA bridge: Intel Corporation Device 5ae8 (rev 0b)
00:1f.1 SMBus: Intel Corporation Broxton SMBus Controller (rev 0b)
01:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)
02:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
03:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
$ mmcli -m 0
/org/freedesktop/ModemManager1/Modem/0 (device id '036a0672f2e8521a8489d65396456527879b5df6')
-------------------------
Hardware | manufacturer: 'QUALCOMM INCORPORATED'
| model: 'SIMCOM_SIM7100A'
| revision: 'M9615A-CETWTBZM-6.0.15255 1 [May 13 2016 01:00:00]'
| supported: 'gsm-umts
| lte
| gsm-umts, lte'
| current: 'gsm-umts, lte'
| equipment id: '014339000192712'
-------------------------
System | device: '/sys/devices/pci0000:00/0000:00:15.0/usb1/1-8/1-8.2'
| drivers: 'option1, qmi_wwan'
| plugin: 'SimTech'
| primary port: 'cdc-wdm1'
| ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), wwp0s21f0u8u2i5 (net), cdc-wdm1 (qmi), ttyUSB3 (at)'
-------------------------
Numbers | own : '19708529168'
-------------------------
Status | lock: 'sim-pin2'
| unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
| state: 'searching'
| power state: 'on'
| access tech: 'umts'
| signal quality: '65' (recent)
-------------------------
Modes | supported: 'allowed: 2g, 3g, 4g; preferred: none'
| current: 'allowed: 2g, 3g, 4g; preferred: none'
-------------------------
Bands | supported: 'u1900, u850, eutran-ii, eutran-iv, eutran-v, eutran-xvii'
| current: 'u1900, u850, eutran-ii, eutran-iv, eutran-v, eutran-xvii'
-------------------------
IP | supported: 'ipv4, ipv6, ipv4v6'
-------------------------
3GPP | imei: '014339000192712'
| enabled locks: 'none'
| operator id: 'unknown'
| operator name: 'unknown'
| subscription: 'unknown'
| registration: 'idle'
-------------------------
SIM | path: '/org/freedesktop/ModemManager1/SIM/0'
-------------------------
I have been trying to use this network configuration
connection.id: vzw
connection.uuid: a1b6e4cf-8799-4367-8784-1cee2ef1f05f
connection.interface-name: cdc-wdm1
connection.type: gsm
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.timestamp: 0
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries:
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: -1 (default)
-------------------------------------------------------------------------------
ipv4.method: auto
ipv4.dns:
ipv4.dns-search:
ipv4.dns-options: (default)
ipv4.dns-priority: 0
ipv4.addresses:
ipv4.gateway: --
ipv4.routes:
ipv4.route-metric: -1
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-timeout: 0
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dad-timeout: -1 (default)
-------------------------------------------------------------------------------
ipv6.method: auto
ipv6.dns:
ipv6.dns-search:
ipv6.dns-options: (default)
ipv6.dns-priority: 0
ipv6.addresses:
ipv6.gateway: --
ipv6.routes:
ipv6.route-metric: -1
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.ip6-privacy: 0 (disabled)
ipv6.addr-gen-mode: stable-privacy
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
-------------------------------------------------------------------------------
gsm.number: *99#
gsm.username: 1
gsm.password:
gsm.password-flags: 0 (none)
gsm.apn: vzwinternet
gsm.network-id: --
gsm.pin:
gsm.pin-flags: 0 (none)
gsm.home-only: no
gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
-------------------------------------------------------------------------------
but I get this error
$ nmcli con up vzw
Error: Connection activation failed: No suitable device found for this connection.
I can't tell nmcli to setup the device either
$ nmcli device connect cdc-wdm1
Error: Failed to add/activate new connection: gsm: GSM mobile broadband connection requires a 'gsm' setting
mmcli -L
$ mmcli -L
Found 1 modems:
/org/freedesktop/ModemManager1/Modem/0 [QUALCOMM INCORPORATED] SIMCOM_SIM7100A
Any help would be greatly appreciated. Thanks
zlb323
(113 rep)
Apr 10, 2018, 04:40 PM
• Last activity: Sep 2, 2020, 01:57 PM
4
votes
1
answers
12283
views
GSM modem - get signal strength
I have setup a gsm connection through network manager (USB dongle, raspberry pi). It connects and works fine by managing it with nmcli. What I would like to see is the signal strength so that I can decide what the best spot is to put the modem/computer. How is it possible to see it on CLI? I have be...
I have setup a gsm connection through network manager (USB dongle, raspberry pi). It connects and works fine by managing it with nmcli.
What I would like to see is the signal strength so that I can decide what the best spot is to put the modem/computer. How is it possible to see it on CLI? I have been unable to get this piece of data with nmcli or mmcli.
Update:
Signal is provided as part of output on mmcli:
Status | lock: 'none'
| unlock retries: 'sim-pin (3), sim-pin2 (0), sim-puk (10), sim-puk2 (10)'
| state: 'connected'
| power state: 'on'
| access tech: 'umts'
| signal quality: '51' (recent)
eftshift0
(707 rep)
May 14, 2020, 03:26 AM
• Last activity: May 15, 2020, 02:42 AM
19
votes
2
answers
56556
views
Difference between ppp0 vs wwan0
I am Running Raspian on a RaspberryPi. When I plug in a GSM modem I see two interfaces - *wwan0* & *ppp0*. - `wwan0` exists even when the GSM modem is plugged but not connected - `ppp0` exists only when the GSM modem is connected ### Questions 1. What is the difference between `wwan0` and `ppp0`, an...
I am Running Raspian on a RaspberryPi.
When I plug in a GSM modem I see two interfaces - *wwan0* & *ppp0*.
-
wwan0
exists even when the GSM modem is plugged but not connected
- ppp0
exists only when the GSM modem is connected
### Questions
1. What is the difference between wwan0
and ppp0
, and why do I see ppp0
in addition to wwan0
?
2. Why is the IP address assigned to ppp0
and not wwan0
after a connection is established?
OneGuyInDc
(353 rep)
Oct 3, 2014, 03:07 PM
• Last activity: Apr 7, 2020, 06:16 PM
3
votes
1
answers
2383
views
Identify GSM Carrier of SIM Card Inserted into a Linux Host
The SIM card used in each Linux gateway for the GSM connection will vary from location to location due to signal coverage by different GSM carrier networks. But in order to automate setting the APN when configuring a GSM connection, it's necessary to first determine the GSM carrier of a SIM inserted...
The SIM card used in each Linux gateway for the GSM connection will vary from location to location due to signal coverage by different GSM carrier networks.
But in order to automate setting the APN when configuring a GSM connection, it's necessary to first determine the GSM carrier of a SIM inserted into the gateway.
How can the carrier be identified from the CLI using ***NetworkManager***?
F1Linux
(2744 rep)
Sep 19, 2019, 09:14 AM
• Last activity: Sep 19, 2019, 04:19 PM
14
votes
3
answers
63633
views
configure gsm connection using nmcli
I have a system without X display and I want to use `nmcli` to configure my cell modem to connect to a certain apn. I can get it going with this modem just fine on Ubuntu (with X) and I would like to achieve the same now on the command line. How can I setup the connection? so far I get this: # nmcli...
I have a system without X display and I want to use
nmcli
to configure my cell modem to connect to a certain apn. I can get it going with this modem just fine on Ubuntu (with X) and I would like to achieve the same now on the command line. How can I setup the connection?
so far I get this:
# nmcli dev status
** (process:2379): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: Permissions request failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided by any .service files
DEVICE TYPE STATE
ttyUSB1 gsm disconnected
eth0 802-3-ethernet connected
stdcerr
(2099 rep)
Feb 7, 2014, 05:03 AM
• Last activity: Sep 6, 2019, 03:44 PM
9
votes
1
answers
5626
views
How to get audio in and out of Huawei GSM modems when doing a voice call?
I have a Huawei E160E and a Huawei K3765 "GSM"-modem. The question is: How to send and receive audio data placing or receiving phone/ voice calls with those modems? Both seem to support voice calls, according to specifications ([E160E][1], [K3765][2]) and according to AT-commands: Issuing AT^CVOICE?...
I have a Huawei E160E and a Huawei K3765 "GSM"-modem.
The question is: How to send and receive audio data placing or receiving phone/ voice calls with those modems?
Both seem to support voice calls, according to specifications (E160E , K3765 ) and according to AT-commands:
Issuing
AT^CVOICE?
results in
^CVOICE:0,8000,16,20
OK
(both modems the same).
Both modems provide 3 USB ports, I will call them
/dev/ttyUSB0
, /dev/ttyUSB1
, /dev/ttyUSB2
(assuming there is no other USB serial device present in the system). The K3765 additionally registers an cdc_ether
ethernet device. I am using Linux.
On both /dev/ttyUSB0
and /dev/ttyUSB2
I can place AT-commands and receive their answers; additionally, /dev/ttyUSB2
reports status messages (like ^RSSI:23
, ^BOOT:38021325,0,0,0,77
, ^SIMST:1
or ^SRVST:2
). The K3765 also reports by default when there is someone calling (RING
), the E160E does not.
On both modems, I can place calls with ATD;
and I can pick up calls with ATA
.
/dev/ttyUSB1
seems to do nothing; simply writing to this file will get no data into it, reading from it gets no data out.
How is it possible to get audio data in and out of the modem(s)?
I already found this stackexchange question and the answer by Sai Chaitanya as well as the comment to use ffmpeg
/ffplay
. ffplay
just stalls for me, and with the code snipped I can not make too much to try it out (not a programmer, and expecially not in C
, though; and don't know if this applies to my modem(s) at all).
In the internet I do not find information on how to actually get audio in and out of those devices, other than using big software packages (asterisk, for example) -- which I do not want, the question is on how to get it to work the basic way.
So, how does audio communication work with (those) Huawei GSM modems?
Modem information: Output of ATI
-command:
E160E:
Manufacturer: huawei
Model: E160X
Revision: 11.609.10.02.432
IMEI: 354765038021325
+GCAP: +CGSM,+DS,+ES
OK
K3765:
Manufacturer: huawei
Model: K3765
Revision: 11.126.03.06.00
IMEI: 353142047899771
+GCAP: +CGSM,+DS,+ES
OK
Golar Ramblar
(1929 rep)
Apr 21, 2018, 01:58 PM
• Last activity: May 21, 2019, 03:00 PM
1
votes
0
answers
1283
views
Internet connection over GSM module + PPP
I am trying to get internet connection in my raspberry pi 3 (Raspbian) with a GSM (SIM900a) module, connecting it to RXD/TXD Serial ports (/dev/ttyS0), I already got an ip address and DNSs, but I can't even ping any host, so I think it must be a routing problem. I think that what I am missing may be...
I am trying to get internet connection in my raspberry pi 3 (Raspbian) with a GSM (SIM900a) module, connecting it to RXD/TXD Serial ports (/dev/ttyS0), I already got an ip address and DNSs, but I can't even ping any host, so I think it must be a routing problem.
I think that what I am missing may be an iptables rule... something with POSTROUTING MASQUERADE? I don't know...
**ppp output in /var/log/messages:**
Oct 18 22:09:35 NULL chat: abort on (BUSY)
Oct 18 22:09:35 NULL chat: abort on (NO CARRIER)
Oct 18 22:09:35 NULL chat: abort on (VOICE)
Oct 18 22:09:35 NULL chat: abort on (NO DIALTONE)
Oct 18 22:09:35 NULL chat: abort on (NO DIAL TONE)
Oct 18 22:09:35 NULL chat: abort on (NO ANSWER)
Oct 18 22:09:35 NULL chat: abort on (DELAYED)
Oct 18 22:09:35 NULL chat: report (CONNECT)
Oct 18 22:09:35 NULL chat: timeout set to 6 seconds
Oct 18 22:09:35 NULL chat: send (ATQ0^M)
Oct 18 22:09:35 NULL chat: expect (OK)
Oct 18 22:09:35 NULL chat: ATQ0^M^M
Oct 18 22:09:35 NULL chat: OK
Oct 18 22:09:35 NULL chat: -- got it
Oct 18 22:09:35 NULL chat: send (ATZ^M)
Oct 18 22:09:35 NULL chat: timeout set to 3 seconds
Oct 18 22:09:35 NULL chat: expect (OK)
Oct 18 22:09:35 NULL chat: ^M
Oct 18 22:09:35 NULL chat: ATZ^M^M
Oct 18 22:09:35 NULL chat: OK
Oct 18 22:09:35 NULL chat: -- got it
Oct 18 22:09:35 NULL chat: send (AT+CPIN=5503^M)
Oct 18 22:09:35 NULL chat: expect (OKd)
Oct 18 22:09:35 NULL chat: ^M
Oct 18 22:09:35 NULL chat: AT+CPIN=5503^M^M
Oct 18 22:09:35 NULL chat: ERROR^M
Oct 18 22:09:38 NULL chat: alarm
Oct 18 22:09:38 NULL chat: send (AT^M)
Oct 18 22:09:38 NULL chat: expect (OK)
Oct 18 22:09:38 NULL chat: AT^M^M
Oct 18 22:09:38 NULL chat: OK
Oct 18 22:09:38 NULL chat: -- got it
Oct 18 22:09:38 NULL chat: send (ATI^M)
Oct 18 22:09:38 NULL chat: expect (OK)
Oct 18 22:09:38 NULL chat: ^M
Oct 18 22:09:38 NULL chat: ATI^M^M
Oct 18 22:09:38 NULL chat: SIM900 R11.0^M
Oct 18 22:09:38 NULL chat: ^M
Oct 18 22:09:38 NULL chat: OK
Oct 18 22:09:38 NULL chat: -- got it
Oct 18 22:09:38 NULL chat: send (ATZ^M)
Oct 18 22:09:38 NULL chat: expect (OK)
Oct 18 22:09:38 NULL chat: ^M
Oct 18 22:09:38 NULL chat: ATZ^M^M
Oct 18 22:09:38 NULL chat: OK
Oct 18 22:09:38 NULL chat: -- got it
Oct 18 22:09:38 NULL chat: send (ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0^M)
Oct 18 22:09:39 NULL chat: expect (OK)
Oct 18 22:09:39 NULL chat: ^M
Oct 18 22:09:39 NULL chat: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0^M^M
Oct 18 22:09:39 NULL chat: OK
Oct 18 22:09:39 NULL chat: -- got it
Oct 18 22:09:39 NULL chat: send (AT^M)
Oct 18 22:09:39 NULL chat: expect (OK)
Oct 18 22:09:39 NULL chat: ^M
Oct 18 22:09:39 NULL chat: AT^M^M
Oct 18 22:09:39 NULL chat: OK
Oct 18 22:09:39 NULL chat: -- got it
Oct 18 22:09:39 NULL chat: send (AT+CGDCONT=1,"IP","lowi.private.omv.es"^M)
Oct 18 22:09:39 NULL chat: expect (OK)
Oct 18 22:09:39 NULL chat: ^M
Oct 18 22:09:39 NULL chat: AT+CGDCONT=1,"IP","lowi.private.omv.es"^M^M
Oct 18 22:09:39 NULL chat: OK
Oct 18 22:09:39 NULL chat: -- got it
Oct 18 22:09:39 NULL chat: send (ATDT*99***1#^M)
Oct 18 22:09:39 NULL chat: timeout set to 30 seconds
Oct 18 22:09:39 NULL chat: expect (CONNECT)
Oct 18 22:09:39 NULL chat: ^M
Oct 18 22:09:39 NULL chat: ATDT*99***1#^M^M
Oct 18 22:09:39 NULL chat: CONNECT
Oct 18 22:09:39 NULL chat: -- got it
Oct 18 22:09:39 NULL chat: send (^M)
Oct 18 22:09:39 NULL pppd: Script /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat finished (pid 1276), status = 0x0
Oct 18 22:09:39 NULL pppd: Serial connection established.
Oct 18 22:09:39 NULL pppd: using channel 1
Oct 18 22:09:39 NULL pppd: Using interface ppp0
Oct 18 22:09:39 NULL pppd: Connect: ppp0 /dev/ttyS0
Oct 18 22:09:40 NULL pppd: sent [LCP ConfReq id=0x1 ]
Oct 18 22:09:41 NULL pppd: rcvd [LCP ConfReq id=0x1 ]
Oct 18 22:09:41 NULL pppd: sent [LCP ConfAck id=0x1 ]
Oct 18 22:09:41 NULL pppd: rcvd [LCP ConfRej id=0x1 ]
Oct 18 22:09:41 NULL pppd: sent [LCP ConfReq id=0x2 ]
Oct 18 22:09:41 NULL pppd: rcvd [LCP ConfAck id=0x2 ]
Oct 18 22:09:41 NULL pppd: sent [LCP EchoReq id=0x0 magic=0x0]
Oct 18 22:09:41 NULL pppd: sent [PAP AuthReq id=0x1 user="NULL" password=]
Oct 18 22:09:41 NULL pppd: rcvd [LCP EchoRep id=0x0 magic=0x0]
Oct 18 22:09:41 NULL pppd: rcvd [PAP AuthAck id=0x1 "Login OK"]
Oct 18 22:09:41 NULL pppd: Remote message: Login OK
Oct 18 22:09:41 NULL pppd: PAP authentication succeeded
Oct 18 22:09:41 NULL pppd: sent [CCP ConfReq id=0x1 ]
Oct 18 22:09:41 NULL pppd: sent [IPCP ConfReq id=0x1 ]
Oct 18 22:09:41 NULL pppd: rcvd [LCP ProtRej id=0x2 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
Oct 18 22:09:41 NULL pppd: Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
Oct 18 22:09:44 NULL pppd: sent [IPCP ConfReq id=0x1 ]
Oct 18 22:09:44 NULL pppd: rcvd [IPCP ConfReq id=0x1 ]
Oct 18 22:09:44 NULL pppd: sent [IPCP ConfAck id=0x1 ]
Oct 18 22:09:44 NULL pppd: rcvd [IPCP ConfNak id=0x1 ]
Oct 18 22:09:44 NULL pppd: sent [IPCP ConfReq id=0x2 ]
Oct 18 22:09:44 NULL pppd: rcvd [IPCP ConfAck id=0x2 ]
Oct 18 22:09:44 NULL pppd: not replacing default route to wlan0 [192.168.1.1]
Oct 18 22:09:44 NULL pppd: local IP address 10.242.68.43
Oct 18 22:09:44 NULL pppd: remote IP address 192.200.1.21
Oct 18 22:09:44 NULL pppd: primary DNS address 195.219.66.42
Oct 18 22:09:44 NULL pppd: secondary DNS address 87.119.194.34
Oct 18 22:09:44 NULL pppd: Script /etc/ppp/ip-up started (pid 1286)
Oct 18 22:09:44 NULL pppd: Script /etc/ppp/ip-up finished (pid 1286), status = 0x0
**ifconfig output:**
pi@NULL:~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:34:7a:5e
inet6 addr: fe80::e8a7:c560:2f66:73a2/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:200 errors:0 dropped:0 overruns:0 frame:0
TX packets:200 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:16656 (16.2 KiB) TX bytes:16656 (16.2 KiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.242.68.43 P-t-P:192.200.1.21 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:54 (54.0 B) TX bytes:91 (91.0 B)
wlan0 Link encap:Ethernet HWaddr b8:27:eb:61:2f:0b
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::509e:723a:2fb:453/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7937 errors:0 dropped:759 overruns:0 frame:0
TX packets:1040 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1477582 (1.4 MiB) TX bytes:199477 (194.8 KiB)
PD: I've set my hostname to "NULL", which may be confused at some points of the log, I'm sorry
Mc Kernel
(531 rep)
Oct 18, 2016, 10:55 PM
• Last activity: Aug 20, 2018, 11:44 PM
0
votes
1
answers
2684
views
Change APN of GSM connection
I'm trying to change the APN of my GSM connection but don't know how to do it, googling didn't really help. This is my current connection: NAME UUID TYPE DEVICE Vodafone Default 7730a562-f660-4537-974f-defb7ceecee6 gsm cdc-wdm0 It has an APN defined (obviously) but I don't know where I can modify it...
I'm trying to change the APN of my GSM connection but don't know how to do it, googling didn't really help.
This is my current connection:
NAME UUID TYPE DEVICE
Vodafone Default 7730a562-f660-4537-974f-defb7ceecee6 gsm cdc-wdm0
It has an APN defined (obviously) but I don't know where I can modify it. I looked into the
/etc/ppp/
directory already but didn't find anything useful.
Also, is it possible to change this with the NetworkManager (e.g. creating a new connection with a new APN)? Because I tried creating a new connection (with nmtui
) but didn't see a possibility to create a GSM connection, just wifi etc.
Otherwise, do you have an idea where I should look? Thanks for your help in advance!
Fabian
Fabian Witeczek
(1 rep)
Oct 17, 2017, 10:46 AM
• Last activity: Oct 20, 2017, 11:51 AM
9
votes
1
answers
22328
views
Modem Manager set bearer and connect automatically
I'm trying to set up a Huawei E3276 LTE stick with German Telekom and Modem Manager on Raspberry Pi (latest Raspbian), and basically it works but I'm failing to create a configuration that is deployable to the RPi via ansible. When I connect the LTE stick, ModemManager sets everything up correctly a...
I'm trying to set up a Huawei E3276 LTE stick with German Telekom and Modem Manager on Raspberry Pi (latest Raspbian), and basically it works but I'm failing to create a configuration that is deployable to the RPi via ansible.
When I connect the LTE stick, ModemManager sets everything up correctly and I end with a wwan0 interface and a 169.254.0.0/16 address assigned to it. Afterwards, I always have to run
sudo mmcli -m 0 --simple-connect="apn=internet.t-d1.de,user=t-mobile,password=tm,number=*99#"
which triggers network manager to get me somehow an IP. Everything's fine.
Since I want to automate this, I want to get rid of manually executing the mmcli command but am currently failing.
- Option 1: cronjob and script - ugly but most likely to work. I want to avoid this
- Option 2: Configuration file for modem manager / mmcli. I did not find any configuration file where I can place this data
- Option 3: udev rule executing the command
pi@raspberrypi:~ $ cat /etc/udev/rules.d/90-lte.rules
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="0c:5b:8f:27:9a:64", RUN+="/usr/local/bin/lte_setup.sh"
pi@raspberrypi:~ $ cat /usr/local/bin/lte_setup.sh
#!/bin/sh
sleep 2
mmcli -m 0 --simple-connect='apn=internet.t-d1.de,user=t-mobile,password=tm,number=*99#'
This doesn't work and I don't actually know why.
So, the basic question: _What is the simplest way to deploy this configuration/scripts via ansible to the Raspberry Pi in order to just get a public IP automatically via Modem-/NetworkManager after pluging the E3276 in?_
One last thing: I am **not** searching for a solution using wvdial or other tools. I spent days trying to use them using "working" configurations from the Internet just to find out they are not working. ModemManager and NetworkManager have proven to work, so I'm just trying to complete the setup without building the ugly cronjob workaround.
edermi
(91 rep)
Jul 18, 2017, 09:09 AM
• Last activity: Aug 31, 2017, 01:26 PM
2
votes
1
answers
1197
views
Unable to connect to USB 3G Mobile Broadband
I am using Arch Linux, Trying to connect to internet using my D-Link mobilebroadband. ( using NetworkManager and ModemManager ) I configured it using GUI ( setting APN/Network -Vodafone etc.. ) But when trying to connect, it shows this : $ nmcli device connect cdc-wdm0 Error: Timeout 90 sec expired....
I am using Arch Linux, Trying to connect to internet using my D-Link mobilebroadband. ( using NetworkManager and ModemManager )
I configured it using GUI ( setting APN/Network -Vodafone etc.. )
But when trying to connect, it shows this :
$ nmcli device connect cdc-wdm0
Error: Timeout 90 sec expired.
"/etc/NetworkManager/system-connections/Vodafone\ Vodafone\ Connect" file looks like this :
$ cat /etc/NetworkManager/system-connections/Vodafone\ Vodafone\ Connect
[connection]
id=Vodafone Vodafone Connect
uuid=6700a92d-d76c-4591-86c8-df2d8d3d30f1
type=gsm
autoconnect=false
permissions=user:severus:;
[gsm]
apn=www
number=*99#
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
the "/etc/NetworkManager/NetworkManager.conf" file is **empty**
output of
journalctl -r -S "2017-06-06" -u NetworkManager
->https://ptpb.pw/xiud
output of journalctl -r -S "2017-06-06" -u ModemManager
https://ptpb.pw/s7ER
**NOTE:** The same USB works fine on Ubuntu.
Severus Tux
(1045 rep)
Jun 6, 2017, 03:45 PM
• Last activity: Jun 7, 2017, 07:42 AM
2
votes
1
answers
1232
views
"Level 2 halted" error message using ldattach with mux type GSM0710
I have a 3G modem on my BeagleBone Linux system that supports GSM0710 multiplexing (i.e. can create >= 2 virtual serial ports that connect to the physical modem port, which can then be used to run ppp on one, and AT commands the other). I'm trying to use the ldattach command to get this to work, as...
I have a 3G modem on my BeagleBone Linux system that supports GSM0710 multiplexing (i.e. can create >= 2 virtual serial ports that connect to the physical modem port, which can then be used to run ppp on one, and AT commands the other).
I'm trying to use the ldattach command to get this to work, as described in https://www.kernel.org/doc/Documentation/serial/n_gsm.txt .
So I run these commands as root:
ldattach -d GSM0710 /dev/ttyO2 ldattach: opened /dev/ttyO2 ldattach: set to raw 0 ---: cflag=0x1cb2 ldattach: line discipline set to 21Then create some virtual serial devices with:
MAJOR=However, when I try to connect to one of the /dev/ttygsm ports, I always get this error "can't open /dev/ttygsm1: Level 2 halted". Does anyone know what this error means, and how to get the above muxing scheme to work? Thanks, Fredcat /proc/devices |grep gsmtty | awk '{print $1}
for i inseq 1 4
; do mknod /dev/ttygsm$i c $MAJOR $i done
fred basset
(1035 rep)
Mar 24, 2017, 05:22 PM
• Last activity: Jun 6, 2017, 03:52 PM
3
votes
0
answers
165
views
Switching from GSM to CDMA
NetworkManager has crashed and now it's showing CDMA mobile broadband as a GSM device. How I can switch to CDMA mode? I'm using Ubuntu.
NetworkManager has crashed and now it's showing CDMA mobile broadband as a GSM device.
How I can switch to CDMA mode? I'm using Ubuntu.
Talha Junaid
(131 rep)
Oct 31, 2014, 09:18 AM
• Last activity: Sep 27, 2016, 12:59 AM
2
votes
0
answers
407
views
Use mgetty to answer a call and press a key
I bought a GSM shield for the Raspberry Pi (version 1, B) and a SIM card to join the proper cellular network. I use `mgetty` to react to my call, like this: mgetty conf which works just fine and the script executes once I call the RPi: port ttyAMA0 speed 9600 post-init-chat "" ATH0 OK ATS0=0 OK AT+C...
I bought a GSM shield for the Raspberry Pi (version 1, B) and a SIM card to join the proper cellular network. I use
mgetty
to react to my call, like this:
mgetty conf
which works just fine and the script executes once I call the RPi:
port ttyAMA0
speed 9600
post-init-chat "" ATH0 OK ATS0=0 OK AT+CLIP=1 OK
rings 2
answer-chat "" ATH0
cnd-program /home/pi/caller.sh
The thing I want to do is not only executing the script above (which is currently a dummy script), but also answer the phone call and press a specific button (press *).
Interestingly, there is quite some documentation across the web, how to use mgetty
as a dialin modem, but I couldn't find a way to answer the call and send a key. Even this question is unanswered and I cannot post a comment to ping the author of the question...
dolfin
(21 rep)
Sep 23, 2016, 01:48 PM
• Last activity: Sep 23, 2016, 01:58 PM
3
votes
1
answers
1293
views
Critical messages from gsm and gtk
After upgrading to Fedora 18, I am seeing the following critical messages on `/var/log/messages` whenever I log on to the computer: CRITICAL: gsm_manager_set_phase: assertion \`GSM_IS_MANAGER Gtk-CRITICAL: gtk_main_quit: assertion `main_loops != NULL' failed Based on my limited knowledge, critical m...
After upgrading to Fedora 18, I am seeing the following critical messages on
Gtk-CRITICAL: gtk_main_quit: assertion `main_loops != NULL' failed Based on my limited knowledge, critical messages and above can affect the usage of my computer if I don't deal with these urgently. Not that they are affecting the current usage of my computer, but I would like to find out more about them (seems to deal with mobile technology and GIMP toolkit?) and how to turn them off if I do not need these services.
/var/log/messages
whenever I log on to the computer:
CRITICAL: gsm_manager_set_phase: assertion \`GSM_IS_MANAGERGtk-CRITICAL: gtk_main_quit: assertion `main_loops != NULL' failed Based on my limited knowledge, critical messages and above can affect the usage of my computer if I don't deal with these urgently. Not that they are affecting the current usage of my computer, but I would like to find out more about them (seems to deal with mobile technology and GIMP toolkit?) and how to turn them off if I do not need these services.
Question Overflow
(4818 rep)
Feb 14, 2013, 03:21 AM
• Last activity: Apr 27, 2016, 03:37 PM
1
votes
0
answers
184
views
my gsm modem echo my command on mini2440
I have mini2440 and GSM modem that they connected to each other with USB serial port (ttyUSB0). this is my code in c++ to send AT: #include #include /* Standard input/output definitions */ #include /* String function definitions */ #include /* UNIX standard function definitions */ #include /* File c...
I have mini2440 and GSM modem that they connected to each other with USB
serial port (ttyUSB0). this is my code in c++ to send AT:
#include
#include /* Standard input/output definitions */
#include /* String function definitions */
#include /* UNIX standard function definitions */
#include /* File control definitions */
#include /* Error number definitions */
#include /* POSIX terminal control definitions */
#include /*To use string type*/
#include
#include
using namespace std;
// Definations
int fd; /* File descriptor for the port */
string wr;
int rd;
char buffer; /* Input buffer */
int openport(void);
void closeport(void);
void configport(void);
string WriteRead(void);
//-------------------------------------
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
openport();
if(fd>-1)
{
configport();
string str=WriteRead();
qDebug(str.c_str());
}
return a.exec();
}
//-------------------------------------
int openport(void)
{
fd=open("/dev/ttyUSB0",O_RDWR|O_NOCTTY|O_NDELAY);
if (fd==-1)
{
perror("open_port: unable to open port /dev/ttyUSB0\n");
return -1;
}
else
{
printf("open_port: succesfully open port /dev/ttyUSB0\n");
fcntl(fd,F_SETFL,0);
return 1;
}
}
//-------------------------------------
void closeport(void)
{
close(fd);
}
//-------------------------------------
void configport(void)
{
struct termios options;
tcgetattr(fd,&options);
cfsetispeed(&options,B9600);
cfsetospeed(&options,B9600);
options.c_cflag |= (CLOCAL | CREAD);
options.c_cflag &= ~CSIZE;
options.c_cflag |= CS8;
options.c_cflag &= ~ PARENB;
options.c_cflag &= ~CSTOPB;
options.c_cflag &= ~CSIZE;
options.c_cflag |= CS8;
options.c_iflag &= ~(IXON|IXOFF|IXANY);
tcsetattr(fd,TCSANOW,&options);
}
//------------------------------------
string WriteRead(void)
{
char buffer; /* Input buffer */
char *bufptr; /* Current char in buffer */
int nbytes; /* Number of bytes read */
int tries; /* Number of tries so far */
for (tries = 0; tries 0)
{
bufptr += nbytes;
if (bufptr[-1] == '\n' || bufptr[-1] == '\r')
break;
}
/* nul terminate the string and see if we got an OK response */
*bufptr = '\0';
string s(buffer);
if (s.find("OK"))
{
return s;
}
else
return "not answer";
}
}
but after send AT i say if find "OK" set the buffer to string s. then write
string s in output. but it just write AT. there is no OK but my (if(s.find("OK"))) return true. so what happen? why echo AT?
H.Ghassami
(145 rep)
Nov 10, 2015, 06:42 AM
Showing page 1 of 20 total questions