Method to connect 2G 3G usb dongle to osmc on raspberry pi

Hello, I had already made a post connecting a 3g modem via sakins3g and utms keeper which was a bit advanced or we can say tough…

here is another way to connect a modem using network manager…

  1. ssh or open terminal

sudo apt-get update

sudo apt-get install Network-Manager

sudo apt-get install modemmanager

sudo apt-get install ppp

sudo apt-get install usbutils

now insert your usb dongle in the usb port

wait till the usb modem gains singal
for example solid bluelight means 3g signal
solid green - 2g signal
solid red - no signal or not registered

this differs based on make and model.

after 30 seconds

nmcli dev status

your modem should be detected now like this

DEVICE   TYPE      STATE         CONNECTION 
ttyUSB2     gsm     disconnected          --       
wlan0         wifi      disconnected          --         
eth0        ethernet  unavailable             --         
lo           loopback  unmanaged            --

the gsm is ur modem…

NOW lets create your modem connection and configuration file.

sudo nmcli connection edit type gsm con-name "GPRS"

nmcli> print

you will see something like this

nmcli> print
===============================================================================
                Connection profile details (My GPRS Connection)
===============================================================================
connection.id:                          My GPRS Connection
connection.uuid:                        27b012ca-453f-482f-bc0e-c81bbab07310
connection.interface-name:              --
connection.type:                        gsm
connection.autoconnect:                 yes
connection.timestamp:                   0
connection.read-only:                   no
connection.permissions:                 
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.secondaries:                 
connection.gateway-ping-timeout:        0
-------------------------------------------------------------------------------
ipv4.method:                            auto
ipv4.dns:                               
ipv4.dns-search:                        
ipv4.addresses:                         
ipv4.routes:                            
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
-------------------------------------------------------------------------------
ipv6.method:                            auto
ipv6.dns:                               
ipv6.dns-search:                        
ipv6.addresses:                         
ipv6.routes:                            
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.dhcp-hostname:                     --
-------------------------------------------------------------------------------
gsm.number:                             *99#
gsm.username:                           --
gsm.password:                           --
gsm.password-flags:                     0 (none)
gsm.apn:                                --
gsm.network-id:                         --
gsm.network-type:                       -1
gsm.allowed-bands:                      1 (any)
gsm.pin:                                --
gsm.pin-flags:                          0 (none)
gsm.home-only:                          no
-------------------------------------------------------------------------------

set gsm.apn <APN>

replace with your APN

for example

set gsm.apn bsnlnet

set gsm.username <username>

replace with your username
if you dont have any user name type user

set gsm.password <password>

replace with your password
if you dont have any type user

set connection.autoconnect true

this will make ur modem to get automatically connected.

nmcli print
this will display the changed made

save

quit

your device will be connected to network now… the modem light will be blinking.

wait… the system still wont be able to access the 3g internet as connman is handling the network connections … so we have to delete it

dpkg -l | grep connman-osmc

copy the name of the connman version and

sudo apt-get remove armv7-connman-osmc

in my case the version name was armv7-connman-osmc
replace the command with the version in ur system///

if u r doing all these on ssh it will stop in between as connman is removed…
dont worry wait for 5 mintues and reboot the osmc manually…

your modem will start working now… :slight_smile: enjoy

if this doest work…
and if u dont have username and password for your 3g connection
dont set set gsm.username <username> and set gsm.username <password>
skip them… this will work on 95% of usb modems and if you have got a problem you can ping me…

Use of network manager is not recommended. OSMC supports connman so you may get unexpected results.

Just a health warning…

I agree with you 100% but this is the only option when the internet source is only the 3g modem. i hope osmc supports 3g modems in future.

No it’s not. I got it to work like this. I had to disable ofono but sakis3g worked a treat. YMMV of course.

i agree. my first post was also based on sakis 3g. it was easy but i didnt support me making a hotspot as connman didnt recognise the sakis3g connection as cellular.
so inturn i couldnt create a hotspot.