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

Hello Everyone,

Im balaji,
Im new to osmc. I have been trying to connect my zte 3G usb modem to my raspberry pi 3 running osmc. after sometime researching on the internet i found a way to do it. i tired to post it on the HOW TO forum list but i couldnt. so Im posting it here . hope this helps someone. ( and pardon my english :stuck_out_tongue: )

  • things you will need
  1. raspberry pi with osmc installed

  2. a 3g usb dongle ( no need to worry about make or model)

  3. sakis3g package and umtskeeper package for connecting the dongle to internet
    link : https://drive.google.com/open?id=0B9Nr1nZkJmj3ZHZIMWI2X3lQSjg

  4. winscp for viewing files in your osmc
    *procedure

  5. Putty for ssh


  • open ssh and type sudo apt-get update

  • type sudo apt-get install usb-utils

  • type sudo apt-get install ppp

*type sudo apt-get install bzip2

  • type sudo apt-get install usb-modeswitch

  • connect your modem to the usb port of pi

  • type lsusb

  • now the list of attached usb devices will be displayed

  • find your modem and its ID ā€¦ the id will look like 19( Ex. 19d2:0016)

  • note down the ID


  1. open winscp and login into your raspberry pi using username and password ( just like SSH)

  2. navigate to /home/osmc

  3. create a file named modem

  4. move the downloaded sakis3g and umtskeeper files from your computer to the modem folder ( /home/osmc/modem)

  5. now Open PUTTY and login into your pi

  6. type cd /home/osmc/modem

  7. type tar -xkvf sakis3g.tar.gz

  8. type tar -xkvf umtskeeper.tar.gz

  9. type chmod +x sakis3g

  10. type chmod +x umtskeeper

  11. type sudo visudo

  12. in that window go to the bottom and type osmc ALL = NOPASSWD: /home/osmc/modem/sakis3g

  13. in the next line type ALL = NOPASSWD: /home/osmc/modem/umtskeeper

  14. save and exit

  15. type sudo nano /etc/sakis3g.conf

16 in that window type

USBDRIVER=ā€œoptionā€
#USBINTERFACE=ā€œ3ā€
APN=ā€œyourapnā€
APN_USER=ā€œuserā€
APN_PASS=ā€œuserā€
MODEM=ā€œyourmodemIDā€

replace yourapn with the apn of your internet provider ( dont remove " ")
replace yourmodemID with the usb ID of your modem

  • save and exit

*type sudo nano /etc/rc.local

*now add this line
above exit 0

home/osmc/modem/umtskeeper --sakisoperators ā€œUSBINTERFACE=ā€˜0ā€™ OTHER=ā€˜USBMODEMā€™ USBMODEM=ā€˜YOURMODEMIDā€™ SIM_PIN=ā€˜1234ā€™ APN=ā€˜CUSTOM_APNā€™ CUSTOM_APN=ā€˜YOURAPNā€™ APN_USER=ā€˜usernameā€™ APN_PASS=ā€˜passwordā€™ā€ --sakisswitches ā€œā€“sudo --consoleā€ --devicename ā€˜DEVICENAMEā€™ --log --nat ā€˜noā€™

replace YOURMODEMID with your modem usb ID

replace YOURAPN with the apn provided by your provider

replace username with the username of your 3g modem

replace password with your password for the 3g modem

!!! if your dont have or need username and password type user in username and password field respectively !!!

replace DEVICENAME with your modem name ( just for identification . exact name not necessary)

  • save and exit

  • now type cd /home/osmc/modem

  • type ./ sakis3g --interactive

  • the sakis3g page will open

  • choose connect with 3g option and proceed as per requirement

  • finally it will say that your dongle is connected and your modem must blink


  • if you ping www.google.com now your wont be connected as osmc uses conman with is configured to use ethernet as main and wifi . since you will either be connected on wifi or lan for ssh you wont get ping or you will get ping with the lan or wifi has internet access

  • to use the modem internetā€¦ turn off wifi and ethernet and reboot.

  • no once the osmc boots your modem will be automatically connected after boot :slight_smile:

  • if you connected to ethernet or wifi by mistake just remove it or disable it and reboot again.

  • you cant use 3g modem simultaneously with lan or wifiā€¦ just use it as standalone with 3g :slight_smile:

GOOD LUCK!!!

Unfortunately, AFAIK, sakis3g is no longer supported. What is more, the Google Drive script contains a shell script with embedded binary data from an untrusted source.

My own experience of getting 3G/4G dongles to work (not on OSMC) has shown that it is generally a lottery and can most definitely depend on which model (and firmware version) you are using. You havenā€™t told us which modem you used.

Hi dillthedogā€¦ well i have 3 raspberry piā€™s two b+ and one 2ā€¦ i have got them working on all of the three with three different modems. zte k4201 which isnt much pupular and another one is zte mf667 and then a generic 7.2mbps 3g chinese modem. Well yeah it is from an unknown developer as he abandoned the project long time ago i guessā€¦ i tried to get it working with connman ofono. but it seemed to be a bit more time consuming than thisā€¦ more overā€¦ i read somewhere in the forum that the 3g modem option will be added in the futureā€¦ so in the meantime i thought this might help someone :slight_smile:

And moreover making it workā€¦ its definitely a lottery sometimes as most often the modem by default registers as a mass storage deviceā€¦ we have to manually switch its mode to modem. in such cases there will be two usb IDā€™s registered i guessā€¦ thats why we are using usb mode switchā€¦ since mine fortunately was in modem mode by deault it didnt give much pain to meā€¦

We can add support for 3G to ConnMan.
After VPN and DNS leak fixes of course :wink:

Itā€™s a world of pain, believe me. :worried:

Should I start holding my breath? :wink:

Weā€™ll see.

Wellā€¦ since connman supports very limited number of dongles and also the need to use ofono its definitely a painā€¦ unless osmc tries to add such a feature its difficult to add dongles via connmanā€¦

I believe ConnMan can use Ofono.
Thereā€™s no restrictions as to what dongles must be used that is set by ConnMan

The only way Iā€™ve got mobile dongles to work is by by-passing connman and ofono, but it would be good to get them supported with connman and so that you donā€™t have to switch off eth/wlan as described by @balnafasae above.

Thereā€™s a feature request on this. When I last looked, I couldnā€™t get connman to see either of two 3G devices I tried and the connman documentation wasnā€™t much help.

LOL, wait till you try and get any official documentation for the dongles.

The best source of information seems to be Russian-language web sites, so perhaps itā€™s time to brush up on your Cyrillic alphabet. :wink:

The problem is usually getting driver support rather than docs.
Realtek WiFi has always been a bodge for example.

@grahamh yes it will be great to be supported by connman as it will be lean and basic to use it with connman ( connman is lean and basic enough for embedded devices) but due to the limited documetation and support ( as in here ConnMan/Hardware/3G - Ubuntu Wiki) connecting any brand or model of modem seems to be difficult right nowā€¦ i hope osmc adds the feature soon. now im trying to enable wifihotspot with the 3g modemā€¦ i hope that work out :slight_smile: and also ill be trying to manualy add the connect options from sakis3g to my osmcā€¦

well @sam_nazarko if you are talking about those chip modules on the pcbā€¦ yes its really a problemā€¦ i remember searching a lot such a driver when i messed up with my old chinese android tv boxā€¦ i guess they just pass the support only to the manufacturers as not much of the general public buys themā€¦

Well i have just started learning about connmanā€¦ do you guys think connman will detect if i insert any of the usb modems in this list? ConnMan/Hardware/3G - Ubuntu Wiki

or osmc has just disabled the connman feature to detect 3g? just like libreelec disabled apt-get?

From my tinkering, I had the impression that as long as your dongle is supported by usb-modeswitch then it just presents a modem that you send AT commands to. I suppose sakis-3g uses a scattergun approach to find which port to talk to and which AT commands get a response. Ofono would have to be told what to send. So yes, it will be difficult to provide a plug-n-play experience but more knowledgeable users could make it work if connman could recognise a wwan/ppp device. Does it have to be compiled differently?

I couldnā€™t get it to recognise a ZTE device, but you may like to try, making sure usb-modeswitch does its stuff before connman starts up.

You may find this helpful. Itā€™s how I use a USB 3G device with the Pi as a gateway to a wired ethernet. You would have to substitute ppp for wwan and wlan for eth.

well i am still trying it but so far it didnt detect anyā€¦ im trying to create wifi hotspot with connmanā€¦ i was able to successfully create the hotspot after boot by editing rc.localā€¦ the hotspot gets created and i could connect my devices to itā€¦ but when i try to surf something lets say www.google.com i get couldnt resolve host nameā€¦ what am i missing here? maybe dns ? or since im using sakis3g for ppp0 and connman for hotspot connman didnt recognise the ppp0 connection?

See above. Connman just gets in the way.

just now i saw the post. thanks for the help.

well my usb modemā€™s ip keeps changing everytime i dial itā€¦
Link encap:Point-to-Point Protocol
inet addr:10.228.47.187 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:112 errors:1 dropped:0 overruns:0 frame:0
TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:26120 (25.5 KiB) TX bytes:9417 (9.1 KiB)
how to write the script then?

I guess you have to find the IP address using something like ip -f inet addr show ppp0, extracting it with grep, awk or sed. Note that my case is different: my 3G device is a router so always presents a local ip address. YMMV.

Note also you will have to address the security issue discussed here.