1

All,

There are a lot of threads on using a old android phone to USB tether to a raspberry pi for internet access. I am trying to tether a RPi to an android phone to allow passing of MQTT messages to my farm irrigation valves (esp8266 based). The idea is for me to be able to go out of town for a week or two at a time and have reliable connectivity to trigger my irrigation system. It is working (Galaxy s4 on Ting wireless, RPi3, Home Assistant), but the phone keeps untethering every few hours. Would Wifi tethering be more reliable? Should I root the phone and change operating systems?

Any help would be appreciated.

Montyhp

1
  • root the phone and change operating systems ... what alternative would you use?
    – jsotola
    Feb 16 '18 at 0:25
0

yes. I have it working stable via USB tethering with a google Nexus 5 phone which is rooted. I send the tethering command via android adb.

## /usr/bin/usbtether.sh

#!/bin/sh
adb shell service call connectivity 33 i32 1 s16 text

I am running a service:

[Unit]
Description=start tethering
Before=network-pre.target
Wants=network-pre.target
Requires=local-fs.target
After=local-fs.target

[Service]
Type=oneshot
SyslogIdentifier=tether
StandardOutput=syslog
StandardError=syslog
ExecStart=/usr/bin/usbtether.sh
RemainAfterExit=yes

[Install]
WantedBy=network.target

when setting it up, I found these resourced helpful:

https://github.com/sclem/pi-tether

https://android.stackexchange.com/questions/171744/how-can-i-enable-usb-tethering-through-adb

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.