Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
net-misc/ofono-1.29 throws dbus-related errors
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
penetrode
Apprentice
Apprentice


Joined: 29 Dec 2003
Posts: 264
Location: Calgary, Alberta

PostPosted: Tue Aug 27, 2019 6:29 am    Post subject: net-misc/ofono-1.29 throws dbus-related errors Reply with quote

I am using net-misc/connman to manage my network.

I have an Ericsson 3507g UMTS card that I would like to manage with connman as well. I understand that this requires net-misc/ofono.

I've installed net-misc/ofono-1.29 and am using this as a guide: https://embexus.com/2017/06/04/add-a-mobile-broadband-connectivity-to-embedded-linux/

The list-modems command fails with this message:

Code:
# ./list-modems
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.ofono': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./list-modems", line 7, in <module>
    manager = dbus.Interface(bus.get_object('org.ofono', '/'),
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files


I don't know enough about dbus to understand what the first error message means, although the double exception does make me wonder if dbus is properly set up.

The list-modems script is short, so I'll include it here:
Code:

#!/usr/bin/python3

import dbus

bus = dbus.SystemBus()

manager = dbus.Interface(bus.get_object('org.ofono', '/'),
                                                'org.ofono.Manager')

modems = manager.GetModems()

for path, properties in modems:
        print("[ %s ]" % (path))

        for key in properties.keys():
                if key in ["Interfaces", "Features"]:
                        val = ""
                        for i in properties[key]:
                                val += i + " "
                else:
                        val = properties[key]
                print("    %s = %s" % (key, val))

        for interface in properties["Interfaces"]:
                object = dbus.Interface(bus.get_object('org.ofono', path),
                                                                interface)

                print("    [ %s ]" % (interface))

                try:
                        properties = object.GetProperties()
                except:
                        continue

                for key in properties.keys():
                        if key in ["Calls",
                                        "MultipartyCalls",
                                        "EmergencyNumbers",
                                        "SubscriberNumbers",
                                        "PreferredLanguages",
                                        "PrimaryContexts",
                                        "LockedPins",
                                        "Features",
                                        "AvailableTechnologies"]:
                                val = ""
                                for i in properties[key]:
                                        val += i + " "
                        elif key in ["ServiceNumbers"]:
                                val = ""
                                for i in properties[key]:
                                        val += "[" + i + "] = '"
                                        val += properties[key][i] + "' "
                        elif key in ["MobileNetworkCodeLength",
                                                "VoicemailMessageCount",
                                                "MicrophoneVolume",
                                                "SpeakerVolume",
                                                "Strength",
                                                "DataStrength",
                                                "BatteryChargeLevel"]:
                                val = int(properties[key])
                        elif key in ["MainMenu"]:
                                val = ", ".join([ text + " (" + str(int(icon)) +
                                        ")" for text, icon in properties[key] ])
                        elif key in ["Retries"]:
                                val = ""
                                for i in properties[key]:
                                        val +=  "[" + i + " = "
                                        val += str(int(properties[key][i])) + "] "
                        elif key in ["Settings"]:
                                val = "{"
                                for i in properties[key].keys():
                                        val += " " + i + "="
                                        if i in ["DomainNameServers"]:
                                                for n in properties[key][i]:
                                                        val += n + ","
                                        else:
                                                val += properties[key][i]
                                val += " }"
                        else:
                                val = properties[key]
                        print("        %s = %s" % (key, val))

        print('')



Here's some eix output:

Code:
[I] net-misc/ofono
     Available versions:  1.16 ~1.28 (~)1.29 {+atmodem bluetooth +cdmamodem +datafiles doc dundee examples +isimodem +phonesim +provision +qmimodem threads tools +udev upower}
     Installed versions:  1.29(07:41:15 08/27/19)(atmodem bluetooth cdmamodem datafiles doc examples isimodem phonesim provision qmimodem tools udev upower -dundee)
     Homepage:            https://01.org/ofono
     Description:         Open Source mobile telephony (GSM/UMTS) daemon


Code:
[I] net-misc/connman
     Available versions:  1.35-r1 1.37 {bluetooth debug doc +ethernet examples iptables iwd l2tp networkmanager nftables ofono openconnect openvpn policykit pptp tools vpnc +wifi wispr}
     Installed versions:  1.37(08:13:20 08/27/19)(bluetooth doc ethernet examples nftables ofono openvpn policykit tools wifi -debug -iptables -iwd -l2tp -networkmanager -openconnect -pptp -vpnc -wispr)
     Homepage:            https://01.org/connman
     Description:         Provides a daemon for managing internet connections


Code:
[I] dev-python/dbus-python
     Available versions:  1.2.0-r1 1.2.4 ~1.2.6-r1 ~1.2.6-r2^t ~1.2.8^t {doc examples test PYTHON_TARGETS="python2_7 python3_5 python3_6 python3_7"}
     Installed versions:  1.2.4(00:59:00 04/19/19)(-doc -examples -test PYTHON_TARGETS="python2_7 python3_6 -python3_5")
     Homepage:            https://www.freedesktop.org/wiki/Software/DBusBindings https://dbus.freedesktop.org/doc/dbus-python/
     Description:         Python bindings for the D-Bus messagebus
Back to top
View user's profile Send private message
penetrode
Apprentice
Apprentice


Joined: 29 Dec 2003
Posts: 264
Location: Calgary, Alberta

PostPosted: Tue Aug 27, 2019 10:46 am    Post subject: Reply with quote

Ok, it turns out that ofono has a service that must first be started with

Code:
rc-service ofono start


I now have the connection working:

Code:
# ifconfig wwp0s29f7u4i7
wwp0s29f7u4i7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.137.47.124  netmask 255.255.255.248  broadcast 10.137.47.127
        ether 02:80:37:ec:02:00  txqueuelen 1000  (Ethernet)
        RX packets 3718  bytes 2490325 (2.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3232  bytes 454365 (443.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Code:
# connmanctl technologies
/net/connman/technology/cellular
  Name = Cellular
  Type = cellular
  Powered = True
  Connected = True
  Tethering = False
/net/connman/technology/ethernet
  Name = Wired
  Type = ethernet
  Powered = False
  Connected = False
  Tethering = False
/net/connman/technology/wifi
  Name = WiFi
  Type = wifi
  Powered = False
  Connected = False
  Tethering = False
/net/connman/technology/bluetooth
  Name = Bluetooth
  Type = bluetooth
  Powered = False
  Connected = False
  Tethering = False


Of course, there is more to the setup than simply starting the ofono service. The 3507g has proven temperamental: the order in which you perform the operations matters and sometimes modem and context activation do not work and have to be repeated.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum