Connecting 3G usb dongle/modem to osmc on raspberry pi

Well i finally found a way to use 3g modem and also share the internet via hotspot.

well this method doesnt need the complex way of using sakis3g or umtskeeper. plus i have to mention that the connman is badly documented and the ofono is the worst… the most annoying packages actually. i request the osmc guys to run networkmanger in future builds as its painless… ok here is the steps to easily activate 3g modem

  1. install networkmanager
    2.installl modemmanager

  2. install ppp

  3. check if ur modem is detected
    nmcli dev status

  4. now create your 3g connection via nmcli

follow instructions in this page command line - configure gsm connection using nmcli - Unix & Linux Stack Exchange

  1. make sure autoconnect is set to true in ur file

  2. creat a hotspot using nmcli

follow this Create Wi-Fi Hotspot on Linux using nmcli · GitHub

  1. make sure autoconnect is set to true

  2. sudo apt-get remove connman

  3. conmanpackage will be removed but it still stays…i dontknow how…

  4. since connman stays we can changed or edit wifi and ethernet using osmc addon

  5. cd /var/lib/connman

  6. ls

  7. delete anything in that by

`sudo rm -r (your file name starts with wifi)

  1. after deleting reboot,

  2. modem will be connected and also the hotspot…

if you want to use wifi or ethernet… unplug modem and use osmc addon to configure to wifi or ethernet `

this method detects nearly 90% of usb modems ( dont know about modems that act as usb ethernet like latest 4g modems)

GOOD luck folks…

Good work! I don’t know if the OSMC team is ready to ditch connman, however frustrating it is. Did you stop the connman service before trying to purge it?

@balnafasae

I’m glad you’ve got your device working. But your advice isn’t good.

The choice to use ConnMan, and not NetworkManager is a conscious and hopefully, judicious one. We used NetworkManager in the past with Raspbmc and experienced some problems with this.

This isn’t something we will do. This has been covered on the forum in the past. While NetworkManager may be useful for advanced users, it’s not suitable for the average user. We have a focus on simplicity and need stability (API and predictability in behaviour) to ensure our users can perform simple tasks like connecting to WiFi networks from a GUI. When we’ve had issues with ConnMan, we’ve been able to submit fixes and get them merged upstream. For now, it sounds like the only reason you are putting NetworkManager forward is because it works with a larger set of USB modems. But that is not going to be used by a lot of users.

We don’t package the official connman from Debian (it’s old). What version of OSMC are you running? We haven’t packaged the official version since early 2015. Of course you will experience isssues if running an OSMC version that is this old.

See dpkg -l | grep connman-osmc

Keep in mind that while OSMC is based on APT and we encourage people to expand their system, we expect OSMC to manage the networking. Installing NetworkManager will break OSMC’s expectation of the network stack and in turn updates will likely not work as expected. We won’t be able to provide support for this but if you are happy to deal with this that is fine. We don’t recommend your proposed advice for the average user however. If there’s demand for 3G modem support in OSMC, it will come and it will work well (with My OSMC integration).

Cheers

Sam

No i didnt stop before purging it . since i was using ssh to do all the stuffs i was afraid that might stop the wifi inturn ssh… im gonna get a usb keyboard to do the terminal works locally…ill be also trying to integerate myosmc addon with network manager… i really need some help in finding where the osmc image is installed when installing via qtinstaller.

@sam_nazarko

well yeah i didnt explain it well since i was almost 100%tired and sleep when i wrote the post… ill make a detailed one just to get usb modem working …

well i understand the situation as 99 % of users will be using either ethernet or wifi as source… but the remaining 1% who live remotely or dont have ethernet should have a chance too… i tried using wifi but since lot of devices in my home used wifi… osmc didnt get enough bandwidth… so i had to do this., since the 1% use a very wide variety of modems of lot of kinds… networkmanager gets them working…

well in my honest opinion supporting modems will be like honouring the persons who like osmc but have to deal with usb modems… :slight_smile:

maybe if osmc can make a separate version using network manager… i hope that wont be a big task…

and well i use the latest build of osmc…
after i deleted conman…

it somehow is still working actually…

im able to get connmanctl runiing and im able to connect wifi over osmc addon. which means connman is still in there…

when i checked with dpkg it says not found…

well since connman is working it is messing up with the automatic wifi hotspot…

my hotspot turns on at boot but turns off after 30 seconds… i guess thats the work of connman…

ill do a clean install once again and try to sort it out… thanks for the helo :slight_smile:

cheers

Yes – it means you didn’t remove ConnMan. If you did, you would break dependencies on a fair few OSMC packages which would bork your system.

Your system is still a mess, but as long as it works, good to hear it. Updates likely won’t work and we won’t be able to support them if that turns out to be the case.

yup sudo apt-get remove connman didnt remove the connman that came with osmc. as you said i did dpkg -l |grep method to find and remove connman. i used network manager then to connect to the modem.

Your system is still a mess

yes it is a total mess removing connman and installing network manager… so i reverted back to connman and sakis3g combination which works good.

@sam_nazarko

i later pursed with connman trying to find way to use connman and ofono.

i achieved partial success till the point the modem got successfully detected by ofono and connman… but i still couldnt find the trigger connman to turn it on. i found that that ofono is being controlled by dbus. can you throw me some light in this regard… im literally too close in making this work via connman+ ofono

so far im able to get my modem status information, network provider name, signal level and connection type…

I sent this patch to @grahamh but he hasn’t had a chance to test it yet. I haven’t tested it myself, but it will get ConnMan built with Ofono support.

diff --git a/package/connman-osmc/build.sh b/package/connman-osmc/build.sh
index 6db91ef..c752e9c 100755
--- a/package/connman-osmc/build.sh
+++ b/package/connman-osmc/build.sh
@@ -23,6 +23,7 @@ then
        handle_dep "iptables"
        handle_dep "libgnutls28-dev"
        handle_dep "libglib2.0-dev"
+       handle_dep "ofono-dev"
        sed '/Package/d' -i files/DEBIAN/control
        echo "Package: ${1}-connman-osmc" >> files/DEBIAN/control
        pushd src/connman-$VERSION
diff --git a/package/connman-osmc/files/DEBIAN/control b/package/connman-osmc/files/DEBIAN/control
index 37b1138..2d8d42f 100644
--- a/package/connman-osmc/files/DEBIAN/control
+++ b/package/connman-osmc/files/DEBIAN/control
@@ -5,4 +5,4 @@ Essential: No
 Priority: optional
 Maintainer: Sam G Nazarko <email@samnazarko.co.uk>
 Description: connman for OSMC
-Depends: dbus, init-system-helpers, libdbus-1-3, libglib2.0-0, libgnutls-deb0-28, libreadline6, libxtables10
+Depends: dbus, init-system-helpers, libdbus-1-3, libglib2.0-0, libgnutls-deb0-28, libreadline6, libxtables10, ofono
osmc@vero:~/GitProjects/osmc$ patch -p1 < ofono.patch
patching file package/connman-osmc/build.sh
Hunk #1 FAILED at 23.
1 out of 1 hunk FAILED -- saving rejects to file package/connman-osmc/build.sh.rej
patching file package/connman-osmc/files/DEBIAN/control
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 21:

Just patch it manually (only a couple of lines). You probably ran in to white space or issues copying it

The lines are tab-indented but copy/paste will contain 8 spaces.

Happens all the time! :wink:

You can use --ignore-whitespace to ignore
this.

No cut and paste - I just did the wget you posted. Anyway, connman now installed on v4k and ofono from the repo. The modem is recognised with a little help from usb-modeswitch, but ofono doesn’t seem to see it ie nothing returned by list-modems (from ofono-scripts package). Trying to turn on debugging for connman and ofono but the instructions at the Ubuntu wiki are out of date. What am I missing?

I’m assuming once ofono knows the modem is there, connman will list it as a technology (currently only p2p, wired, wireless, BT)

That’s correct.

Perhaps the ofono in the Debian repository is too old; or a kernel module is needed for the modem to work properly. I don’t know a lot about USB modems and how they work under Linux

Progress: an old phone is recognised, so it must have been the dongle was the problem. Strange, because there’s a bug report about a very similar device which was fixed 4 years ago. I’ll park that issue.

Watch this space…

Keep me posted!

The reason my dongle wasn’t working is it needs option.ko. Ofono is looking for the following modules, most of which vero lacks:

Modules expected by ofono
            Mint       Pi      Vero4k
cdc_acm   (cdc-acm) (cdc-acm) (cdc-acm)
cdc_ether   yes       yes      yes
cdc_ncm     yes       yes       no
cdc_phonet  yes       no        no
cdc_wdm   (cdc-wdm) (cdc-wdm)   no
hso         yes       yes       no
kalmia      yes       yes       no
option      yes       yes       no
qcserial    yes       yes       no
qmi_wwan    yes       yes       no
rndis_host  yes       yes      yes
sierra      yes       yes       no
sierra_net  yes       yes       no
usbserial   yes       yes       no

I seem to recall that non-HiLink Huawei dongles require their own module. Something along the lines of hw_cdc_ncm or huawei_cdc_ncm.

You might be right, in which case ofono won’t support them AFAICT. It recognises modems with a combination of drivername, vendorID and sometimes productID.

Unless this list is just the exceptions and they can work under a default setup. My C isn’t good enough to understand what’s going on there.

It’s been a while but I think that the HiLink Huaweis use cdc_ether and the non-HiLink use hw_cdc_ncm. The fallback position would probably be ppp, which won’t realise the full potential of an LTE modem.

Unfortunately, HiLink uses double NAT and (last time I looked) a 192.168.8.0/24 subnet. They could have chosen any private range but they chose the same subnet as I was using!