2010/3/4 Will Stephenson <wstephenson@suse.de>:
On Thursday 04 March 2010 01:58:39 Ciro Iriarte wrote:
2010/3/3 Ciro Iriarte <cyruspy@gmail.com>:
Hi, anybody knows if it's possible to identify which carrier a SIM card belongs to when the usb hsdpa|gprs modem is connected using udev?
I'm not aware of any way to do it with udev, but you can poke the org.freedesktop.ModemManager service on the system bus if you are running NetworkManager. Last time I looked network details were on org.freedesktop.ModemManager.Modem.Gsm.Network.
HTH
Will -- Will Stephenson, openSUSE Team SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex
Found a python script that should be able to query IMSI information using dbus, but it apparently doesn't work with OS 11.2. http://cgit.freedesktop.org/ModemManager/ModemManager/plain/test/mm-test.py ---- Execution attempt ---- [17:41:05][ciro@roamer:~/src]>./mm-test.py ERROR:dbus.proxies:Introspect error on :1.230:/org/freedesktop/ModemManager/Modems/0: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) Traceback (most recent call last): File "./mm-test.py", line 442, in <module> type = props_iface.Get(MM_DBUS_INTERFACE_MODEM, 'Type') File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 68, in __call__ return self._proxy_method(*args, **keywords) File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__ **keywords) File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 622, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.230 was not provided by any .service files ---------------------------------- --- Logs --- ==> /var/log/messages <== Mar 5 17:44:02 roamer kernel: [15914.732602] modem-manager[16127]: segfault at 7a25e525 ip 00007f2ef1b10284 sp 00007fffb76b65e0 error 4 in libdbus-glib-1.so.2.1.0[7f2ef1b05000+20000] Mar 5 17:44:02 roamer modem-manager: Loaded plugin Novatel Mar 5 17:44:02 roamer modem-manager: Loaded plugin Nokia Mar 5 17:44:02 roamer modem-manager: Loaded plugin Gobi Mar 5 17:44:02 roamer modem-manager: Loaded plugin Option Mar 5 17:44:02 roamer modem-manager: Loaded plugin Sierra Mar 5 17:44:02 roamer modem-manager: Loaded plugin Generic Mar 5 17:44:02 roamer modem-manager: Loaded plugin MotoC Mar 5 17:44:02 roamer modem-manager: Loaded plugin Option High-Speed Mar 5 17:44:02 roamer modem-manager: Loaded plugin Ericsson MBM Mar 5 17:44:02 roamer modem-manager: Loaded plugin Huawei Mar 5 17:44:02 roamer modem-manager: Loaded plugin ZTE Mar 5 17:44:02 roamer modem-manager: (ttyACM0) opening serial device... Mar 5 17:44:02 roamer dbus-daemon: Rejected send message, 2 matched rules; type="error", sender=":1.242" (uid=0 pid=16267 comm="/usr/sbin/modem-manager) interface="(unset)" member="(unset)" error name="org.freedesktop.DBus.Error.UnknownMethod" requested_reply=0 destination=":1.11" (uid=0 pid=2124 comm="/usr/sbin/NetworkManager)) Mar 5 17:44:02 roamer modem-manager: (ttyACM0): probe requested by plugin 'Nokia' Mar 5 17:44:03 roamer modem-manager: (ttyACM0) closing serial device... Mar 5 17:44:03 roamer modem-manager: (Nokia): GSM modem /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1 claimed port ttyACM0 Mar 5 17:44:03 roamer modem-manager: Added modem /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1 Mar 5 17:44:03 roamer modem-manager: signal "completed" (from "Completed") exported but not found in object class "MMModemNokia" Mar 5 17:44:03 roamer modem-manager: Exported modem /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1 as /org/freedesktop/ModemManager/Modems/0 ==> /var/log/NetworkManager <== Mar 5 17:44:02 roamer NetworkManager: <info> modem manager disappeared Mar 5 17:44:02 roamer NetworkManager: <info> (ttyACM0): now unmanaged Mar 5 17:44:02 roamer NetworkManager: <info> (ttyACM0): device state change: 3 -> 1 (reason 36) Mar 5 17:44:02 roamer NetworkManager: <info> (ttyACM0): cleaning up... Mar 5 17:44:02 roamer NetworkManager: <info> (ttyACM0): taking down device. Mar 5 17:44:02 roamer NetworkManager: <info> Trying to start the modem-manager... Mar 5 17:44:02 roamer NetworkManager: <info> modem manager appeared Mar 5 17:44:03 roamer NetworkManager: <info> Found new GSM modem device 'ttyACM0' (driver: 'cdc_acm'). Mar 5 17:44:03 roamer NetworkManager: <info> (ttyACM0): exported as /org/freedesktop/ModemManager/Modems/0 Mar 5 17:44:07 roamer NetworkManager: <info> (ttyACM0): device state change: 1 -> 2 (reason 2) Mar 5 17:44:07 roamer NetworkManager: <info> (ttyACM0): deactivating device (reason: 2). Mar 5 17:44:07 roamer NetworkManager: nm_system_device_flush_ip4_routes_with_iface: assertion `iface_idx >= 0' failed Mar 5 17:44:07 roamer NetworkManager: nm_system_device_flush_ip4_addresses_with_iface: assertion `iface_idx
= 0' failed Mar 5 17:44:07 roamer NetworkManager: <info> (ttyACM0): device state change: 2 -> 3 (reason 0)
Any ideas?, -- Ciro Iriarte http://cyruspy.wordpress.com -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org