0

I have a router that can use a 4G LTE Android device as a WAN port for Internet access. Whenever the tablet runs out of power, upon restarting, the Mobile Hotspot and USB tethering options default to disabled.

Using Android 7.0 on an LG G Pad X 8.0, is it possible to write a script that automatically enables Mobile Hotspot and USB tethering upon startup ?

If possible, the solution should not require a Google login.

  • Is it possible to use both Wi-Fi and tethering at the same? – xavier_fakerat May 6 '17 at 8:28
  • @xavier_fakerat - On this device, yes. – uihdff May 7 '17 at 18:58
  • My suggestion would be doing it via Tasker, create a profile which execute the script at boot – xavier_fakerat May 7 '17 at 19:00
  • What commands would have to be in the script ? – uihdff May 8 '17 at 12:09
  • What about auto-enabling Mobile Hotspot ? – uihdff May 8 '17 at 12:15
0

You can use Tasker to accomplish this:

Objective: Auto Switch-on USB tethering and Mobile hotspot after boot

Profile (or Trigger)

Create a Profile which allows triggering of the Task at after boot:

  • Go to Profiles Tab and click the "+"
  • Event >> System >> Device Boot
  • Tap back to exit from this window

Task

You will notice as soon as you exit, you will be prompted to link this Profile to a Task;

  • Scroll all the way up the Task list select "New Task + "
  • You can name this Task AutoTethering or anything.
  • Click "+" to add new Action
  • Code >> Run Shell [ Command: service call connectivity 33 i32 1, Tick "Use Root"]
  • Tap back to exit from this task
  • Click "+" to add another action
  • Net >> WiFi Tether (Set On)
  • Press back the way all back until you exit Tasker (your profiles are now saved and ready for execution)

Extras: Give Tasker more priority (allow auto-start for Tasker, exclude from battery optimisations, task killers etc)

Explanation: Soon after boot, the first action turns on USB tethering, and the second option turns on WiFi tethering (note: there is no need for a second script because Tasker already has a built in WiFi Tether variable which is capable of handling tethering state)

This should work. Cheers (tried and tested).

  • That is an excellent and detailed solution. – uihdff May 9 '17 at 1:16
  • Please let me know if this method worked for you, will be happy to further discuss this – xavier_fakerat May 9 '17 at 8:43
  • I don't have a Google login and don't wish to use an app that requires one. At this point, it appears the only alternative is to root the device, modify one of the init scripts and add the commands you listed above. – uihdff May 10 '17 at 16:26
  • You can purchase directly from thier website, tasker.dinglisch.net/download.html, no need for Google login. trial is 7 days if you wish to try it before purchasing. Oops looks like direct purchase is no longer available my bad, howver you can just test the trial version without Google login and seevit would be a more comfortable option. Remember the choice is yours on the final decision – xavier_fakerat May 10 '17 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.