Ask / Submit

Enable mobile data with command line

asked 2015-02-10 11:00:55 +0200

jona8000 gravatar image

updated 2015-02-10 14:20:23 +0200

chemist gravatar image


I would like to enable / disable the mobile data connection (2-3-4G) through the command line -> for a shell script.

So my purpose : to restart the connection when the connection go down in 3G -> and so return in 4G.



edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted

answered 2015-02-10 11:05:22 +0200

Philippe De Swert gravatar image

updated 2015-02-10 13:51:50 +0200

You can use ofono's dbus interface:

dbus-send --system --print-reply --dest=org.ofono / org.ofono.Manager.GetModems dbus-send --system --print-reply --dest=org.ofono /ril_0 org.ofono.NetworkRegistration.GetProperties

and so on...

Also forgot to actually turn the data connection on you need to use connman:

dbus-send --system --type=method_call --print-reply --dest=net.connman / net.connman.Manager.GetServices /* get all network connections and check the service path for the cellular */ dbus-send --system --type=method_call --print-reply --dest=net.connman /service_path/from/previous/command/ net.connman.Service.Connect

But restarting the connection when you are in 3G will not get you back to 4G...

edit flag offensive delete publish link more



OK thanks,

My script measures the performance of the mobile network -> so I try to return in 4g every x time.

jona8000 ( 2015-02-10 11:13:06 +0200 )edit

But 4G/3G switching depends on the network and reception, so that would not help anything unless you move to a place where you can recieve 4G... I guess I don't really get what you are trying to do.

Philippe De Swert ( 2015-02-10 13:53:08 +0200 )edit

On Sailfish 2.0 this does activate mobile data, but on the "events" page the "mobile data" icon doesn't light up... Is there something to restart to make Jolla acknowledge the change in the UI too?

Joril ( 2015-11-08 17:28:55 +0200 )edit
Login/Signup to Answer

Question tools



Asked: 2015-02-10 11:00:55 +0200

Seen: 1,247 times

Last updated: Feb 10 '15